Skip to content

Commit

Permalink
some refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bharath-123 committed May 17, 2024
1 parent 274d4e5 commit 57f1bf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions scenarios/gasburnertx/gasburnertx.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
gasburnertx "github.com/ethpandaops/spamoor/scenarios/gasburnertx/contracts"
"github.com/ethpandaops/spamoor/utils"
"math/big"
"sync"
Expand Down Expand Up @@ -177,7 +176,7 @@ func (s *Scenario) DeployGasBurnerContract() (*types.Receipt, *txbuilder.Client,
return nil, nil, err
}

_, deployTx, _, err := gasburnertx.DeployGasBurner(transactor, client.GetEthClient())
_, deployTx, _, err := DeployGasBurner(transactor, client.GetEthClient())
if err != nil {
return nil, nil, err
}
Expand Down Expand Up @@ -356,12 +355,7 @@ func (s *Scenario) awaitTx(txIdx uint64, tx *types.Transaction, client *txbuilde
gweiBaseFee := new(big.Int).Div(effectiveGasPrice, big.NewInt(1000000000))
gweiBlobFee := new(big.Int).Div(blobGasPrice, big.NewInt(1000000000))

txStatus := "failure"
if receipt.Status == 1 {
txStatus = "success"
}

s.logger.WithField("client", client.GetName()).Infof(" transaction %d confirmed in block #%v with %s. total gas units: %d, total fee: %v gwei (base: %v, blob: %v)", txIdx+1, blockNum, txStatus, receipt.GasUsed, gweiTotalFee, gweiBaseFee, gweiBlobFee)
s.logger.WithField("client", client.GetName()).Infof(" transaction %d confirmed in block #%v. total gas units: %d, total fee: %v gwei (base: %v, blob: %v)", txIdx+1, blockNum, receipt.GasUsed, gweiTotalFee, gweiBaseFee, gweiBlobFee)
}

func (s *Scenario) delayedResend(txIdx uint64, tx *types.Transaction, awaitConfirmation *bool) {
Expand Down Expand Up @@ -390,7 +384,7 @@ func (s *Scenario) GetTransactor(wallet *txbuilder.Wallet, noSend bool, value *b
return transactor, nil
}

func (s *Scenario) GetGasBurner() (*gasburnertx.GasBurner, error) {
func (s *Scenario) GetGasBurner() (*GasBurner, error) {
client := s.tester.GetClient(tester.SelectByIndex, 0)
return gasburnertx.NewGasBurner(s.gasBurnerContractAddr, client.GetEthClient())
return NewGasBurner(s.gasBurnerContractAddr, client.GetEthClient())
}

0 comments on commit 57f1bf3

Please sign in to comment.