Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreExec tx return gasUsed and process slice parameters when invoke evm contract #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vantinfy
Copy link

@vantinfy vantinfy commented Aug 4, 2022

Description

xuper/xuperclient.go: add field GasUsed when return the Transaction so that users can know how many gas they cost while pre-execute or post a transaction to the chain.

xuper/request.go: process slice parameters(they can be string slice, float64 slice or empty slice) when invoke evm contract.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Brief of your solution

Return gasUsed when post tx.
Process slice parameters when invoke evm contract.

How Has This Been Tested?

There is a evm function declare like this:

function createUsers(
        address[] calldata users, // create multiple users
        uint256[] calldata ids, // each user's id
    ) external {}

The previous code will parse request parameter users "[\"2462380BA1B39BB42AD9AECCAC7E91CB9D40AC27\",\"1A9BDAB96390EF0E4820519A95FCB96856202BB0\"]" and ids "[\"1\",\"2\"]" to string not the slice then lead to failure, the latest code will parse it correctly.

@CLAassistant
Copy link

CLAassistant commented Aug 4, 2022

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants