Skip to content

Commit

Permalink
Add IsCurrencyWhitelisted to BlockContext
Browse files Browse the repository at this point in the history
  • Loading branch information
palango committed Nov 6, 2023
1 parent 3bef935 commit 91135bf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ type BlockContext struct {
ExchangeRates map[common.Address]*big.Rat
}

func (bc BlockContext) IsCurrencyWhitelisted(feeCurrency *common.Address) bool {
if feeCurrency == nil {
return true
}

// Check if fee currency is registered
_, ok := bc.ExchangeRates[*feeCurrency]
return ok
}

// TxContext provides the EVM with information about a transaction.
// All fields can change between transactions.
type TxContext struct {
Expand Down

0 comments on commit 91135bf

Please sign in to comment.