Skip to content

Commit b6912c1

Browse files
authored
core: add BlockGen.GetBalance method (#22589)
1 parent 76700ac commit b6912c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/chain_makers.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ func (b *BlockGen) AddTxWithChain(bc *BlockChain, tx *types.Transaction) {
111111
b.receipts = append(b.receipts, receipt)
112112
}
113113

114+
// GetBalance returns the balance of the given address at the generated block.
115+
func (b *BlockGen) GetBalance(addr common.Address) *big.Int {
116+
return b.statedb.GetBalance(addr)
117+
}
118+
114119
// AddUncheckedTx forcefully adds a transaction to the block without any
115120
// validation.
116121
//

0 commit comments

Comments
 (0)