-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lower the gas price multiplier for evm chains
- Loading branch information
1 parent
828529c
commit 7e25cd0
Showing
7 changed files
with
95 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package common_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"github.com/zeta-chain/zetacore/common" | ||
) | ||
|
||
func Test_GasPriceMultiplier(t *testing.T) { | ||
tt := []struct { | ||
name string | ||
chainID int64 | ||
multiplier float64 | ||
}{ | ||
{ | ||
name: "get Ethereum multiplier", | ||
chainID: 1, | ||
multiplier: 1.2, | ||
}, | ||
{ | ||
name: "get Goerli multiplier", | ||
chainID: 5, | ||
multiplier: 1.2, | ||
}, | ||
{ | ||
name: "get BSC multiplier", | ||
chainID: 56, | ||
multiplier: 1.2, | ||
}, | ||
{ | ||
name: "get BSC Testnet multiplier", | ||
chainID: 97, | ||
multiplier: 1.2, | ||
}, | ||
{ | ||
name: "get Polygon multiplier", | ||
chainID: 137, | ||
multiplier: 1.2, | ||
}, | ||
{ | ||
name: "get Mumbai Testnet multiplier", | ||
chainID: 80001, | ||
multiplier: 1.2, | ||
}, | ||
{ | ||
name: "get Bitcoin multiplier", | ||
chainID: 8332, | ||
multiplier: 2.0, | ||
}, | ||
{ | ||
name: "get Bitcoin Testnet multiplier", | ||
chainID: 18332, | ||
multiplier: 2.0, | ||
}, | ||
{ | ||
name: "get unknown chain gas price multiplier", | ||
chainID: 1234, | ||
multiplier: 1.0, | ||
}, | ||
} | ||
for _, tc := range tt { | ||
t.Run(tc.name, func(t *testing.T) { | ||
multiplier := common.GasPriceMultiplier(tc.chainID) | ||
require.Equal(t, tc.multiplier, multiplier) | ||
}) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters