A multi-chain smart contract testing method, system, electronic device and storage medium
Through multi-chain smart contract testing methods and systems, the testing tasks of smart contracts are automatically processed, the testing efficiency is improved, the problems of low testing efficiency and high cost in the existing technology are solved, and logical error detection and detection of multi-chain contracts are realized. Effective testing of collaboration scenarios.
Patent Information
- Application Number
- CN202410149576.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-02
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-02-02
AI Technical Summary
The multi-chain testing efficiency of smart contracts in the existing technology is low and complex testing environments need to be manually constructed, resulting in low testing efficiency. In particular, collaborative logic vulnerability detection on multiple blockchain networks is difficult and costly.
Provide a multi-chain smart contract testing method and system that receives user-defined test tasks, generates task arrangements, executes test logic code, generates test case information, sends call requests to multiple blockchain networks, and compares request execution results With expected results, generate test reports and implement automated testing.
It improves the testing efficiency of smart contracts, reduces labor costs, can effectively discover logical errors in multi-chain contracts and problems in collaboration scenarios, and reduces risks.
Smart Images

Figure CN117971677B
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart contract testing technology, and in particular to a multi-chain smart contract testing method, system, electronic device and storage medium. Background Art
[0002] Smart contracts are program codes written in a specific programming language and run on the blockchain. When the blockchain processes a call request, the corresponding smart contract is triggered and executed. Smart contracts store specific business status data and contain business processing logic. Smart contracts can be applied to logistics, medical care, e-commerce and other fields.
[0003] Smart contracts are one of the important applications of blockchain technology. If there are loopholes or logical errors in the written business contracts, it will cause great losses, so the security of smart contracts is very important. Smart contract testing is an important means to ensure the correctness, security and performance of the contract. Through testing, problems can be discovered earlier and risks can be reduced.
[0004] In related technologies, smart contracts are usually tested through manual testing. When business contracts are deployed on multiple blockchains of different types, testers are required to build a complex testing environment by themselves, which results in low testing efficiency.
[0005] Therefore, how to realize automated testing of multi-chain smart contracts and improve testing efficiency is a technical problem that technicians in this field currently need to solve. Summary of the invention
[0006] The purpose of this application is to provide a multi-chain smart contract testing method, system, electronic device and storage medium, which can realize automated testing of multi-chain smart contracts and improve testing efficiency.
[0007] In order to solve the above technical problems, this application provides a multi-chain smart contract testing method, including:
[0008] Receive a test task of a target smart contract defined online by a user; wherein the test task includes a blockchain network identifier, a contract address, a test logic code, and a task type;
[0009] generating a task schedule according to the task type;
[0010] Execute the test logic code according to the task arrangement to obtain test case information;
[0011] Sending a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, and receiving a request execution result returned by each blockchain network; wherein the call request is used to call the contract address;
[0012] The requested execution result is compared with the expected execution result corresponding to the test case information to obtain the test result of the target smart contract.
[0013] Optionally, executing the test logic code according to the task arrangement to obtain test case information includes:
[0014] The test time is determined according to the task arrangement, and the test logic code is executed at the test time to obtain test case information; wherein the test case information includes function call information, parameter information and expected execution result.
[0015] Optionally, sending a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information includes:
[0016] Construct a call request including the function call information and the parameter information, and send the call request to multiple blockchain networks corresponding to the blockchain network identifier.
[0017] Optionally, generating a task schedule according to the task type includes:
[0018] If the task type is a periodic task, a first task schedule is generated; wherein the first task schedule is a task schedule for executing the test logic code at time intervals.
[0019] Optionally, generating a task schedule according to the task type includes:
[0020] If the task type is a custom task, a second task schedule is generated; wherein the second task schedule is a task schedule for executing the test logic code at each block height.
[0021] Optionally, after comparing the request execution result with the expected execution result corresponding to the test case information, the method further includes:
[0022] Determine a comparison result between the requested execution result and the expected execution result;
[0023] A test report is generated according to the test task, the test case, the request execution result and the comparison result.
[0024] Optionally, comparing the request execution result with the expected execution result corresponding to the test case information to obtain the test result of the target smart contract includes:
[0025] Comparing all the request execution results with the expected execution results corresponding to the test case information;
[0026] Determining whether all the requested execution results are the same as the expected execution results;
[0027] If yes, then output the test result that the target smart contract passed the test;
[0028] If not, the test result indicating that the target smart contract failed the test is output.
[0029] The present application also provides a multi-chain smart contract testing system, which includes:
[0030] A task receiving module, used to receive a test task of a target smart contract defined online by a user; wherein the test task includes a blockchain network identifier, a contract address, a test logic code and a task type;
[0031] A task scheduling generation module, used to generate a task schedule according to the task type;
[0032] A test case generation module, used to execute the test logic code according to the task arrangement to obtain test case information;
[0033] A test module, configured to send a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, and receive a request execution result returned by each blockchain network; wherein the call request is used to call the contract address;
[0034] The test result generation module is used to compare the request execution result with the expected execution result corresponding to the test case information to obtain the test result of the target smart contract.
[0035] The present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps of executing the above-mentioned multi-chain smart contract testing method are implemented.
[0036] The present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of executing the above-mentioned multi-chain smart contract testing method are implemented.
[0037] The present application provides a multi-chain smart contract testing method, comprising: receiving a test task of a target smart contract defined online by a user; wherein the test task includes a blockchain network identifier, a contract address, a test logic code and a task type; generating a task schedule according to the task type; executing the test logic code according to the task schedule to obtain test case information; sending a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, and receiving a request execution result returned by each of the blockchain networks; wherein the call request is used to call the contract address; comparing the request execution result with the expected execution result corresponding to the test case information to obtain a test result of the target smart contract.
[0038] This application receives the test tasks defined by the user online, and determines the blockchain network identifier, contract address, test logic code and task type contained in the test task. This application generates a task schedule according to the task type, executes the corresponding test logic code according to the task schedule to obtain the test case information, and sends a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, so as to call the contract address in multiple blockchain networks, thereby triggering the corresponding target smart contract. This application can also receive the request execution results of each blockchain network for the call request. The test case information includes the expected execution result of the call request. This application compares the request execution result with the expected execution result to obtain the test result of the target smart contract. This application can realize the automated testing of multi-chain smart contracts and improve the testing efficiency. This application also provides a multi-chain smart contract testing system, a storage medium and an electronic device, which have the above-mentioned beneficial effects and are not repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 A flowchart of a multi-chain smart contract testing method provided in an embodiment of the present application;
[0041] Figure 2 A flowchart of an online automatic testing method applicable to a multi-chain smart contract provided in an embodiment of the present application;
[0042] Figure 3 An interactive schematic diagram of an online automatic testing system for multi-chain smart contracts provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of the structure of an online automatic testing device suitable for multi-chain smart contracts provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] See below Figure 1 , Figure 1 A flowchart of a multi-chain smart contract testing method provided in an embodiment of the present application.
[0046] Specific steps may include:
[0047] S101: Receive a test task of a target smart contract defined online by a user;
[0048] Among them, this embodiment can be applied to the server of the automatic testing system, which can receive the test task defined by the user online, and the test task is a task to test the target smart contract. The above-mentioned automatic testing system can also include a front end and multiple blockchain networks, and the user defines the test task online through the front end.
[0049] The above test tasks include blockchain network identifier, contract address, test logic code and task type. The blockchain network identifier is the identifier of multiple blockchain networks; the contract address is the address where the target smart contract under test is deployed on the blockchain network to which it belongs; the test logic code is written in a general programming language (Java, Python, Javascript, etc.), and can be calculated based on the block height and contract status, and output test case information; the task type is used to describe the type of test task, which can include two types: periodic interval tasks and custom tasks.
[0050] S102: Generate a task schedule according to the task type;
[0051] Among them, in this embodiment, task arrangement is generated according to the task type, and task arrangement is used to guide the server how to execute the test logic code. Task arrangement can include logical processing such as sorting of test cases, condition judgment, and loop execution to ensure the integrity and accuracy of the test process.
[0052] If the task type is a periodic task, a first task schedule is generated; wherein the first task schedule is a task schedule for executing the test logic code at a time interval. If the task type is a custom task, a second task schedule is generated; wherein the second task schedule is a task schedule for executing the test logic code at each block height.
[0053] S103: Execute the test logic code according to the task arrangement to obtain test case information;
[0054] Among them, on the basis of obtaining the task arrangement, the above test logic code can be executed according to the task arrangement to obtain the test case information. The above test case information may include function call information (i.e., calling function), parameter information and expected execution result. Function call information refers to the function to be called, parameter information refers to the input data to be passed to the function, and expected execution result refers to the function execution result expected by the test case.
[0055] S104: Sending a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, and receiving a request execution result returned by each blockchain network;
[0056] Among them, the network identifiers of multiple blockchain networks can be determined according to the blockchain network identifier in the test task. This step can generate a call request according to the test case information, and then send the call request to the multiple blockchain networks corresponding to the blockchain network identifier. As a feasible implementation method, this embodiment can generate a call request according to the function call information and parameter information in the test case information. The above call request is used to call the contract address, and the target smart contract in the contract address can be triggered after the blockchain network receives the call request. The blockchain network includes multiple nodes. The blockchain network that receives and sends data in this embodiment is actually a node in the blockchain network.
[0057] The blockchain network can use the result generated after the target smart contract is triggered as the request execution result, that is, the execution result of the call request. The blockchain network can return the above request execution result to the server.
[0058] S105: Compare the request execution result with the expected execution result corresponding to the test case information to obtain the test result of the target smart contract.
[0059] Among them, based on the request execution result, this embodiment can determine the expected execution result corresponding to the test case information, and then compare the request execution result with the expected execution result. The above-mentioned expected execution result refers to the result generated by triggering the target smart contract when there are no vulnerabilities and / or logical errors in the target smart contract. According to the comparison result between the request execution result and the expected execution result, it can be judged whether the target smart contract has vulnerabilities and / or logical errors, that is, the test result of the target smart contract is obtained.
[0060] This embodiment receives a test task defined online by a user, and determines the blockchain network identifier, contract address, test logic code, and task type contained in the test task. This embodiment generates a task schedule according to the task type, executes the corresponding test logic code according to the task schedule to obtain test case information, and sends a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, so as to call the contract address in multiple blockchain networks, thereby triggering the corresponding target smart contract. This embodiment can also receive the request execution results of the call request from each blockchain network. The test case information includes the expected execution result of the call request. This embodiment compares the request execution result with the expected execution result to obtain the test result of the target smart contract. This embodiment can realize the automated testing of multi-chain smart contracts and improve the testing efficiency.
[0061] As for Figure 1 Further introduction to the corresponding embodiment, the test case information can be generated in the following manner: determining the test time according to the task scheduling, and executing the test logic code at the test time to obtain the test case information; wherein the test case information includes function call information, parameter information and expected execution results. Specifically, this embodiment can construct a call request including the function call information and the parameter information, and send the call request to multiple blockchain networks.
[0062] As for Figure 1 Further introduction to the corresponding embodiment, after comparing the request execution result with the expected execution result corresponding to the test case information, the comparison result between the request execution result and the expected execution result can be determined by generating a test report at that time as follows: generating a test report according to the test task, the test case, the request execution result and the comparison result. On the basis of obtaining the test report, the test report can be transmitted to the user terminal for analysis.
[0063] As for Figure 1Further introduction to the corresponding embodiment can generate the test result of the target smart contract in the following manner: compare all the request execution results with the expected execution results corresponding to the test case information; determine whether all the request execution results are the same as the expected execution results; if so, output the test result that the target smart contract passes the test; if not, output the test result that the target smart contract fails the test.
[0064] The process described in the above embodiment is explained below through an embodiment in actual application.
[0065] In related technologies, manual testing is usually used to detect vulnerabilities and logical errors in smart contracts. However, due to the complexity of the business, problems with smart contracts may only be discovered in specific scenarios. It is relatively difficult and costly to discover problems through manual testing. When business contracts are deployed on a large number of blockchain networks of different types, the testing of smart contracts requires the local construction and operation of the corresponding environment and test programs, which is a relatively complicated process. At the same time, when business contracts are distributed on multiple blockchains, collaborative logic vulnerability testing is also more difficult.
[0066] In view of the complexity of the multi-chain smart contract testing environment, the high cost of manual testing, and the difficulty in discovering problems in special scenarios, this embodiment provides an online automatic testing solution for multi-chain smart contracts. This solution provides testing services in an online manner, avoiding the complexity brought by the tester building the test environment by himself. The automated testing process in this solution can effectively reduce labor costs, and can test more complex specific business scenarios and multi-chain smart contract collaboration scenarios according to logical settings, so as to more effectively discover smart contract vulnerabilities or logical errors and reduce risks.
[0067] See also Figure 2 , Figure 2 A flowchart of an online automatic testing method for a multi-chain smart contract provided in an embodiment of the present application may specifically include the following steps:
[0068] S201: The user defines and submits the test task of the target smart contract online.
[0069] The test task includes the blockchain network to which the tested contract belongs, the contract address, the test logic code and the task type. The test logic code is written in a general programming language (Java, Python, Javascript, etc.), and can calculate based on the block height and contract status to output test case information. The contract address is the address where the tested contract is deployed on the blockchain network to which it belongs. The task type includes two types: periodic interval and custom.
[0070] S202: The multi-chain smart contract testing system receives the test task and generates a task schedule based on the task type.
[0071] After the test task is submitted to the test system platform, task scheduling can be generated according to the task type. Among them, periodic interval tasks will execute the test logic at intervals, and custom tasks will execute the test logic code at each block height.
[0072] S203: Execute the test logic code according to the task arrangement and collect test case information.
[0073] Specifically, when the test case information output by the test logic code is not empty, the test case information is collected and the process proceeds to S204, otherwise S203 is repeated. The test case information includes function call information, parameter information, and expected execution results.
[0074] S204: Send a call request to the blockchain network according to the test case information, and receive the request execution result.
[0075] Specifically, this step can send a call request to the blockchain network to which the tested contract belongs according to the blockchain network identifier and contract address contained in the test task and the test case information obtained in S203. The call request is a call to the contract address in the corresponding task, and the content of the call request is the call function and parameter information corresponding to the test case. After sending the call request, you can wait and collect the request execution result.
[0076] S205: Compare the request execution result with the expected execution result in the test case information, generate a test report and send it to the front end.
[0077] The above test report content includes the smart contract test task information, the test case information generated by S203, and the request execution result and comparison result of S204.
[0078] See also Figure 3 , Figure 3 The interactive diagram of an online automatic test system for multi-chain smart contracts provided in an embodiment of the present application is shown in FIG. The online automatic test system may specifically include a front end, a server, a blockchain network 1, and a blockchain network 2. The front end sends a smart contract test task to the server, and the server sends a blockchain call request to blockchain network 1 and blockchain network 2. The server can receive the request execution result from blockchain network 1 and blockchain network 2, and the server generates a smart contract test result based on the request execution result. The front end can receive the smart contract test result sent by the server.
[0079] See also Figure 4 , Figure 4This is a structural diagram of an online automatic testing device for multi-chain smart contracts provided in an embodiment of the present application, which includes an editing module, a receiving and arranging module, an execution module, and a sending module. The editing module can perform the operation of S201, the receiving and arranging module can perform the operations of S202 and S203, the execution module can perform the operation of S204, and the sending module can perform the operation of S205.
[0080] The solution provided by this embodiment can automatically test complex business of smart contracts, and customize test cases according to the business status of the contract, realize the contract logic error check in special scenarios, and improve the testing efficiency. This embodiment can solve the complex problems of multi-chain smart contract testing and reduce labor costs. This embodiment can test the contract business collaboration process between multiple chains and find the logic and interaction errors between business contract interactions.
[0081] The present application also provides a multi-chain smart contract testing system, including:
[0082] A task receiving module, used to receive a test task of a target smart contract defined online by a user; wherein the test task includes a blockchain network identifier, a contract address, a test logic code and a task type;
[0083] A task scheduling generation module, used to generate a task schedule according to the task type;
[0084] A test case generation module, used to execute the test logic code according to the task arrangement to obtain test case information;
[0085] A test module, configured to send a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, and receive a request execution result returned by each blockchain network; wherein the call request is used to call the contract address;
[0086] The test result generation module is used to compare the request execution result with the expected execution result corresponding to the test case information to obtain the test result of the target smart contract.
[0087] This embodiment receives a test task defined online by a user, and determines the blockchain network identifier, contract address, test logic code, and task type contained in the test task. This embodiment generates a task schedule according to the task type, executes the corresponding test logic code according to the task schedule to obtain test case information, and sends a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, so as to call the contract address in multiple blockchain networks, thereby triggering the corresponding target smart contract. This embodiment can also receive the request execution results of the call request from each blockchain network. The test case information includes the expected execution result of the call request. This embodiment compares the request execution result with the expected execution result to obtain the test result of the target smart contract. This embodiment can realize the automated testing of multi-chain smart contracts and improve the testing efficiency.
[0088] Furthermore, the test case generation module executes the test logic code according to the task scheduling, and the process of obtaining the test case information includes: determining the test time according to the task scheduling, and executing the test logic code at the test time to obtain the test case information; wherein the test case information includes function call information, parameter information and expected execution results.
[0089] Furthermore, the process in which the test module sends a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information includes: constructing a call request including the function call information and the parameter information, and sending the call request to the multiple blockchain networks corresponding to the blockchain network identifier.
[0090] Furthermore, the process of generating a task schedule according to the task type by the schedule generation module includes: if the task type is a periodic task, generating a first task schedule; wherein the first task schedule is a task schedule for executing the test logic code at a time interval.
[0091] Furthermore, the process of generating a task schedule according to the task type by the schedule generation module includes: if the task type is a custom task, generating a second task schedule; wherein the second task schedule is a task schedule for executing the test logic code at each block height.
[0092] Furthermore, it also includes:
[0093] A report generation module is used to determine the comparison result between the request execution result and the expected execution result corresponding to the test case information after comparing the request execution result with the expected execution result; and is also used to generate a test report based on the test task, the test case, the request execution result and the comparison result.
[0094] Furthermore, the test result generation module compares the request execution result with the expected execution result corresponding to the test case information, and the process of obtaining the test result of the target smart contract includes: comparing all the request execution results with the expected execution results corresponding to the test case information; determining whether all the request execution results are the same as the expected execution results; if so, outputting the test result that the target smart contract passed the test; if not, outputting the test result that the target smart contract failed the test.
[0095] Since the embodiments of the system part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the system part, which will not be repeated here.
[0096] The present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0097] The present application also provides an electronic device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the electronic device may also include various network interfaces, power supplies and other components.
[0098] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of this application.
[0099] It should also be noted that, in this specification, 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 "comprises", "comprising" 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, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A multi-chain smart contract testing method, characterized in that: include: Receive a test task of a target smart contract defined online by a user; wherein the test task includes a blockchain network identifier, a contract address, a test logic code, and a task type; generating a task schedule according to the task type; Execute the test logic code according to the task arrangement to obtain test case information; Sending a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, and receiving a request execution result returned by each blockchain network; wherein the call request is used to call the contract address; Compare the requested execution result with the expected execution result corresponding to the test case information to obtain the test result of the target smart contract; Generating a task schedule according to the task type includes: If the task type is a periodic task, a first task schedule is generated; wherein the first task schedule is a task schedule for executing the test logic code at time intervals; If the task type is a custom task, a second task schedule is generated; wherein the second task schedule is a task schedule for executing the test logic code at each block height; The test logic code is executed according to the task arrangement to obtain the test case information, including: The test time is determined according to the task arrangement, and the test logic code is executed at the test time to obtain test case information; wherein the test case information includes function call information, parameter information and expected execution result.
2. The multi-chain smart contract testing method according to claim 1, characterized in that: Sending a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information includes: Construct a call request including the function call information and the parameter information, and send the call request to multiple blockchain networks corresponding to the blockchain network identifier.
3. The multi-chain smart contract testing method according to claim 1 is characterized in that: After comparing the request execution result with the expected execution result corresponding to the test case information, the method further includes: Determine a comparison result between the requested execution result and the expected execution result; A test report is generated according to the test task, the test case, the request execution result and the comparison result.
4. The multi-chain smart contract testing method according to claim 1 is characterized in that: Comparing the requested execution result with the expected execution result corresponding to the test case information to obtain the test result of the target smart contract, including: Comparing all the request execution results with the expected execution results corresponding to the test case information; Determining whether all the requested execution results are the same as the expected execution results; If yes, then output the test result that the target smart contract passed the test; If not, the test result indicating that the target smart contract failed the test is output.
5. A multi-chain smart contract testing system, characterized in that: include: A task receiving module, used to receive a test task of a target smart contract defined online by a user; wherein the test task includes a blockchain network identifier, a contract address, a test logic code and a task type; A task scheduling generation module, used to generate a task schedule according to the task type; A test case generation module, used to execute the test logic code according to the task arrangement to obtain test case information; A test module, configured to send a call request to multiple blockchain networks corresponding to the blockchain network identifier according to the test case information, and receive a request execution result returned by each blockchain network; wherein the call request is used to call the contract address; A test result generation module, used to compare the request execution result with the expected execution result corresponding to the test case information to obtain the test result of the target smart contract; The process of generating a task schedule according to the task type by the schedule generation module includes: if the task type is a periodic task, generating a first task schedule; wherein the first task schedule is a task schedule for executing the test logic code at a time interval; if the task type is a custom task, generating a second task schedule; wherein the second task schedule is a task schedule for executing the test logic code at each block height; Among them, the test case generation module executes the test logic code according to the task scheduling to obtain the test case information, which includes: determining the test time according to the task scheduling, and executing the test logic code at the test time to obtain the test case information; wherein the test case information includes function call information, parameter information and expected execution results.
6. An electronic device, characterized in that: It includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of the multi-chain smart contract testing method as described in any one of claims 1 to 4 are implemented.
7. A storage medium, characterized in that: The storage medium stores computer executable instructions, which, when loaded and executed by a processor, implement the steps of the multi-chain smart contract testing method as described in any one of claims 1 to 4.
