Skip to content

Commit 669411a

Browse files
authored
Merge branch 'master' into add-test-on-ci
2 parents c5c4db4 + 04d72f4 commit 669411a

3 files changed

Lines changed: 47 additions & 590 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"testAll": "tests/runAll.sh"
1717
},
1818
"devDependencies": {
19+
"chai": "^4.3.4",
1920
"eslint": "^8.15.0",
2021
"eslint-config-prettier": "^8.3.0",
2122
"eslint-plugin-mocha": "^9.0.0",

packages/gas-estimation/scripts/exec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ const gasEstimator = async () => {
5555
// NodeInterface.GasEstimateComponents() and get the fourth element and multiply by 16 => result[3]*16
5656
// L1S (Size in bytes of the calldata to post on the parent chain) =>
5757
// Will depend on the size (in bytes) of the calldata of the transaction
58-
// We add a fixed amount of 140 bytes to that amount for the transaction metadata (recipient, nonce, gas price, ...)
59-
// Final size will be less after compression, but this calculation gives a good estimation
6058

6159
// ****************************
6260
// * Other values you can get *
@@ -97,7 +95,6 @@ const gasEstimator = async () => {
9795
// -------------------------------------------------------------------------------
9896
// NOTE: This one might be a bit confusing, but parentChainGasEstimated (B in the formula) is calculated based on child-chain's gas fees
9997
const parentChainCost = parentChainGasEstimated.mul(childChainEstimatedPrice);
100-
// NOTE: This is similar to 140 + utils.hexDataLength(txData);
10198
const parentChainSize = parentChainCost.div(parentChainEstimatedPrice);
10299

103100
// Getting the result of the formula

0 commit comments

Comments
 (0)