Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Apr 10, 2024
1 parent c29b1b9 commit 074d819
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func benchmarkERC20Transfer(b *testing.B, db dbm.DB) {
txsPerBlock := 5000
accounts := 100
gasPrice := big.NewInt(100000000000)
bigZero := big.NewInt(0)
var appOpts servertypes.AppOptions = EmptyAppOptions{}
if db == nil {
appOpts = AppOptionsMap(map[string]interface{}{
Expand Down Expand Up @@ -151,6 +152,7 @@ func benchmarkERC20Transfer(b *testing.B, db dbm.DB) {
contractAddr, err := app.CronosKeeper.DeployModuleCRC21(ctx, "test")
require.NoError(b, err)

// mint to senders
amount := int64(100000000)
{
for _, acc := range testAccounts {
Expand Down Expand Up @@ -183,9 +185,9 @@ func benchmarkERC20Transfer(b *testing.B, db dbm.DB) {
&contractAddr, // to
big.NewInt(0), // value
210000, // gas limit
gasPrice, // gas price
nil, // gasFeeCap
nil, // gasTipCap
nil, // gas price
gasPrice, // gasFeeCap
bigZero, // gasTipCap
data, // data
nil, // access list
)
Expand Down Expand Up @@ -213,7 +215,7 @@ func benchmarkERC20Transfer(b *testing.B, db dbm.DB) {
require.Equal(b, 0, int(res.Code), res.Log)
}

// check remaining balance
// check remaining balance, only check one account to avoid slow down benchmark itself
ctx := app.GetContextForDeliverTx(nil)
ret, err := app.CronosKeeper.CallModuleCRC21(ctx, contractAddr, "balanceOf", testAccounts[0].Address)
require.NoError(b, err)
Expand Down

0 comments on commit 074d819

Please sign in to comment.