diff --git a/cmd/puppeth/wizard_genesis.go b/cmd/puppeth/wizard_genesis.go index bd7e3309a0..d81ee4ae15 100644 --- a/cmd/puppeth/wizard_genesis.go +++ b/cmd/puppeth/wizard_genesis.go @@ -222,7 +222,7 @@ func (w *wizard) makeGenesis() { } // Randomize Smart Contract Code - randomizeAddress, _, err := randomizeContract.DeployRandomize(transactOpts, contractBackend, big.NewInt(90)) + randomizeAddress, _, err := randomizeContract.DeployRandomize(transactOpts, contractBackend) if err != nil { fmt.Println("Can't deploy root registry") } diff --git a/contracts/randomize/randomize.go b/contracts/randomize/randomize.go index c30421d23a..e3f28604c9 100644 --- a/contracts/randomize/randomize.go +++ b/contracts/randomize/randomize.go @@ -1,10 +1,24 @@ +// Copyright (c) 2018 Xinfin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . + package randomize import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/contracts/randomize/contract" - "math/big" ) type Randomize struct { @@ -27,8 +41,8 @@ func NewRandomize(transactOpts *bind.TransactOpts, contractAddr common.Address, }, nil } -func DeployRandomize(transactOpts *bind.TransactOpts, contractBackend bind.ContractBackend, randomNumber *big.Int) (common.Address, *Randomize, error) { - randomizeAddr, _, _, err := contract.DeployXDCRandomize(transactOpts, contractBackend, randomNumber) +func DeployRandomize(transactOpts *bind.TransactOpts, contractBackend bind.ContractBackend) (common.Address, *Randomize, error) { + randomizeAddr, _, _, err := contract.DeployXDCRandomize(transactOpts, contractBackend) if err != nil { return randomizeAddr, nil, err } diff --git a/contracts/randomize/randomize_test.go b/contracts/randomize/randomize_test.go index 172fbf8b04..9bc8ede5ae 100644 --- a/contracts/randomize/randomize_test.go +++ b/contracts/randomize/randomize_test.go @@ -29,7 +29,7 @@ func TestRandomize(t *testing.T) { transactOpts := bind.NewKeyedTransactor(key) transactOpts.GasLimit = 1000000 - randomizeAddress, randomize, err := DeployRandomize(transactOpts, contractBackend, big.NewInt(2)) + randomizeAddress, randomize, err := DeployRandomize(transactOpts, contractBackend) t.Log("contract address", randomizeAddress.String()) if err != nil { t.Fatalf("can't deploy root registry: %v", err) @@ -64,7 +64,7 @@ func TestSendTxRandomizeSecretAndOpening(t *testing.T) { transactOpts := bind.NewKeyedTransactor(acc1Key) transactOpts.GasLimit = 4200000 epocNumber := uint64(900) - randomizeAddr, randomizeContract, err := DeployRandomize(transactOpts, backend, new(big.Int).SetInt64(0)) + randomizeAddr, randomizeContract, err := DeployRandomize(transactOpts, backend) if err != nil { t.Fatalf("Can't deploy randomize SC: %v", err) }