Skip to content

Commit

Permalink
[Breaking changes] 528 use read sc to set gas when gas is not set in …
Browse files Browse the repository at this point in the history
…call sc (#529)

Breaking changes: functionName -> targetFunction

* Rename ICallData functionName to targetFunction as in IReadData.

* Set default maxGas using read sc in call sc

* Not use readSC when maxGas is 0

* Make maxGas optional in ICallData and add coins and fees when calling readSC from callSC

* Add a test for default maxGas in callSC

* Remove maxGas parameter of callSC in examples

* Fix Test smart contract

* Fix maxGas value for readSC from callSC

* Fix expected maxGas in callSC no maxGas test

* Make default readSC maxGas a constant

* Improve readbility in readSC call in callSC

* Move undefined maxgas handling from callSC to readSC

* Add error handling gas estimation

---------

Co-authored-by: BenRey <br@massa.net>
  • Loading branch information
thomas-senechal and Ben-Rey authored Feb 13, 2024
1 parent 595e8b2 commit 68c94b8
Show file tree
Hide file tree
Showing 11 changed files with 286 additions and 221 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ module.exports = {
camelcase: "off",
"@typescript-eslint/no-unused-vars": "error",
'no-console': 'warn',
"comma-dangle": "off"
},
};
24 changes: 12 additions & 12 deletions packages/massa-web3/code-snippets/walletGenerateNewAccount.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { WalletClient } from '@massalabs/massa-web3'

const newAccount = await WalletClient.walletGenerateNewAccount()

// print the account address, public and private keys
console.log(
'Address: ',
newAccount.address,
'Public key',
newAccount.publicKey,
'Private key',
newAccount.secretKey
)
;(async () => {
const newAccount = await WalletClient.walletGenerateNewAccount()
// print the account address, public and private keys
console.log(

Check warning on line 5 in packages/massa-web3/code-snippets/walletGenerateNewAccount.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement

Check warning on line 5 in packages/massa-web3/code-snippets/walletGenerateNewAccount.ts

View workflow job for this annotation

GitHub Actions / test / build

Unexpected console statement
'Address: ',
newAccount.address,
'Public key',
newAccount.publicKey,
'Private key',
newAccount.secretKey
)
})()
Loading

0 comments on commit 68c94b8

Please sign in to comment.