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

Remove redundancy statement on iost.transfer #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nujabes403
Copy link
Contributor

@nujabes403 nujabes403 commented Jan 16, 2019

let t = this.callABI("token.iost", "transfer", [token, from, to, amount, memo]);

In above statement, this.callABI already do t.addApprove("*", this.config.defaultLimit); internally.

So there is no reason to set defaultGasLimit twice when call transfer.

cf)

  1. callABI function
    callABI(contract, abi, args) {
        const t = new Tx(this.config.gasRatio, this.config.gasLimit);
        t.addAction(contract, abi, JSON.stringify(args));
        t.setTime(this.config.expiration, this.config.delay);
        t.addApprove("*", this.config.defaultLimit); // already approve defaultLimit!
        return t
    }
  1. transfer function
    transfer(token, from, to, amount, memo = "") {
        let t = this.callABI("token.iost", "transfer", [token, from, to, amount, memo]);
        t.addApprove("*", this.config.defaultLimit); // redundant!
        t.addApprove("iost", amount); 
        return t;
    }

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.

1 participant