Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Jun 26, 2024
1 parent 1cbd0c9 commit 83d2f8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions types/mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ func NewMempoolTx(tx sdk.Tx, gasWanted uint64) MempoolTx {
}
}

type GasTx interface {
GetGas() uint64
}

type Mempool interface {
// Insert attempts to insert a Tx into the app-side mempool returning
// an error upon failure.
Expand Down
4 changes: 1 addition & 3 deletions types/mempool/priority_nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ func (mp *PriorityNonceMempool[C]) InsertWithGasWanted(ctx context.Context, tx s

func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error {
var gasLimit uint64
if gasTx, ok := tx.(interface {
GetGas() uint64
}); ok {
if gasTx, ok := tx.(GasTx); ok {
gasLimit = gasTx.GetGas()
}

Expand Down
4 changes: 1 addition & 3 deletions types/mempool/sender_nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ func (snm *SenderNonceMempool) InsertWithGasWanted(_ context.Context, tx sdk.Tx,

func (mp *SenderNonceMempool) Insert(ctx context.Context, tx sdk.Tx) error {

Check failure on line 158 in types/mempool/sender_nonce.go

View workflow job for this annotation

GitHub Actions / Analyze

receiver-naming: receiver name mp should be consistent with previous receiver name snm for SenderNonceMempool (revive)

Check failure on line 158 in types/mempool/sender_nonce.go

View workflow job for this annotation

GitHub Actions / Analyze

receiver-naming: receiver name mp should be consistent with previous receiver name snm for SenderNonceMempool (revive)

Check failure on line 158 in types/mempool/sender_nonce.go

View workflow job for this annotation

GitHub Actions / Analyze

receiver-naming: receiver name mp should be consistent with previous receiver name snm for SenderNonceMempool (revive)

Check failure on line 158 in types/mempool/sender_nonce.go

View workflow job for this annotation

GitHub Actions / Analyze

receiver-naming: receiver name mp should be consistent with previous receiver name snm for SenderNonceMempool (revive)

Check failure on line 158 in types/mempool/sender_nonce.go

View workflow job for this annotation

GitHub Actions / Analyze

receiver-naming: receiver name mp should be consistent with previous receiver name snm for SenderNonceMempool (revive)
var gasLimit uint64
if gasTx, ok := tx.(interface {
GetGas() uint64
}); ok {
if gasTx, ok := tx.(GasTx); ok {
gasLimit = gasTx.GetGas()
}

Expand Down

0 comments on commit 83d2f8e

Please sign in to comment.