Skip to content

Commit

Permalink
estimated v2
Browse files Browse the repository at this point in the history
  • Loading branch information
niklabh committed Dec 21, 2022
1 parent 371300f commit b1fbecc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/apps/public/locales/en/app-contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
"deployment constructor": "deployment constructor",
"exec": "exec",
"json for either ABI or .contract bundle": "json for either ABI or .contract bundle",
"max ProofSize allowed": "max ProofSize allowed",
"max ProofSize allowed ({{estimatedProofSize}} estimated)": "max ProofSize allowed ({{estimatedProofSize}} estimated)",
"max RefTime allowed (M)": "max RefTime allowed (M)",
"max RefTime allowed (M, {{estimatedRefTime}} estimated)": "max RefTime allowed (M, {{estimatedRefTime}} estimated)",
"max gas allowed (M)": "max gas allowed (M)",
"max gas allowed (M, {{estimatedMg}} estimated)": "max gas allowed (M, {{estimatedMg}} estimated)",
"max read gas": "max read gas",
Expand Down
7 changes: 7 additions & 0 deletions packages/page-contracts/src/Contracts/Call.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ function Call ({ className = '', contract, messageIndex, onCallResult, onChangeM
)}
<InputMegaGas
estimatedWeight={message.isMutating ? estimatedWeight : MAX_CALL_WEIGHT}
estimatedWeightV2={message.isMutating
? estimatedWeightV2
: api.registry.createType('WeightV2', {
proofSize: new BN(1_000_000),
refTIme: MAX_CALL_WEIGHT
})
}
help={t<string>('The maximum amount of gas to use for this contract call. If the call requires more, it will fail.')}
isCall={!message.isMutating}
weight={weight}
Expand Down

0 comments on commit b1fbecc

Please sign in to comment.