accounts/abi/bind: support closing a simulated backend

This commit is contained in:
Péter Szilágyi
2019-07-31 11:35:57 +03:00
parent 96ab8e1575
commit 140a7e9177
6 changed files with 48 additions and 8 deletions

View File

@ -88,6 +88,12 @@ func NewSimulatedBackend(alloc core.GenesisAlloc, gasLimit uint64) *SimulatedBac
return NewSimulatedBackendWithDatabase(rawdb.NewMemoryDatabase(), alloc, gasLimit)
}
// Close terminates the underlying blockchain's update loop.
func (b *SimulatedBackend) Close() error {
b.blockchain.Stop()
return nil
}
// Commit imports all the pending transactions as a single block and starts a
// fresh new state.
func (b *SimulatedBackend) Commit() {