I am trying to deploy ethereum smart contracts in go sdk but i am getting some error as
./inbox_test.go:20:44: not enough arguments in call to backends.NewSimulatedBackend
have (core.GenesisAlloc)
want (core.GenesisAlloc, uint64)
I am following step by step guide to deploy smart contract in go and i am not able to do this
func TestDeployInbox(t *testing.T) {
//Setup simulated block chain
key, _ := crypto.GenerateKey()
auth := bind.NewKeyedTransactor(key)
alloc := make(core.GenesisAlloc)
alloc[auth.From] = core.GenesisAccount{Balance: big.NewInt(1000000000)}
blockchain := backends.NewSimulatedBackend(alloc)
//Deploy contract
address, _, _, err := DeployInbox(
auth,
blockchain,
"Hello World",
)
// commit all pending transactions
blockchain.Commit()
if err != nil {
t.Fatalf("Failed to deploy the Inbox contract: %v", err)
}
if len(address.Bytes()) == 0 {
t.Error("Expected a valid deployment address. Received empty address byte array instead")
}
}
This code should deploy smart contract in go sdk