609 lines
45 KiB
Go
609 lines
45 KiB
Go
|
// Code generated - DO NOT EDIT.
|
||
|
// This file is a generated binding and any manual changes will be lost.
|
||
|
|
||
|
package registry
|
||
|
|
||
|
import (
|
||
|
"math/big"
|
||
|
"strings"
|
||
|
|
||
|
ethereum "github.com/ethereum/go-ethereum"
|
||
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
||
|
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||
|
"github.com/ethereum/go-ethereum/common"
|
||
|
"github.com/ethereum/go-ethereum/core/types"
|
||
|
"github.com/ethereum/go-ethereum/event"
|
||
|
)
|
||
|
|
||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||
|
var (
|
||
|
_ = big.NewInt
|
||
|
_ = strings.NewReader
|
||
|
_ = ethereum.NotFound
|
||
|
_ = abi.U256
|
||
|
_ = bind.Bind
|
||
|
_ = common.Big1
|
||
|
_ = types.BloomLookup
|
||
|
_ = event.NewSubscription
|
||
|
)
|
||
|
|
||
|
// NodesV2ABI is the input ABI used to generate the binding from.
|
||
|
const NodesV2ABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentSession\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"publicKey\",\"type\":\"bytes\"}],\"name\":\"publicKeyToAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getNode\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"},{\"name\":\"\",\"type\":\"uint32\"},{\"name\":\"\",\"type\":\"uint16\"},{\"name\":\"\",\"type\":\"uint32\"},{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"publicKey\",\"type\":\"bytes\"}],\"name\":\"registered\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"publicKey\",\"type\":\"bytes\"},{\"name\":\"ip\",\"type\":\"uint32\"},{\"name\":\"port\",\"type\":\"uint16\"}],\"name\":\"registerNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"inactiveNodeCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"inactiveNodes\",\"outputs\":[{\"name\":\"publicKey\",\"type\":\"bytes\"},{\"name\":\"ip\",\"type\":\"uint32\"},{\"name\":\"port\",\"type\":\"uint16\"},{\"name\":\"joinVotes\",\"type\":\"uint8\"},{\"name\":\"removeVotes\",\"type\":\"uint8\"},{\"name\":\"lastTimeHasVoted\",\"type\":\"uint256\"},{\"name\":\"lastTimeHasBeenVoted\",\"type\":\"uint256\"},{\"name\":\"joiningSession\",\"type\":\"uint32\"},{\"name\":\"activeSession\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"activeNodeCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getInactiveNode\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"},{\"name\":\"\",\"type\":\"uint32\"},{\"name\":\"\",\"type\":\"uint16\"},{\"name\":\"\",\"type\":\"uint32\"},{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"activeNodes\",\"outputs\":[{\"name\":\"publicKey\",\"type\":\"bytes\"},{\"name\":\"ip\",\"type\":\"uint32\"},{\"name\":\"port\",\"type\":\"uint16\"},{\"name\":\"joinVotes\",\"type\":\"uint8\"},{\"name\":\"removeVotes\",\"type\":\"uint8\"},{\"name\":\"lastTimeHasVoted\",\"type\":\"uint256\"},{\"name\":\"lastTimeHasBeenVoted\",\"type\":\"uint256\"},{\"name\":\"joiningSession\",\"type\":\"uint32\"},{\"name\":\"activeSession\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"joinNodes\",\"type\":\"address[]\"},{\"name\":\"removeNodes\",\"type\":\"address[]\"}],\"name\":\"vote\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentSession\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"publicKey\",\"type\":\"bytes\"},{\"name\":\"ip\",\"type\":\"uint32\"},{\"name\":\"port\",\"type\":\"uint16\"}],\"name\":\"addActiveNode\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_blockPerSession\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"payable\":true,\"stateMutability\":\
|
||
|
|
||
|
// NodesV2Bin is the compiled bytecode used for deploying new contracts.
|
||
|
const NodesV2Bin = `0x60806040526003805463ffff00001916631770000017905534801561002357600080fd5b50604051602080611f278339810180604052602081101561004357600080fd5b5051600080546001600160a01b031916331790556005805463ffffffff19169055436004556003805461ffff9092166401000000000265ffff0000000019909216919091179055611e8e806100996000396000f3fe6080604052600436106100c25760003560e01c806372460fa81161007f57806396f9d9831161005957806396f9d98314610562578063a19e39e81461058c578063d4166763146106bc578063dad7bcee146106ea576100c2565b806372460fa81461042d578063753408151461052357806393696e1a14610538576100c2565b80631401795f146100cf57806343ae656c146100f65780634f0f4aa9146101c35780635aca952e1461029357806363cd6e18146103585780636d1c76c214610418575b36156100cd57600080fd5b005b3480156100db57600080fd5b506100e46107aa565b60408051918252519081900360200190f35b34801561010257600080fd5b506101a76004803603602081101561011957600080fd5b810190602081018135600160201b81111561013357600080fd5b82018360208201111561014557600080fd5b803590602001918460018302840111600160201b8311171561016657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506107dc945050505050565b604080516001600160a01b039092168252519081900360200190f35b3480156101cf57600080fd5b506101ed600480360360208110156101e657600080fd5b50356107ee565b6040805163ffffffff80871660208084019190915261ffff87169383019390935284811660608301528316608082015260a080825287519082015286519091829160c083019189019080838360005b8381101561025457818101518382015260200161023c565b50505050905090810190601f1680156102815780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561029f57600080fd5b50610344600480360360208110156102b657600080fd5b810190602081018135600160201b8111156102d057600080fd5b8201836020820111156102e257600080fd5b803590602001918460018302840111600160201b8311171561030357600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061095e945050505050565b604080519115158252519081900360200190f35b34801561036457600080fd5b506100cd6004803603606081101561037b57600080fd5b810190602081018135600160201b81111561039557600080fd5b8201836020820111156103a757600080fd5b803590602001918460018302840111600160201b831117156103c857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050813563ffffffff169250506020013561ffff166109b1565b34801561042457600080fd5b506100e4610bbc565b34801561043957600080fd5b506104576004803603602081101561045057600080fd5b5035610bc2565b6040805163ffffffff808b1660208084019190915261ffff8b169383019390935260ff808a1660608401528816608083015260a0820187905260c0820186905284811660e083015283166101008201526101208082528b51908201528a51909182916101408301918d019080838360005b838110156104e05781810151838201526020016104c8565b50505050905090810190601f16801561050d5780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34801561052f57600080fd5b506100e4610cbe565b34801561054457600080fd5b506101ed6004803603602081101561055b57600080fd5b5035610cc4565b34801561056e57600080fd5b506104576004803603602081101561058557600080fd5b5035610ce1565b34801561059857600080fd5b506100cd600480360360408110156105af57600080fd5b810190602081018135600160201b8111156105c957600080fd5b8201836020820111156105db57600080fd5b803590602001918460208302840111600160201b831117156105fc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561064b57600080fd5b82018360208201111561065d57600080fd5b803590602001918460208302840111600160201b8311171561067e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610cee945050505050565b3480156106c857600080fd5b506106d1611249565b6040805163ffffffff9092168252519081900360200190f35b3480156106f657600080fd5b506100cd6004803603606081101561070d57600080fd5b810190602081018135600160201b81111561072757600080fd5b82018360208201111561073957600080fd5b803590602001918460018302840111600160201b8311171561075a57600080fd5b9
|
||
|
|
||
|
// DeployNodesV2 deploys a new Ethereum contract, binding an instance of NodesV2 to it.
|
||
|
func DeployNodesV2(auth *bind.TransactOpts, backend bind.ContractBackend, _blockPerSession uint16) (common.Address, *types.Transaction, *NodesV2, error) {
|
||
|
parsed, err := abi.JSON(strings.NewReader(NodesV2ABI))
|
||
|
if err != nil {
|
||
|
return common.Address{}, nil, nil, err
|
||
|
}
|
||
|
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(NodesV2Bin), backend, _blockPerSession)
|
||
|
if err != nil {
|
||
|
return common.Address{}, nil, nil, err
|
||
|
}
|
||
|
return address, tx, &NodesV2{NodesV2Caller: NodesV2Caller{contract: contract}, NodesV2Transactor: NodesV2Transactor{contract: contract}, NodesV2Filterer: NodesV2Filterer{contract: contract}}, nil
|
||
|
}
|
||
|
|
||
|
// NodesV2 is an auto generated Go binding around an Ethereum contract.
|
||
|
type NodesV2 struct {
|
||
|
NodesV2Caller // Read-only binding to the contract
|
||
|
NodesV2Transactor // Write-only binding to the contract
|
||
|
NodesV2Filterer // Log filterer for contract events
|
||
|
}
|
||
|
|
||
|
// NodesV2Caller is an auto generated read-only Go binding around an Ethereum contract.
|
||
|
type NodesV2Caller struct {
|
||
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||
|
}
|
||
|
|
||
|
// NodesV2Transactor is an auto generated write-only Go binding around an Ethereum contract.
|
||
|
type NodesV2Transactor struct {
|
||
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||
|
}
|
||
|
|
||
|
// NodesV2Filterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
||
|
type NodesV2Filterer struct {
|
||
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||
|
}
|
||
|
|
||
|
// NodesV2Session is an auto generated Go binding around an Ethereum contract,
|
||
|
// with pre-set call and transact options.
|
||
|
type NodesV2Session struct {
|
||
|
Contract *NodesV2 // Generic contract binding to set the session for
|
||
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
||
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||
|
}
|
||
|
|
||
|
// NodesV2CallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
||
|
// with pre-set call options.
|
||
|
type NodesV2CallerSession struct {
|
||
|
Contract *NodesV2Caller // Generic contract caller binding to set the session for
|
||
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
||
|
}
|
||
|
|
||
|
// NodesV2TransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
||
|
// with pre-set transact options.
|
||
|
type NodesV2TransactorSession struct {
|
||
|
Contract *NodesV2Transactor // Generic contract transactor binding to set the session for
|
||
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||
|
}
|
||
|
|
||
|
// NodesV2Raw is an auto generated low-level Go binding around an Ethereum contract.
|
||
|
type NodesV2Raw struct {
|
||
|
Contract *NodesV2 // Generic contract binding to access the raw methods on
|
||
|
}
|
||
|
|
||
|
// NodesV2CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
||
|
type NodesV2CallerRaw struct {
|
||
|
Contract *NodesV2Caller // Generic read-only contract binding to access the raw methods on
|
||
|
}
|
||
|
|
||
|
// NodesV2TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
||
|
type NodesV2TransactorRaw struct {
|
||
|
Contract *NodesV2Transactor // Generic write-only contract binding to access the raw methods on
|
||
|
}
|
||
|
|
||
|
// NewNodesV2 creates a new instance of NodesV2, bound to a specific deployed contract.
|
||
|
func NewNodesV2(address common.Address, backend bind.ContractBackend) (*NodesV2, error) {
|
||
|
contract, err := bindNodesV2(address, backend, backend, backend)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &NodesV2{NodesV2Caller: NodesV2Caller{contract: contract}, NodesV2Transactor: NodesV2Transactor{contract: contract}, NodesV2Filterer: NodesV2Filterer{contract: contract}}, nil
|
||
|
}
|
||
|
|
||
|
// NewNodesV2Caller creates a new read-only instance of NodesV2, bound to a specific deployed contract.
|
||
|
func NewNodesV2Caller(address common.Address, caller bind.ContractCaller) (*NodesV2Caller, error) {
|
||
|
contract, err := bindNodesV2(address, caller, nil, nil)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &NodesV2Caller{contract: contract}, nil
|
||
|
}
|
||
|
|
||
|
// NewNodesV2Transactor creates a new write-only instance of NodesV2, bound to a specific deployed contract.
|
||
|
func NewNodesV2Transactor(address common.Address, transactor bind.ContractTransactor) (*NodesV2Transactor, error) {
|
||
|
contract, err := bindNodesV2(address, nil, transactor, nil)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &NodesV2Transactor{contract: contract}, nil
|
||
|
}
|
||
|
|
||
|
// NewNodesV2Filterer creates a new log filterer instance of NodesV2, bound to a specific deployed contract.
|
||
|
func NewNodesV2Filterer(address common.Address, filterer bind.ContractFilterer) (*NodesV2Filterer, error) {
|
||
|
contract, err := bindNodesV2(address, nil, nil, filterer)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return &NodesV2Filterer{contract: contract}, nil
|
||
|
}
|
||
|
|
||
|
// bindNodesV2 binds a generic wrapper to an already deployed contract.
|
||
|
func bindNodesV2(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
||
|
parsed, err := abi.JSON(strings.NewReader(NodesV2ABI))
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
|
||
|
}
|
||
|
|
||
|
// Call invokes the (constant) contract method with params as input values and
|
||
|
// sets the output to result. The result type might be a single field for simple
|
||
|
// returns, a slice of interfaces for anonymous returns and a struct for named
|
||
|
// returns.
|
||
|
func (_NodesV2 *NodesV2Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
|
||
|
return _NodesV2.Contract.NodesV2Caller.contract.Call(opts, result, method, params...)
|
||
|
}
|
||
|
|
||
|
// Transfer initiates a plain transaction to move funds to the contract, calling
|
||
|
// its default method if one is available.
|
||
|
func (_NodesV2 *NodesV2Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.NodesV2Transactor.contract.Transfer(opts)
|
||
|
}
|
||
|
|
||
|
// Transact invokes the (paid) contract method with params as input values.
|
||
|
func (_NodesV2 *NodesV2Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.NodesV2Transactor.contract.Transact(opts, method, params...)
|
||
|
}
|
||
|
|
||
|
// Call invokes the (constant) contract method with params as input values and
|
||
|
// sets the output to result. The result type might be a single field for simple
|
||
|
// returns, a slice of interfaces for anonymous returns and a struct for named
|
||
|
// returns.
|
||
|
func (_NodesV2 *NodesV2CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
|
||
|
return _NodesV2.Contract.contract.Call(opts, result, method, params...)
|
||
|
}
|
||
|
|
||
|
// Transfer initiates a plain transaction to move funds to the contract, calling
|
||
|
// its default method if one is available.
|
||
|
func (_NodesV2 *NodesV2TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.contract.Transfer(opts)
|
||
|
}
|
||
|
|
||
|
// Transact invokes the (paid) contract method with params as input values.
|
||
|
func (_NodesV2 *NodesV2TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.contract.Transact(opts, method, params...)
|
||
|
}
|
||
|
|
||
|
// ActiveNodeCount is a free data retrieval call binding the contract method 0x75340815.
|
||
|
//
|
||
|
// Solidity: function activeNodeCount() constant returns(uint256)
|
||
|
func (_NodesV2 *NodesV2Caller) ActiveNodeCount(opts *bind.CallOpts) (*big.Int, error) {
|
||
|
var (
|
||
|
ret0 = new(*big.Int)
|
||
|
)
|
||
|
out := ret0
|
||
|
err := _NodesV2.contract.Call(opts, out, "activeNodeCount")
|
||
|
return *ret0, err
|
||
|
}
|
||
|
|
||
|
// ActiveNodeCount is a free data retrieval call binding the contract method 0x75340815.
|
||
|
//
|
||
|
// Solidity: function activeNodeCount() constant returns(uint256)
|
||
|
func (_NodesV2 *NodesV2Session) ActiveNodeCount() (*big.Int, error) {
|
||
|
return _NodesV2.Contract.ActiveNodeCount(&_NodesV2.CallOpts)
|
||
|
}
|
||
|
|
||
|
// ActiveNodeCount is a free data retrieval call binding the contract method 0x75340815.
|
||
|
//
|
||
|
// Solidity: function activeNodeCount() constant returns(uint256)
|
||
|
func (_NodesV2 *NodesV2CallerSession) ActiveNodeCount() (*big.Int, error) {
|
||
|
return _NodesV2.Contract.ActiveNodeCount(&_NodesV2.CallOpts)
|
||
|
}
|
||
|
|
||
|
// ActiveNodes is a free data retrieval call binding the contract method 0x96f9d983.
|
||
|
//
|
||
|
// Solidity: function activeNodes(uint256 ) constant returns(bytes publicKey, uint32 ip, uint16 port, uint8 joinVotes, uint8 removeVotes, uint256 lastTimeHasVoted, uint256 lastTimeHasBeenVoted, uint32 joiningSession, uint32 activeSession)
|
||
|
func (_NodesV2 *NodesV2Caller) ActiveNodes(opts *bind.CallOpts, arg0 *big.Int) (struct {
|
||
|
PublicKey []byte
|
||
|
Ip uint32
|
||
|
Port uint16
|
||
|
JoinVotes uint8
|
||
|
RemoveVotes uint8
|
||
|
LastTimeHasVoted *big.Int
|
||
|
LastTimeHasBeenVoted *big.Int
|
||
|
JoiningSession uint32
|
||
|
ActiveSession uint32
|
||
|
}, error) {
|
||
|
ret := new(struct {
|
||
|
PublicKey []byte
|
||
|
Ip uint32
|
||
|
Port uint16
|
||
|
JoinVotes uint8
|
||
|
RemoveVotes uint8
|
||
|
LastTimeHasVoted *big.Int
|
||
|
LastTimeHasBeenVoted *big.Int
|
||
|
JoiningSession uint32
|
||
|
ActiveSession uint32
|
||
|
})
|
||
|
out := ret
|
||
|
err := _NodesV2.contract.Call(opts, out, "activeNodes", arg0)
|
||
|
return *ret, err
|
||
|
}
|
||
|
|
||
|
// ActiveNodes is a free data retrieval call binding the contract method 0x96f9d983.
|
||
|
//
|
||
|
// Solidity: function activeNodes(uint256 ) constant returns(bytes publicKey, uint32 ip, uint16 port, uint8 joinVotes, uint8 removeVotes, uint256 lastTimeHasVoted, uint256 lastTimeHasBeenVoted, uint32 joiningSession, uint32 activeSession)
|
||
|
func (_NodesV2 *NodesV2Session) ActiveNodes(arg0 *big.Int) (struct {
|
||
|
PublicKey []byte
|
||
|
Ip uint32
|
||
|
Port uint16
|
||
|
JoinVotes uint8
|
||
|
RemoveVotes uint8
|
||
|
LastTimeHasVoted *big.Int
|
||
|
LastTimeHasBeenVoted *big.Int
|
||
|
JoiningSession uint32
|
||
|
ActiveSession uint32
|
||
|
}, error) {
|
||
|
return _NodesV2.Contract.ActiveNodes(&_NodesV2.CallOpts, arg0)
|
||
|
}
|
||
|
|
||
|
// ActiveNodes is a free data retrieval call binding the contract method 0x96f9d983.
|
||
|
//
|
||
|
// Solidity: function activeNodes(uint256 ) constant returns(bytes publicKey, uint32 ip, uint16 port, uint8 joinVotes, uint8 removeVotes, uint256 lastTimeHasVoted, uint256 lastTimeHasBeenVoted, uint32 joiningSession, uint32 activeSession)
|
||
|
func (_NodesV2 *NodesV2CallerSession) ActiveNodes(arg0 *big.Int) (struct {
|
||
|
PublicKey []byte
|
||
|
Ip uint32
|
||
|
Port uint16
|
||
|
JoinVotes uint8
|
||
|
RemoveVotes uint8
|
||
|
LastTimeHasVoted *big.Int
|
||
|
LastTimeHasBeenVoted *big.Int
|
||
|
JoiningSession uint32
|
||
|
ActiveSession uint32
|
||
|
}, error) {
|
||
|
return _NodesV2.Contract.ActiveNodes(&_NodesV2.CallOpts, arg0)
|
||
|
}
|
||
|
|
||
|
// CurrentSession is a free data retrieval call binding the contract method 0xd4166763.
|
||
|
//
|
||
|
// Solidity: function currentSession() constant returns(uint32)
|
||
|
func (_NodesV2 *NodesV2Caller) CurrentSession(opts *bind.CallOpts) (uint32, error) {
|
||
|
var (
|
||
|
ret0 = new(uint32)
|
||
|
)
|
||
|
out := ret0
|
||
|
err := _NodesV2.contract.Call(opts, out, "currentSession")
|
||
|
return *ret0, err
|
||
|
}
|
||
|
|
||
|
// CurrentSession is a free data retrieval call binding the contract method 0xd4166763.
|
||
|
//
|
||
|
// Solidity: function currentSession() constant returns(uint32)
|
||
|
func (_NodesV2 *NodesV2Session) CurrentSession() (uint32, error) {
|
||
|
return _NodesV2.Contract.CurrentSession(&_NodesV2.CallOpts)
|
||
|
}
|
||
|
|
||
|
// CurrentSession is a free data retrieval call binding the contract method 0xd4166763.
|
||
|
//
|
||
|
// Solidity: function currentSession() constant returns(uint32)
|
||
|
func (_NodesV2 *NodesV2CallerSession) CurrentSession() (uint32, error) {
|
||
|
return _NodesV2.Contract.CurrentSession(&_NodesV2.CallOpts)
|
||
|
}
|
||
|
|
||
|
// GetCurrentSession is a free data retrieval call binding the contract method 0x1401795f.
|
||
|
//
|
||
|
// Solidity: function getCurrentSession() constant returns(uint256)
|
||
|
func (_NodesV2 *NodesV2Caller) GetCurrentSession(opts *bind.CallOpts) (*big.Int, error) {
|
||
|
var (
|
||
|
ret0 = new(*big.Int)
|
||
|
)
|
||
|
out := ret0
|
||
|
err := _NodesV2.contract.Call(opts, out, "getCurrentSession")
|
||
|
return *ret0, err
|
||
|
}
|
||
|
|
||
|
// GetCurrentSession is a free data retrieval call binding the contract method 0x1401795f.
|
||
|
//
|
||
|
// Solidity: function getCurrentSession() constant returns(uint256)
|
||
|
func (_NodesV2 *NodesV2Session) GetCurrentSession() (*big.Int, error) {
|
||
|
return _NodesV2.Contract.GetCurrentSession(&_NodesV2.CallOpts)
|
||
|
}
|
||
|
|
||
|
// GetCurrentSession is a free data retrieval call binding the contract method 0x1401795f.
|
||
|
//
|
||
|
// Solidity: function getCurrentSession() constant returns(uint256)
|
||
|
func (_NodesV2 *NodesV2CallerSession) GetCurrentSession() (*big.Int, error) {
|
||
|
return _NodesV2.Contract.GetCurrentSession(&_NodesV2.CallOpts)
|
||
|
}
|
||
|
|
||
|
// GetInactiveNode is a free data retrieval call binding the contract method 0x93696e1a.
|
||
|
//
|
||
|
// Solidity: function getInactiveNode(uint256 index) constant returns(bytes, uint32, uint16, uint32, uint32)
|
||
|
func (_NodesV2 *NodesV2Caller) GetInactiveNode(opts *bind.CallOpts, index *big.Int) ([]byte, uint32, uint16, uint32, uint32, error) {
|
||
|
var (
|
||
|
ret0 = new([]byte)
|
||
|
ret1 = new(uint32)
|
||
|
ret2 = new(uint16)
|
||
|
ret3 = new(uint32)
|
||
|
ret4 = new(uint32)
|
||
|
)
|
||
|
out := &[]interface{}{
|
||
|
ret0,
|
||
|
ret1,
|
||
|
ret2,
|
||
|
ret3,
|
||
|
ret4,
|
||
|
}
|
||
|
err := _NodesV2.contract.Call(opts, out, "getInactiveNode", index)
|
||
|
return *ret0, *ret1, *ret2, *ret3, *ret4, err
|
||
|
}
|
||
|
|
||
|
// GetInactiveNode is a free data retrieval call binding the contract method 0x93696e1a.
|
||
|
//
|
||
|
// Solidity: function getInactiveNode(uint256 index) constant returns(bytes, uint32, uint16, uint32, uint32)
|
||
|
func (_NodesV2 *NodesV2Session) GetInactiveNode(index *big.Int) ([]byte, uint32, uint16, uint32, uint32, error) {
|
||
|
return _NodesV2.Contract.GetInactiveNode(&_NodesV2.CallOpts, index)
|
||
|
}
|
||
|
|
||
|
// GetInactiveNode is a free data retrieval call binding the contract method 0x93696e1a.
|
||
|
//
|
||
|
// Solidity: function getInactiveNode(uint256 index) constant returns(bytes, uint32, uint16, uint32, uint32)
|
||
|
func (_NodesV2 *NodesV2CallerSession) GetInactiveNode(index *big.Int) ([]byte, uint32, uint16, uint32, uint32, error) {
|
||
|
return _NodesV2.Contract.GetInactiveNode(&_NodesV2.CallOpts, index)
|
||
|
}
|
||
|
|
||
|
// GetNode is a free data retrieval call binding the contract method 0x4f0f4aa9.
|
||
|
//
|
||
|
// Solidity: function getNode(uint256 index) constant returns(bytes, uint32, uint16, uint32, uint32)
|
||
|
func (_NodesV2 *NodesV2Caller) GetNode(opts *bind.CallOpts, index *big.Int) ([]byte, uint32, uint16, uint32, uint32, error) {
|
||
|
var (
|
||
|
ret0 = new([]byte)
|
||
|
ret1 = new(uint32)
|
||
|
ret2 = new(uint16)
|
||
|
ret3 = new(uint32)
|
||
|
ret4 = new(uint32)
|
||
|
)
|
||
|
out := &[]interface{}{
|
||
|
ret0,
|
||
|
ret1,
|
||
|
ret2,
|
||
|
ret3,
|
||
|
ret4,
|
||
|
}
|
||
|
err := _NodesV2.contract.Call(opts, out, "getNode", index)
|
||
|
return *ret0, *ret1, *ret2, *ret3, *ret4, err
|
||
|
}
|
||
|
|
||
|
// GetNode is a free data retrieval call binding the contract method 0x4f0f4aa9.
|
||
|
//
|
||
|
// Solidity: function getNode(uint256 index) constant returns(bytes, uint32, uint16, uint32, uint32)
|
||
|
func (_NodesV2 *NodesV2Session) GetNode(index *big.Int) ([]byte, uint32, uint16, uint32, uint32, error) {
|
||
|
return _NodesV2.Contract.GetNode(&_NodesV2.CallOpts, index)
|
||
|
}
|
||
|
|
||
|
// GetNode is a free data retrieval call binding the contract method 0x4f0f4aa9.
|
||
|
//
|
||
|
// Solidity: function getNode(uint256 index) constant returns(bytes, uint32, uint16, uint32, uint32)
|
||
|
func (_NodesV2 *NodesV2CallerSession) GetNode(index *big.Int) ([]byte, uint32, uint16, uint32, uint32, error) {
|
||
|
return _NodesV2.Contract.GetNode(&_NodesV2.CallOpts, index)
|
||
|
}
|
||
|
|
||
|
// InactiveNodeCount is a free data retrieval call binding the contract method 0x6d1c76c2.
|
||
|
//
|
||
|
// Solidity: function inactiveNodeCount() constant returns(uint256)
|
||
|
func (_NodesV2 *NodesV2Caller) InactiveNodeCount(opts *bind.CallOpts) (*big.Int, error) {
|
||
|
var (
|
||
|
ret0 = new(*big.Int)
|
||
|
)
|
||
|
out := ret0
|
||
|
err := _NodesV2.contract.Call(opts, out, "inactiveNodeCount")
|
||
|
return *ret0, err
|
||
|
}
|
||
|
|
||
|
// InactiveNodeCount is a free data retrieval call binding the contract method 0x6d1c76c2.
|
||
|
//
|
||
|
// Solidity: function inactiveNodeCount() constant returns(uint256)
|
||
|
func (_NodesV2 *NodesV2Session) InactiveNodeCount() (*big.Int, error) {
|
||
|
return _NodesV2.Contract.InactiveNodeCount(&_NodesV2.CallOpts)
|
||
|
}
|
||
|
|
||
|
// InactiveNodeCount is a free data retrieval call binding the contract method 0x6d1c76c2.
|
||
|
//
|
||
|
// Solidity: function inactiveNodeCount() constant returns(uint256)
|
||
|
func (_NodesV2 *NodesV2CallerSession) InactiveNodeCount() (*big.Int, error) {
|
||
|
return _NodesV2.Contract.InactiveNodeCount(&_NodesV2.CallOpts)
|
||
|
}
|
||
|
|
||
|
// InactiveNodes is a free data retrieval call binding the contract method 0x72460fa8.
|
||
|
//
|
||
|
// Solidity: function inactiveNodes(uint256 ) constant returns(bytes publicKey, uint32 ip, uint16 port, uint8 joinVotes, uint8 removeVotes, uint256 lastTimeHasVoted, uint256 lastTimeHasBeenVoted, uint32 joiningSession, uint32 activeSession)
|
||
|
func (_NodesV2 *NodesV2Caller) InactiveNodes(opts *bind.CallOpts, arg0 *big.Int) (struct {
|
||
|
PublicKey []byte
|
||
|
Ip uint32
|
||
|
Port uint16
|
||
|
JoinVotes uint8
|
||
|
RemoveVotes uint8
|
||
|
LastTimeHasVoted *big.Int
|
||
|
LastTimeHasBeenVoted *big.Int
|
||
|
JoiningSession uint32
|
||
|
ActiveSession uint32
|
||
|
}, error) {
|
||
|
ret := new(struct {
|
||
|
PublicKey []byte
|
||
|
Ip uint32
|
||
|
Port uint16
|
||
|
JoinVotes uint8
|
||
|
RemoveVotes uint8
|
||
|
LastTimeHasVoted *big.Int
|
||
|
LastTimeHasBeenVoted *big.Int
|
||
|
JoiningSession uint32
|
||
|
ActiveSession uint32
|
||
|
})
|
||
|
out := ret
|
||
|
err := _NodesV2.contract.Call(opts, out, "inactiveNodes", arg0)
|
||
|
return *ret, err
|
||
|
}
|
||
|
|
||
|
// InactiveNodes is a free data retrieval call binding the contract method 0x72460fa8.
|
||
|
//
|
||
|
// Solidity: function inactiveNodes(uint256 ) constant returns(bytes publicKey, uint32 ip, uint16 port, uint8 joinVotes, uint8 removeVotes, uint256 lastTimeHasVoted, uint256 lastTimeHasBeenVoted, uint32 joiningSession, uint32 activeSession)
|
||
|
func (_NodesV2 *NodesV2Session) InactiveNodes(arg0 *big.Int) (struct {
|
||
|
PublicKey []byte
|
||
|
Ip uint32
|
||
|
Port uint16
|
||
|
JoinVotes uint8
|
||
|
RemoveVotes uint8
|
||
|
LastTimeHasVoted *big.Int
|
||
|
LastTimeHasBeenVoted *big.Int
|
||
|
JoiningSession uint32
|
||
|
ActiveSession uint32
|
||
|
}, error) {
|
||
|
return _NodesV2.Contract.InactiveNodes(&_NodesV2.CallOpts, arg0)
|
||
|
}
|
||
|
|
||
|
// InactiveNodes is a free data retrieval call binding the contract method 0x72460fa8.
|
||
|
//
|
||
|
// Solidity: function inactiveNodes(uint256 ) constant returns(bytes publicKey, uint32 ip, uint16 port, uint8 joinVotes, uint8 removeVotes, uint256 lastTimeHasVoted, uint256 lastTimeHasBeenVoted, uint32 joiningSession, uint32 activeSession)
|
||
|
func (_NodesV2 *NodesV2CallerSession) InactiveNodes(arg0 *big.Int) (struct {
|
||
|
PublicKey []byte
|
||
|
Ip uint32
|
||
|
Port uint16
|
||
|
JoinVotes uint8
|
||
|
RemoveVotes uint8
|
||
|
LastTimeHasVoted *big.Int
|
||
|
LastTimeHasBeenVoted *big.Int
|
||
|
JoiningSession uint32
|
||
|
ActiveSession uint32
|
||
|
}, error) {
|
||
|
return _NodesV2.Contract.InactiveNodes(&_NodesV2.CallOpts, arg0)
|
||
|
}
|
||
|
|
||
|
// PublicKeyToAddress is a free data retrieval call binding the contract method 0x43ae656c.
|
||
|
//
|
||
|
// Solidity: function publicKeyToAddress(bytes publicKey) constant returns(address)
|
||
|
func (_NodesV2 *NodesV2Caller) PublicKeyToAddress(opts *bind.CallOpts, publicKey []byte) (common.Address, error) {
|
||
|
var (
|
||
|
ret0 = new(common.Address)
|
||
|
)
|
||
|
out := ret0
|
||
|
err := _NodesV2.contract.Call(opts, out, "publicKeyToAddress", publicKey)
|
||
|
return *ret0, err
|
||
|
}
|
||
|
|
||
|
// PublicKeyToAddress is a free data retrieval call binding the contract method 0x43ae656c.
|
||
|
//
|
||
|
// Solidity: function publicKeyToAddress(bytes publicKey) constant returns(address)
|
||
|
func (_NodesV2 *NodesV2Session) PublicKeyToAddress(publicKey []byte) (common.Address, error) {
|
||
|
return _NodesV2.Contract.PublicKeyToAddress(&_NodesV2.CallOpts, publicKey)
|
||
|
}
|
||
|
|
||
|
// PublicKeyToAddress is a free data retrieval call binding the contract method 0x43ae656c.
|
||
|
//
|
||
|
// Solidity: function publicKeyToAddress(bytes publicKey) constant returns(address)
|
||
|
func (_NodesV2 *NodesV2CallerSession) PublicKeyToAddress(publicKey []byte) (common.Address, error) {
|
||
|
return _NodesV2.Contract.PublicKeyToAddress(&_NodesV2.CallOpts, publicKey)
|
||
|
}
|
||
|
|
||
|
// Registered is a free data retrieval call binding the contract method 0x5aca952e.
|
||
|
//
|
||
|
// Solidity: function registered(bytes publicKey) constant returns(bool)
|
||
|
func (_NodesV2 *NodesV2Caller) Registered(opts *bind.CallOpts, publicKey []byte) (bool, error) {
|
||
|
var (
|
||
|
ret0 = new(bool)
|
||
|
)
|
||
|
out := ret0
|
||
|
err := _NodesV2.contract.Call(opts, out, "registered", publicKey)
|
||
|
return *ret0, err
|
||
|
}
|
||
|
|
||
|
// Registered is a free data retrieval call binding the contract method 0x5aca952e.
|
||
|
//
|
||
|
// Solidity: function registered(bytes publicKey) constant returns(bool)
|
||
|
func (_NodesV2 *NodesV2Session) Registered(publicKey []byte) (bool, error) {
|
||
|
return _NodesV2.Contract.Registered(&_NodesV2.CallOpts, publicKey)
|
||
|
}
|
||
|
|
||
|
// Registered is a free data retrieval call binding the contract method 0x5aca952e.
|
||
|
//
|
||
|
// Solidity: function registered(bytes publicKey) constant returns(bool)
|
||
|
func (_NodesV2 *NodesV2CallerSession) Registered(publicKey []byte) (bool, error) {
|
||
|
return _NodesV2.Contract.Registered(&_NodesV2.CallOpts, publicKey)
|
||
|
}
|
||
|
|
||
|
// AddActiveNode is a paid mutator transaction binding the contract method 0xdad7bcee.
|
||
|
//
|
||
|
// Solidity: function addActiveNode(bytes publicKey, uint32 ip, uint16 port) returns()
|
||
|
func (_NodesV2 *NodesV2Transactor) AddActiveNode(opts *bind.TransactOpts, publicKey []byte, ip uint32, port uint16) (*types.Transaction, error) {
|
||
|
return _NodesV2.contract.Transact(opts, "addActiveNode", publicKey, ip, port)
|
||
|
}
|
||
|
|
||
|
// AddActiveNode is a paid mutator transaction binding the contract method 0xdad7bcee.
|
||
|
//
|
||
|
// Solidity: function addActiveNode(bytes publicKey, uint32 ip, uint16 port) returns()
|
||
|
func (_NodesV2 *NodesV2Session) AddActiveNode(publicKey []byte, ip uint32, port uint16) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.AddActiveNode(&_NodesV2.TransactOpts, publicKey, ip, port)
|
||
|
}
|
||
|
|
||
|
// AddActiveNode is a paid mutator transaction binding the contract method 0xdad7bcee.
|
||
|
//
|
||
|
// Solidity: function addActiveNode(bytes publicKey, uint32 ip, uint16 port) returns()
|
||
|
func (_NodesV2 *NodesV2TransactorSession) AddActiveNode(publicKey []byte, ip uint32, port uint16) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.AddActiveNode(&_NodesV2.TransactOpts, publicKey, ip, port)
|
||
|
}
|
||
|
|
||
|
// RegisterNode is a paid mutator transaction binding the contract method 0x63cd6e18.
|
||
|
//
|
||
|
// Solidity: function registerNode(bytes publicKey, uint32 ip, uint16 port) returns()
|
||
|
func (_NodesV2 *NodesV2Transactor) RegisterNode(opts *bind.TransactOpts, publicKey []byte, ip uint32, port uint16) (*types.Transaction, error) {
|
||
|
return _NodesV2.contract.Transact(opts, "registerNode", publicKey, ip, port)
|
||
|
}
|
||
|
|
||
|
// RegisterNode is a paid mutator transaction binding the contract method 0x63cd6e18.
|
||
|
//
|
||
|
// Solidity: function registerNode(bytes publicKey, uint32 ip, uint16 port) returns()
|
||
|
func (_NodesV2 *NodesV2Session) RegisterNode(publicKey []byte, ip uint32, port uint16) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.RegisterNode(&_NodesV2.TransactOpts, publicKey, ip, port)
|
||
|
}
|
||
|
|
||
|
// RegisterNode is a paid mutator transaction binding the contract method 0x63cd6e18.
|
||
|
//
|
||
|
// Solidity: function registerNode(bytes publicKey, uint32 ip, uint16 port) returns()
|
||
|
func (_NodesV2 *NodesV2TransactorSession) RegisterNode(publicKey []byte, ip uint32, port uint16) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.RegisterNode(&_NodesV2.TransactOpts, publicKey, ip, port)
|
||
|
}
|
||
|
|
||
|
// Vote is a paid mutator transaction binding the contract method 0xa19e39e8.
|
||
|
//
|
||
|
// Solidity: function vote(address[] joinNodes, address[] removeNodes) returns()
|
||
|
func (_NodesV2 *NodesV2Transactor) Vote(opts *bind.TransactOpts, joinNodes []common.Address, removeNodes []common.Address) (*types.Transaction, error) {
|
||
|
return _NodesV2.contract.Transact(opts, "vote", joinNodes, removeNodes)
|
||
|
}
|
||
|
|
||
|
// Vote is a paid mutator transaction binding the contract method 0xa19e39e8.
|
||
|
//
|
||
|
// Solidity: function vote(address[] joinNodes, address[] removeNodes) returns()
|
||
|
func (_NodesV2 *NodesV2Session) Vote(joinNodes []common.Address, removeNodes []common.Address) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.Vote(&_NodesV2.TransactOpts, joinNodes, removeNodes)
|
||
|
}
|
||
|
|
||
|
// Vote is a paid mutator transaction binding the contract method 0xa19e39e8.
|
||
|
//
|
||
|
// Solidity: function vote(address[] joinNodes, address[] removeNodes) returns()
|
||
|
func (_NodesV2 *NodesV2TransactorSession) Vote(joinNodes []common.Address, removeNodes []common.Address) (*types.Transaction, error) {
|
||
|
return _NodesV2.Contract.Vote(&_NodesV2.TransactOpts, joinNodes, removeNodes)
|
||
|
}
|