Selaa lähdekoodia

core: add BlockGen.GetBalance method (#22589)

rene 4 vuotta sitten
vanhempi
commit
b6912c1047
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      core/chain_makers.go

+ 5 - 0
core/chain_makers.go

@@ -111,6 +111,11 @@ func (b *BlockGen) AddTxWithChain(bc *BlockChain, tx *types.Transaction) {
 	b.receipts = append(b.receipts, receipt)
 }
 
+// GetBalance returns the balance of the given address at the generated block.
+func (b *BlockGen) GetBalance(addr common.Address) *big.Int {
+	return b.statedb.GetBalance(addr)
+}
+
 // AddUncheckedTx forcefully adds a transaction to the block without any
 // validation.
 //