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

feat!: start paying a symbolic amount for transactions #182

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

AlicanC
Copy link
Contributor

@AlicanC AlicanC commented Mar 11, 2022

Resolves #159

  • We had a bunch of APIs that required signerOrProvider but only accepted Provider. All of these were renamed to walletOrProvider and updated to accept Wallet | Provider. The reasoning is: these APIs require paying fees. While signing is enough on Ethereum, we need the full wallet functionality so we can pick the right coins too.

  • Contract deployment and calling now require a Wallet that has enough balance. (1 per transaction ATM) In tests, seeding wallets are required:

    /*** Before ***/
    
    const provider = new Provider('http://127.0.0.1:4000/graphql');
    
    // Deploy contract
    const factory = new ContractFactory(bytecode, abi, provider);
    const contract = await factory.deployContract();
    
    /*** After ***/
    
    const provider = new Provider('http://127.0.0.1:4000/graphql');
    
    // Create and seed wallet
    const wallet = Wallet.generate({ provider });
    await seedWallet(wallet, [{ assetId: NativeAssetId, amount: 1 }]);
    
    // Deploy contract
    const factory = new ContractFactory(bytecode, abi, wallet);
    const contract = await factory.deployContract();

@AlicanC AlicanC added the feat Issue is a feature label Mar 11, 2022
@AlicanC AlicanC requested review from QuinnLee and luizstacio March 11, 2022 17:50
@AlicanC AlicanC self-assigned this Mar 11, 2022
@AlicanC AlicanC force-pushed the jc/pay-for-transactions branch from 2969169 to 044c30e Compare March 11, 2022 18:38
@AlicanC AlicanC requested a review from luizstacio March 11, 2022 18:42
@AlicanC AlicanC merged commit d652af5 into master Mar 11, 2022
@AlicanC AlicanC deleted the jc/pay-for-transactions branch March 11, 2022 19:19
@AlicanC AlicanC mentioned this pull request Mar 13, 2022
petertonysmith94 pushed a commit that referenced this pull request Nov 25, 2024

Verified

This commit was signed with the committer’s verified signature.
targos Michaël Zasso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Remove random input on Fuels TS
2 participants