Use gasRequired for contract estimation (#5772)

* Use gasRequired for contract estimation

* Bump API

* yarn.lock

* Revert unneeded bumps

* Fix lint

* Bump API
This commit is contained in:
Jaco 2021-07-06 12:29:15 +03:00 committed by GitHub
parent f8b224d41b
commit 39b5a04548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 450 additions and 285 deletions

View File

@ -12,17 +12,17 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^4.16.3-4",
"@polkadot/api-contract": "^4.16.3-4",
"@polkadot/hw-ledger": "^6.10.2-3",
"@polkadot/keyring": "^6.10.2-3",
"@polkadot/networks": "^6.10.2-3",
"@polkadot/phishing": "^0.6.216",
"@polkadot/types": "^4.16.3-4",
"@polkadot/util": "^6.10.2-3",
"@polkadot/util-crypto": "^6.10.2-3",
"@polkadot/api": "^4.17.2-3",
"@polkadot/api-contract": "^4.17.2-3",
"@polkadot/hw-ledger": "^6.11.1",
"@polkadot/keyring": "^6.11.1",
"@polkadot/networks": "^6.11.1",
"@polkadot/phishing": "^0.6.219",
"@polkadot/types": "^4.17.2-3",
"@polkadot/util": "^6.11.1",
"@polkadot/util-crypto": "^6.11.1",
"@polkadot/wasm-crypto": "^4.0.2",
"@polkadot/x-rxjs": "^6.10.2-3",
"@polkadot/x-rxjs": "^6.11.1",
"@substrate/connect": "0.3.10",
"babel-core": "^7.0.0-bridge.0",
"styled-components": "^5.2.0",
@ -74,8 +74,8 @@
"@babel/runtime": "^7.14.6",
"@crustio/crust-pin": "^0.0.1",
"@pinata/sdk": "^1.1.23",
"@polkadot/dev": "^0.62.44",
"@polkadot/ts": "^0.4.2",
"@polkadot/dev": "^0.62.50",
"@polkadot/ts": "^0.4.3",
"@types/bn.js": "^4.11.6",
"@types/chart.js": "^2.9.32",
"@types/file-saver": "^2.0.2",

View File

@ -19,7 +19,7 @@
"@kiltprotocol/type-definitions": "^0.1.8",
"@laminar/type-definitions": "^0.3.1",
"@phala/typedefs": "^0.2.1",
"@polkadot/networks": "^6.10.2-3",
"@polkadot/networks": "^6.11.1",
"@polymathnetwork/polymesh-types": "^0.0.2",
"@snowfork/snowbridge-types": "^0.2.3",
"@sora-substrate/type-definitions": "^1.3.32",

View File

@ -6,7 +6,7 @@
"dependencies": {
"@babel/core": "^7.14.6",
"@babel/polyfill": "^7.12.1",
"@polkadot/dev": "^0.62.44",
"@polkadot/dev": "^0.62.50",
"@polkadot/react-components": "^0.94.2-37",
"electron-log": "^4.3.5",
"electron-updater": "^4.3.10"

View File

@ -11,7 +11,7 @@
"@babel/runtime": "^7.14.6",
"@polkadot/apps-config": "^0.94.2-37",
"@polkadot/apps-routing": "^0.94.2-37",
"@polkadot/dev": "^0.62.44",
"@polkadot/dev": "^0.62.50",
"@polkadot/react-api": "^0.94.2-37",
"@polkadot/react-components": "^0.94.2-37",
"@polkadot/react-hooks": "^0.94.2-37",

View File

@ -6,9 +6,9 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.14.6",
"@polkadot/phishing": "^0.6.216",
"@polkadot/phishing": "^0.6.219",
"@polkadot/react-components": "^0.94.2-37",
"@polkadot/vanitygen": "^0.40.2-0",
"@polkadot/vanitygen": "^0.41.1",
"detect-browser": "^5.2.0",
"file-saver": "^2.0.5"
},

View File

@ -6,6 +6,6 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.14.6",
"@polkadot/api-contract": "^4.16.3-4"
"@polkadot/api-contract": "^4.17.2-3"
}
}

View File

@ -76,9 +76,9 @@ function Call ({ className = '', contract, messageIndex, onCallResult, onChangeM
? dbValue
: 0
}, ...dbParams)
.then(({ gasConsumed, result }) => setEstimatedWeight(
.then(({ gasRequired, result }) => setEstimatedWeight(
result.isOk
? gasConsumed
? gasRequired
: null
))
.catch(() => setEstimatedWeight(null));
@ -122,7 +122,7 @@ function Call ({ className = '', contract, messageIndex, onCallResult, onChangeM
);
const isValid = !!(accountId && weight.isValid && isValueValid);
const isViaRpc = contract.hasRpcContractsCall && (isViaCall || !message.isMutating);
const isViaRpc = contract.hasRpcContractsCall && (isViaCall || (!message.isMutating && !message.isPayable));
return (
<Modal

View File

@ -6,9 +6,9 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.14.6",
"@polkadot/api": "^4.16.3-4",
"@polkadot/extension-dapp": "^0.38.8-1",
"@polkadot/x-rxjs": "^6.10.2-3",
"@polkadot/api": "^4.17.2-3",
"@polkadot/extension-dapp": "^0.38.8",
"@polkadot/x-rxjs": "^6.11.1",
"@substrate/connect": "^0.3.10",
"fflate": "^0.7.1"
}

View File

@ -9,15 +9,15 @@
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
"@polkadot/keyring": "^6.10.2-3",
"@polkadot/keyring": "^6.11.1",
"@polkadot/react-api": "^0.94.2-37",
"@polkadot/react-identicon": "^0.82.2-0",
"@polkadot/react-qr": "^0.82.2-0",
"@polkadot/react-identicon": "^0.83.1",
"@polkadot/react-qr": "^0.83.1",
"@polkadot/react-query": "^0.94.2-37",
"@polkadot/ui-keyring": "^0.82.2-0",
"@polkadot/ui-settings": "^0.82.2-0",
"@polkadot/util": "^6.10.2-3",
"@polkadot/util-crypto": "^6.10.2-3",
"@polkadot/ui-keyring": "^0.83.1",
"@polkadot/ui-settings": "^0.83.1",
"@polkadot/util": "^6.11.1",
"@polkadot/util-crypto": "^6.11.1",
"chart.js": "^2.9.4",
"codeflask": "^1.4.1",
"i18next": "^19.9.2",

673
yarn.lock

File diff suppressed because it is too large Load Diff