Quick test method, system and device for built-in smart contract and medium
By optimizing the deployment and testing process of built-in smart contracts in blockchain, using access control lists and consensus mechanisms, the problem of inefficiency of existing testing methods is solved, and an efficient, flexible and secure smart contract testing environment is realized, and testing efficiency is improved. and security.
Patent Information
- Application Number
- CN202410983948.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-12
AI Technical Summary
The existing blockchain built-in smart contract testing methods are inefficient, mainly due to the complex logic and diversified functions of smart contracts, the test execution is difficult and time-consuming, and the distributed characteristics of the blockchain network make the contract execution and The verification process is slow, affecting the speed of testing.
By optimizing the deployment, configuration, execution, verification and result processing process of built-in smart contracts, writing smart contracts in the same programming language as blockchain, defining common parameters and testing special parameters, and introducing an access control list mechanism for user verification , ensure that only authorized users access and operate smart contracts, and confirm transactions through consensus mechanisms to improve testing efficiency and security.
Significantly improves the testing efficiency and security of built-in smart contracts, simplifies the deployment process, enhances the flexibility and effectiveness of testing, guarantees the integrity and credibility of data, reduces the risk of malicious attacks or tampering, and improves the Execution efficiency and result processing efficiency.
Smart Images

Figure CN118939542A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and more specifically to a method, system, device and medium for quickly testing a built-in smart contract. Background Art
[0002] With the rapid development of science and technology, blockchain technology has gradually moved from theory to practice, and its application scope is also expanding. The core advantages of blockchain technology lie in its decentralization, transparency and immutability, which make it an ideal choice for many fields such as financial services, supply chain management, and real estate transactions.
[0003] However, although blockchain technology has achieved remarkable results in these fields, traditional smart contracts as blockchain transaction media also have some limitations, such as reliance on third-party commitment execution, susceptibility to tampering, high execution costs, etc. In order to solve these problems, blockchain smart contract built-in technology has been introduced into the contract field.
[0004] Blockchain built-in smart contracts are executable agreements that exist in the form of code on the blockchain. They achieve decentralized and trustworthy execution by using distributed ledgers and cryptography. Built-in smart contracts can automatically execute contract terms without third-party intervention and perform specific operations under pre-determined conditions. This automated execution process not only improves the reliability and security of the contract, but also reduces execution costs and execution time.
[0005] The current testing methods for blockchain built-in smart contracts mainly include unit testing, integration testing, security testing, performance testing, and automated testing. These methods are designed to fully verify the correctness, security, and performance of smart contracts from multiple perspectives to ensure that they can run stably and reliably in the blockchain environment.
[0006] However, the existing testing methods are inefficient, which is mainly reflected in:
[0007] 1. The complex logic and diverse functions of smart contracts lead to numerous testing scenarios, making test execution difficult and time-consuming.
[0008] 2. The distributed nature of the blockchain network slows down the contract execution and verification process, affecting the testing speed. Summary of the invention
[0009] In view of the above problems, the purpose of the present invention is to provide a method, system, device and medium for quickly testing built-in smart contracts. By optimizing the deployment, configuration, execution, verification and result processing flow of built-in smart contracts, the testing efficiency and security of built-in smart contracts are significantly improved, providing developers with a more efficient, flexible and secure smart contract testing environment.
[0010] In order to achieve the above object, the present invention is implemented through the following technical solutions:
[0011] In a first aspect, the present invention discloses a method for quickly testing a built-in smart contract, comprising:
[0012] Smart contracts are written in the same programming language as the blockchain;
[0013] Define common parameters, test-specific parameters and functions of smart contracts;
[0014] Integrate smart contracts with blockchain and deploy smart contracts;
[0015] Call the smart contract and fill in the calling parameters according to the usage scenario;
[0016] User verification is performed through the access control list mechanism;
[0017] After the user passes the verification, the logic in the smart contract is executed to complete the smart contract execution process;
[0018] Encapsulate the smart contract execution results and send a response to the smart contract calling node or related nodes.
[0019] Further, the definition of common parameters, test-specific parameters and functions of the smart contract includes: defining the calling host, calling contract name, calling contract method, calling user name, calling user certificate, organization and user authentication type of the smart contract;
[0020] Set the number of startup threads, number of loops, timeout, interval for merging call results, and interval for outputting call results;
[0021] Define the smart contract calling function, user and credential verification function, smart contract execution function, execution result acquisition function and output function.
[0022] Furthermore, the smart contract is integrated with the blockchain and deployed, including:
[0023] Create a built-in smart contract directory in the blockchain code and store the smart contract in the built-in smart contract directory;
[0024] By adding configuration parameters to the blockchain's configuration module, it can automatically load and deploy the built-in smart contract after startup.
[0025] Furthermore, the calling of the smart contract and filling in the calling parameters according to the usage scenario include:
[0026] Use cmc to call smart contracts;
[0027] According to the current usage scenario, set the calling host, contract name, contract method, user name, user certificate, number of startup threads and number of loops by filling in the calling parameters.
[0028] Further, the user verification through the access control list mechanism includes:
[0029] Authentication is performed through the access control list mechanism based on the verification type and user credentials entered by the user; after the identity authentication is passed, access rights are checked.
[0030] Furthermore, after the user passes the verification, the logic in the smart contract is executed to complete the smart contract execution process, including:
[0031] After the user passes the verification, the blockchain status is modified by executing the logic in the smart contract, and the result is written into the immutable ledger;
[0032] Events may be triggered through smart contract execution, and monitored and responded to through preset applications;
[0033] The generated transactions are stored in blocks and confirmed through a consensus mechanism to complete the contract execution process.
[0034] Furthermore, the smart contract execution result is encapsulated and a response is sent to the smart contract calling node or related nodes, including:
[0035] Package the smart contract execution results into JSON format response data and send it to the calling node through the blockchain network;
[0036] The response data is parsed by the calling node, and corresponding operations are triggered according to the parsing results.
[0037] In a second aspect, the present invention also discloses a rapid testing system for a built-in smart contract, including: a contract writing module for writing a smart contract using the same programming language as the blockchain;
[0038] Configuration module, which is used to define common parameters, test-specific parameters and functions of smart contracts;
[0039] Integrated deployment module, used to integrate smart contracts with blockchain and deploy smart contracts;
[0040] The contract calling module is used to call the smart contract and fill in the calling parameters according to the usage scenario;
[0041] User verification module, used to perform user verification through access control list mechanism;
[0042] The execution module is used to execute the logic in the smart contract after the user passes the verification to complete the smart contract execution process;
[0043] The result encapsulation and response module is used to encapsulate the smart contract execution results and send a response to the smart contract calling node or related nodes.
[0044] In a third aspect, the present invention further discloses a rapid testing device with a built-in smart contract, comprising:
[0045] Memory, used to store quick test programs for built-in smart contracts;
[0046] A processor is used to implement the steps of the method for quickly testing a built-in smart contract as described in any of the above items when executing the quick testing program of the built-in smart contract.
[0047] In a fourth aspect, the present invention further discloses a readable storage medium, on which a quick testing program for a built-in smart contract is stored. When the quick testing program for a built-in smart contract is executed by a processor, the steps of the quick testing method for a built-in smart contract as described in any of the above items are implemented.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] 1. The present invention directly opens a built-in smart contract directory in the blockchain code and adds corresponding parameters in the configuration module to achieve automatic loading and deployment, which greatly simplifies the deployment process of smart contracts and improves deployment efficiency. At the same time, the common parameters, test-specific parameters and functions of smart contracts are defined, so that the test process can be flexibly configured according to specific needs, further improving the pertinence and effectiveness of the test.
[0050] 2. The present invention introduces an access control list mechanism to verify users, ensuring that only authorized users can access and operate smart contracts, effectively ensuring the security of smart contracts. At the same time, during the execution of smart contracts, the generated transactions are confirmed through a consensus mechanism, ensuring the data consistency and security of all nodes on the blockchain. These security measures effectively reduce the risk of smart contracts being maliciously attacked or tampered with.
[0051] 3. After the user passes the verification, the present invention can start the built-in smart contract to efficiently execute the logic therein, modify the blockchain state, and write the results into the immutable account book, thereby ensuring the integrity and credibility of the data. At the same time, the events that may be triggered during the execution of the smart contract are monitored and responded to by the preset application, thereby increasing the flexibility and scalability of the smart contract. In addition, the smart contract execution results are encapsulated into response data in JSON format and sent to the calling node through the blockchain network, so that the calling node can easily parse the data and trigger the corresponding operation, thereby improving the ease of use and interactivity of the smart contract. These measures jointly improve the execution efficiency and result processing efficiency of the built-in smart contract.
[0052] 4. The present invention provides an efficient, flexible and secure method for rapid testing of built-in smart contracts, which is of great significance for promoting the development of blockchain technology and the widespread application of smart contracts.
[0053] It can be seen that compared with the prior art, the present invention has outstanding substantive features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0055] Figure 1 It is a method flow chart of a specific implementation mode of the present invention.
[0056] Figure 2 It is a system structure diagram of a specific implementation mode of the present invention.
[0057] Figure 3 It is a device structure diagram of a specific implementation mode of the present invention.
[0058] In the figure, 1. Contract writing module; 2. Configuration module; 3. Integrated deployment module; 4. Contract calling module; 5. User verification module; 6. Execution module; 7. Result encapsulation and response module; 101. Processor; 102. Memory; 103. Input interface; 104. Output interface; 105. Communication unit; 106. Keyboard; 107. Display; 108. Mouse. DETAILED DESCRIPTION
[0059] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0060] See also Figure 1 As shown, this embodiment provides a quick testing method for a built-in smart contract, comprising the following steps:
[0061] S1: Write smart contracts using the same programming language as the blockchain.
[0062] In a specific implementation, the Golang language is used to write a smart contract, and the contents of the smart contract include but are not limited to naming the contract name, contract initialization, obtaining the contract method, the contract CURD method, the historical record query method, and the batch query and range query methods mainly used for performance testing. In addition, the written smart contract can be a test contract.
[0063] S2: Define common parameters, test-specific parameters and functions of the smart contract.
[0064] In a specific implementation manner, this step is specifically as follows:
[0065] Define the calling host, calling contract name, calling contract method, calling user name, calling user certificate, organization and user authentication type of the smart contract; set the number of startup threads, number of loops, timeout, calling result merging interval, calling result output interval; define the smart contract calling function, user and credential verification function, smart contract execution function, execution result acquisition function and output function.
[0066] As an example, first define common parameters, including but not limited to: calling host, calling contract name, calling contract method, calling user name, calling user certificate, organization, user authentication type, etc. At the same time, in order to achieve the purpose of stress testing, set test-specific parameters, including but not limited to the number of startup threads, number of loops, timeout, call result merging, call result output interval, etc.; define functions, including obtaining the smart contract and method called by the user based on reflection, verifying the user and credentials, contract method execution, result acquisition and merging, sleep and log output, etc.
[0067] S3: Integrate smart contracts with blockchain and deploy smart contracts.
[0068] In a specific implementation, first, a built-in smart contract directory is created in the blockchain code, and the smart contract is stored in the built-in smart contract directory; then, configuration parameters are added to the configuration module of the blockchain so that the built-in smart contract is automatically loaded and deployed after startup.
[0069] As an example, first integrate the written smart contract with the blockchain. In order to easily maintain and manage multiple smart contracts, create a built-in smart contract directory in the blockchain code to place the newly written smart contract; then add configuration to the blockchain configuration module to automatically load and deploy the built-in smart contract after startup without manual intervention. The automated deployment process simplifies the management and maintenance of smart contracts and ensures their consistency and reliability throughout the network.
[0070] S4: Call the smart contract and fill in the calling parameters according to the usage scenario.
[0071] In a specific implementation, the smart contract is called and the calling parameters are filled in according to the usage scenario, including but not limited to the calling host, contract name, contract method, user name, user certificate, number of startup threads, number of loops, etc. This step is called using the general cmc method and executed in parallel according to the parameters.
[0072] S5: User verification is performed through the access control list mechanism.
[0073] In a specific implementation, firstly, identity authentication is performed based on the verification type and user credentials input by the user to prove the legitimacy of the identity. After the identity authentication is passed, the access rights are checked to ensure that only authorized users can perform specific operations. This step is implemented through the access control list mechanism. If the identity authentication fails, the test ends directly.
[0074] S6: After the user passes the verification, the logic in the smart contract is executed to complete the smart contract execution process.
[0075] In a specific implementation, after the user passes the verification, the blockchain state is modified by executing the logic in the smart contract, and the result is written into the immutable ledger. Then, the smart contract execution may trigger an event, which is monitored and responded to by the preset application. Finally, the generated transaction is stored in the block and confirmed by the consensus mechanism to complete the contract execution process.
[0076] As an example, after verification, the logic in the contract is executed, the blockchain state is modified, and the results are written to the immutable ledger. Contract execution may trigger events, other contracts or applications can listen and respond, and the generated transactions are included in the block and confirmed by the consensus mechanism to complete the contract execution process. When a smart contract is executed, it can be executed in a loop according to the preset number of executions.
[0077] S7: Encapsulate the smart contract execution result and send a response to the smart contract calling node or related nodes.
[0078] In a specific implementation, the smart contract execution result is first packaged into response data in JSON format and sent to the calling node through the blockchain network; then the response data is parsed by the calling node, and corresponding operations are triggered according to the parsing results.
[0079] As an example, the contract execution results are packaged into data in a specific format, such as JSON or other data structures, and sent to the caller through the blockchain network. In this step, the contract execution results may need to undergo additional processing or verification to ensure their accuracy and completeness. Once the results are packaged and sent, the caller or related party can parse the response and take further actions accordingly, such as updating the user interface, performing subsequent operations, or triggering other smart contracts. This mechanism helps ensure the effective communication and subsequent processing of the contract execution results, thereby improving the reliability and availability of the smart contract system.
[0080] The present invention provides a method for rapid testing of built-in smart contracts. By optimizing the deployment, configuration, execution, verification and result processing processes of built-in smart contracts, the testing efficiency and security of built-in smart contracts are significantly improved, providing developers with a more efficient, flexible and secure smart contract testing environment.
[0081] See also Figure 2 As shown, the present invention also discloses a rapid testing system for a built-in smart contract, including: a contract writing module 1, a configuration module 2, an integrated deployment module 3, a contract calling module 4, a user verification module 5, an execution module 6 and a result encapsulation and response module 7.
[0082] The contract writing module 1 is used to write smart contracts using the same programming language as the blockchain.
[0083] Configuration module 2 is used to define common parameters, test-specific parameters and functions of smart contracts.
[0084] The integrated deployment module 3 is used to integrate the smart contract with the blockchain and deploy the smart contract.
[0085] The contract calling module 4 is used to call the smart contract and fill in the calling parameters according to the usage scenario.
[0086] The user verification module 5 is used to perform user verification through an access control list mechanism.
[0087] Execution module 6 is used to execute the logic in the smart contract after the user verification is passed to complete the smart contract execution process.
[0088] The result encapsulation and response module 7 is used to encapsulate the smart contract execution result and send a response to the smart contract calling node or related nodes.
[0089] The specific implementation of the built-in smart contract rapid testing system of this embodiment is basically the same as the specific implementation of the built-in smart contract rapid testing method described above, and will not be repeated here.
[0090] See also Figure 3As shown, the present invention also discloses a quick testing device for a built-in smart contract, comprising a processor 101 and a memory 102; wherein, when the processor 101 executes the quick testing program for the built-in smart contract stored in the memory, the steps of the quick testing method for the built-in smart contract as described in any one of the above items are implemented.
[0091] The quick testing device with built-in smart contract provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.
[0092] Among them, the processor 101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 101 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 101 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 101 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0093] The memory 102 may include one or more computer-readable storage media, which may be non-transitory. The memory 102 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 102 is at least used to store the following computer program, wherein, after the computer program is loaded and executed by the processor 101, the relevant steps of the fast testing method of the built-in smart contract disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 102 may also include an operating system and data, etc., and the storage method may be short-term storage or permanent storage. Among them, the operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, the data involved in the above-mentioned fast testing method of the built-in smart contract, etc.
[0094] Furthermore, the fast testing device for the built-in smart contract in this embodiment may also include:
[0095] The input interface 103 is used to obtain the quick test program of the built-in smart contract imported from the outside, and save the obtained quick test program of the built-in smart contract to the memory 102. It can also be used to obtain various instructions and parameters transmitted by the external terminal device, and transmit them to the processor 101, so that the processor 101 can use the above various instructions and parameters to carry out corresponding processing. In this embodiment, the input interface 103 can specifically include but is not limited to a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, etc.
[0096] The output interface 104 is used to output various data generated by the processor 101 to a terminal device connected thereto, so that other terminal devices connected to the output interface can obtain various data generated by the processor 101. In this embodiment, the output interface 104 may specifically include but is not limited to a USB interface, a serial interface, and the like.
[0097] The communication unit 105 is used to establish a remote communication connection between the server operation service optimization configuration device and the external server, so that the built-in smart contract quick test device can mount the image file to the external server. In this embodiment, the communication unit 105 may specifically include but is not limited to a remote communication unit based on wireless communication technology or wired communication technology.
[0098] The keyboard 106 is used to obtain various parameter data or instructions input by the user by tapping the keycaps in real time.
[0099] Display 107 is used to display relevant information of the rapid testing process of running the built-in smart contract in real time.
[0100] The mouse 108 can be used to assist the user in inputting data and simplify the user's operation.
[0101] The present invention also discloses a readable storage medium, wherein the readable storage medium includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable hard disk, a CD-ROM or any other form of storage medium known in the technical field. The readable storage medium stores a fast test program for a built-in smart contract, and when the fast test program for a built-in smart contract is executed by a processor, the steps of the fast test method for a built-in smart contract as described in any one of the above items are implemented.
[0102] In summary, the present invention significantly improves the testing efficiency and security of built-in smart contracts by optimizing the deployment, configuration, execution, verification and result processing processes of built-in smart contracts, providing developers with a more efficient, flexible and secure smart contract testing environment.
[0103] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. As for the method disclosed in the embodiment, since it corresponds to the system disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0104] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0105] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0106] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit.
[0108] Similarly, each processing unit in each embodiment of the present invention may be integrated into one functional module, or each processing unit may exist physically, or two or more processing units may be integrated into one functional module.
[0109] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0110] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0111] The above is a detailed introduction to the built-in smart contract rapid testing method, system, device and readable storage medium provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A fast testing method for built-in smart contracts, characterized in that: include: Smart contracts are written in the same programming language as the blockchain; Define common parameters, test-specific parameters and functions of smart contracts; Integrate smart contracts with blockchain and deploy smart contracts; Call the smart contract and fill in the calling parameters according to the usage scenario; User verification is performed through the access control list mechanism; After the user passes the verification, the logic in the smart contract is executed to complete the smart contract execution process; Encapsulate the smart contract execution results and send a response to the smart contract calling node or related nodes.
2. The method for rapid testing of built-in smart contracts according to claim 1, characterized in that: The definition of common parameters, test-specific parameters and functions of smart contracts includes: Define the calling host, calling contract name, calling contract method, calling user name, calling user certificate, organization and user authentication type of the smart contract; Set the number of startup threads, number of loops, timeout, interval for merging call results, and interval for outputting call results; Define the smart contract calling function, user and credential verification function, smart contract execution function, execution result acquisition function and output function.
3. The method for rapid testing of built-in smart contracts according to claim 1, characterized in that: The smart contract is integrated with the blockchain and deployed, including: Create a built-in smart contract directory in the blockchain code and store the smart contract in the built-in smart contract directory; By adding configuration parameters to the blockchain's configuration module, it can automatically load and deploy the built-in smart contract after startup.
4. The method for rapid testing of built-in smart contracts according to claim 1, characterized in that: The calling smart contract and filling in the calling parameters according to the usage scenario include: Use cmc to call smart contracts; According to the current usage scenario, set the calling host, contract name, contract method, user name, user certificate, number of startup threads and number of loops by filling in the calling parameters.
5. The method for rapid testing of built-in smart contracts according to claim 1, characterized in that: The user verification is performed through the access control list mechanism, including: Authentication is performed through the access control list mechanism based on the verification type and user credentials entered by the user; after the identity authentication is passed, access rights are checked.
6. The method for rapid testing of built-in smart contracts according to claim 1, characterized in that: After the user passes the verification, the logic in the smart contract is executed to complete the smart contract execution process, including: After the user passes the verification, the blockchain status is modified by executing the logic in the smart contract, and the result is written into the immutable ledger; Events may be triggered through smart contract execution, and monitored and responded to through preset applications; The generated transactions are stored in blocks and confirmed through a consensus mechanism to complete the contract execution process.
7. The method for rapid testing of built-in smart contracts according to claim 1, characterized in that: The smart contract execution result is encapsulated and a response is sent to the smart contract calling node or related nodes, including: Package the smart contract execution results into JSON format response data and send it to the calling node through the blockchain network; The response data is parsed by the calling node, and corresponding operations are triggered according to the parsing results.
8. A fast testing system with built-in smart contracts, characterized in that: include: Contract writing module, used to write smart contracts using the same programming language as the blockchain; The configuration module is used to define the general parameters of the smart contract, test-specific parameters and functions; the integration and deployment module is used to integrate the smart contract with the blockchain and deploy the smart contract; The contract calling module is used to call the smart contract and fill in the calling parameters according to the usage scenario; User verification module, used to perform user verification through access control list mechanism; The execution module is used to execute the logic in the smart contract after the user passes the verification to complete the smart contract execution process; The result encapsulation and response module is used to encapsulate the smart contract execution results and send a response to the smart contract calling node or related nodes.
9. A fast testing device with a built-in smart contract, characterized in that: include: Memory, used to store quick test programs for built-in smart contracts; A processor, configured to implement the steps of the method for quickly testing a built-in smart contract as described in any one of claims 1 to 7 when executing the quick testing program of the built-in smart contract.
10. A readable storage medium, characterized in that: The readable storage medium stores a quick test program for a built-in smart contract, and when the quick test program for a built-in smart contract is executed by a processor, the steps of the quick test method for a built-in smart contract as described in any one of claims 1 to 7 are implemented.
