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

@ -175,8 +175,11 @@ func TestCheckpointRegister(t *testing.T) {
sort.Sort(accounts)
// Deploy registrar contract
transactOpts := bind.NewKeyedTransactor(accounts[0].key)
contractBackend := backends.NewSimulatedBackend(core.GenesisAlloc{accounts[0].addr: {Balance: big.NewInt(1000000000)}, accounts[1].addr: {Balance: big.NewInt(1000000000)}, accounts[2].addr: {Balance: big.NewInt(1000000000)}}, 10000000)
defer contractBackend.Close()
transactOpts := bind.NewKeyedTransactor(accounts[0].key)
// 3 trusted signers, threshold 2
contractAddr, _, c, err := contract.DeployCheckpointOracle(transactOpts, contractBackend, []common.Address{accounts[0].addr, accounts[1].addr, accounts[2].addr}, sectionSize, processConfirms, big.NewInt(2))
if err != nil {