2018-01-27 19:24:13 +00:00
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package contracts
import (
"math/big"
"strings"
2018-02-07 19:57:25 +00:00
ethereum "github.com/ethereum/go-ethereum"
2018-01-27 19:24:13 +00:00
"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"
2018-02-07 19:57:25 +00:00
"github.com/ethereum/go-ethereum/event"
2018-01-27 19:24:13 +00:00
)
2018-03-09 00:04:13 +00:00
// SMCABI is the input ABI used to generate the binding from.
2018-03-09 01:40:22 +00:00
const SMCABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"_shardId\",\"type\":\"int256\"},{\"name\":\"_expectedPeriodNumber\",\"type\":\"uint256\"},{\"name\":\"_periodStartPrevHash\",\"type\":\"bytes32\"},{\"name\":\"_parentHash\",\"type\":\"bytes32\"},{\"name\":\"_transactionRoot\",\"type\":\"bytes32\"},{\"name\":\"_coinbase\",\"type\":\"address\"},{\"name\":\"_stateRoot\",\"type\":\"bytes32\"},{\"name\":\"_receiptRoot\",\"type\":\"bytes32\"},{\"name\":\"_number\",\"type\":\"int256\"}],\"name\":\"addHeader\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"shardCount\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numCollators\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_receiptId\",\"type\":\"int256\"},{\"name\":\"_txGasprice\",\"type\":\"uint256\"}],\"name\":\"updateGasPrice\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_shardId\",\"type\":\"int256\"},{\"name\":\"_txStartgas\",\"type\":\"uint256\"},{\"name\":\"_txGasprice\",\"type\":\"uint256\"},{\"name\":\"_data\",\"type\":\"bytes12\"}],\"name\":\"txToShard\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"name\":\"periodHead\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_shardId\",\"type\":\"int256\"},{\"name\":\"_period\",\"type\":\"uint256\"}],\"name\":\"getEligibleCollator\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_collatorIndex\",\"type\":\"int256\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCollationGasLimit\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"name\":\"collators\",\"outputs\":[{\"name\":\"deposit\",\"type\":\"uint256\"},{\"name\":\"addr\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"int256\"},{\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"collationHeaders\",\"outputs\":[{\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"name\":\"score\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"isCollatorDeposited\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"deposit\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"name\":\"receipts\",\"outputs\":[{\"name\":\"shardId\",\"type\":\"int256\"},{\"name\":\"txStartgas\",\"type\":\"uint256\"},{\"name\":\"txGasprice\",\"type\":\"uint256\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes32\"},{\"name\":\"sender\",\"type\":\"address\"},{\"name\":\"to\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\" : fal
2018-01-27 19:24:13 +00:00
2018-03-09 00:04:13 +00:00
// SMCBin is the compiled bytecode used for deploying new contracts.
2018-04-01 21:06:00 +00:00
const SMCBin = ` 0x6060604052341561000f57600080fd5b610bcd8061001e6000396000f3006060604052600436106100cf5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630341518d81146100d457806304e9c77a146101205780630908fb31146101455780632213138914610158578063372a9e2a14610166578063584475db146101905780636115a1c3146101a65780637e62eab8146101db578063934586ec146101f35780639c23c6ab14610206578063b9d8ef961461023d578063ccb180e91461026e578063d0e30db01461028d578063d19ca56814610295575b600080fd5b34156100df57600080fd5b61010c600435602435604435606435608435600160a060020a0360a4351660c43560e435610104356102f4565b604051901515815260200160405180910390f35b341561012b57600080fd5b6101336105da565b60405190815260200160405180910390f35b341561015057600080fd5b6101336105df565b61010c6004356024356105e5565b610133600160a060020a0360043516602435604435606435600160a060020a03196084351661062a565b341561019b57600080fd5b61013360043561074d565b34156101b157600080fd5b6101bf60043560243561075f565b604051600160a060020a03909116815260200160405180910390f35b34156101e657600080fd5b6101f16004356107ed565b005b34156101fe57600080fd5b6101336108f0565b341561021157600080fd5b61021c6004356108f8565b604051918252600160a060020a031660208201526040908101905180910390f35b341561024857600080fd5b61025660043560243561091a565b60405191825260208201526040908101905180910390f35b341561027957600080fd5b61010c600160a060020a036004351661093b565b610133610950565b34156102a057600080fd5b6102ab600435610a75565b604051968752602087019590955260408087019490945260608601929092526080850152600160a060020a0390811660a085015290911660c083015260e0909101905180910390f35b60006102fe610b7a565b60008b1215801561030f575060648b125b151561031a57600080fd5b600543101561032857600080fd5b600543048a1461033757600080fd5b60001960058b020140891461034b57600080fd5b8a8a8a8a8a600160a060020a038b168a8a8a60405198895260208901979097526040808901969096526060880194909452608087019290925260a086015260c085015260e08401526101008301919091526101209091019051908190039020815260008b81526001602052604081209082518152602081019190915260400160002060010154156103d857fe5b87156104005760008b81526001602081815260408084208c8552909152822001541361040057fe5b60008b8152600960205260409020548a901261041857fe5b6104258b6005430461075f565b600160a060020a03166040820190815251600160a060020a0316151561044a57600080fd5b8060400151600160a060020a031633600160a060020a031614151561046e57600080fd5b60008b81526001602081815260408084208c855282529092208101540190820190815251831461049d57600080fd5b60408051908101604052888152602080820190830151905260008c81526001602052604081209083518152602081019190915260400160002081518155602082015160019182015560008d81526009602090815260408083208f9055838252808320600383528184205484528252909120909101549150820151131561053657805160008c815260036020526040902055600160608201525b8a7f788a01fdbeb989d24e706cdd2993ca4213400e7b5fa631819b2acfe8ebad41358b8b8b8b8b8b8b8b8a606001518b60200151604051998a5260208a01989098526040808a01979097526060890195909552600160a060020a03909316608088015260a087019190915260c086015260e08501521515610100840152610120830191909152610140909101905180910390a25060019a9950505050505050505050565b606481565b60045481565b60008281526002602052604081206005015433600160a060020a0390811691161461060f57600080fd5b50600091825260026020819052604090922090910155600190565b60008060e060405190810160409081528782526020808301889052818301879052346060840152600160a060020a031986166080840152600160a060020a0333811660a08501528a1660c08401526005546000908152600290915220815181556020820151816001015560408201518160020155606082015181600301556080820151600482015560a0820151600582018054600160a060020a031916600160a060020a039290921691909117905560c08201516006919091018054600160a060020a031916600160a060020a039283161790556005805460018101909155925087915088167ffc322e0c42ee41e0d74b940ceeee9cd5971acdd6ace8ff8010ee7134c31d9ea58360405190815260200160405180910390a39695505050505050565b60096020526000908152604090205481565b6000600482101561076f57600080fd5b4360031983016005021061078257600080fd5b6004546000901361079257600080fd5b60008061079d610abf565b600319850160050240866040519182526020820152604090810190519081900390208115156107c857fe5b0681526020810191909152604001600
2018-01-27 19:24:13 +00:00
2018-03-09 00:04:13 +00:00
// DeploySMC deploys a new Ethereum contract, binding an instance of SMC to it.
func DeploySMC ( auth * bind . TransactOpts , backend bind . ContractBackend ) ( common . Address , * types . Transaction , * SMC , error ) {
parsed , err := abi . JSON ( strings . NewReader ( SMCABI ) )
2018-01-27 19:24:13 +00:00
if err != nil {
return common . Address { } , nil , nil , err
}
2018-03-09 00:04:13 +00:00
address , tx , contract , err := bind . DeployContract ( auth , parsed , common . FromHex ( SMCBin ) , backend )
2018-01-27 19:24:13 +00:00
if err != nil {
return common . Address { } , nil , nil , err
}
2018-03-09 00:04:13 +00:00
return address , tx , & SMC { SMCCaller : SMCCaller { contract : contract } , SMCTransactor : SMCTransactor { contract : contract } , SMCFilterer : SMCFilterer { contract : contract } } , nil
2018-01-27 19:24:13 +00:00
}
2018-03-09 00:04:13 +00:00
// SMC is an auto generated Go binding around an Ethereum contract.
type SMC struct {
SMCCaller // Read-only binding to the contract
SMCTransactor // Write-only binding to the contract
SMCFilterer // Log filterer for contract events
2018-01-27 19:24:13 +00:00
}
2018-03-09 00:04:13 +00:00
// SMCCaller is an auto generated read-only Go binding around an Ethereum contract.
type SMCCaller struct {
2018-01-27 19:24:13 +00:00
contract * bind . BoundContract // Generic contract wrapper for the low level calls
}
2018-03-09 00:04:13 +00:00
// SMCTransactor is an auto generated write-only Go binding around an Ethereum contract.
type SMCTransactor struct {
2018-01-27 19:24:13 +00:00
contract * bind . BoundContract // Generic contract wrapper for the low level calls
}
2018-03-09 00:04:13 +00:00
// SMCFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type SMCFilterer struct {
2018-02-07 13:49:34 +00:00
contract * bind . BoundContract // Generic contract wrapper for the low level calls
}
2018-03-09 00:04:13 +00:00
// SMCSession is an auto generated Go binding around an Ethereum contract,
2018-01-27 19:24:13 +00:00
// with pre-set call and transact options.
2018-03-09 00:04:13 +00:00
type SMCSession struct {
Contract * SMC // Generic contract binding to set the session for
2018-01-27 19:24:13 +00:00
CallOpts bind . CallOpts // Call options to use throughout this session
TransactOpts bind . TransactOpts // Transaction auth options to use throughout this session
}
2018-03-09 00:04:13 +00:00
// SMCCallerSession is an auto generated read-only Go binding around an Ethereum contract,
2018-01-27 19:24:13 +00:00
// with pre-set call options.
2018-03-09 00:04:13 +00:00
type SMCCallerSession struct {
Contract * SMCCaller // Generic contract caller binding to set the session for
2018-01-27 19:24:13 +00:00
CallOpts bind . CallOpts // Call options to use throughout this session
}
2018-03-09 00:04:13 +00:00
// SMCTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
2018-01-27 19:24:13 +00:00
// with pre-set transact options.
2018-03-09 00:04:13 +00:00
type SMCTransactorSession struct {
Contract * SMCTransactor // Generic contract transactor binding to set the session for
2018-01-27 19:24:13 +00:00
TransactOpts bind . TransactOpts // Transaction auth options to use throughout this session
}
2018-03-09 00:04:13 +00:00
// SMCRaw is an auto generated low-level Go binding around an Ethereum contract.
type SMCRaw struct {
Contract * SMC // Generic contract binding to access the raw methods on
2018-01-27 19:24:13 +00:00
}
2018-03-09 00:04:13 +00:00
// SMCCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type SMCCallerRaw struct {
Contract * SMCCaller // Generic read-only contract binding to access the raw methods on
2018-01-27 19:24:13 +00:00
}
2018-03-09 00:04:13 +00:00
// SMCTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type SMCTransactorRaw struct {
Contract * SMCTransactor // Generic write-only contract binding to access the raw methods on
2018-01-27 19:24:13 +00:00
}
2018-03-09 00:04:13 +00:00
// NewSMC creates a new instance of SMC, bound to a specific deployed contract.
func NewSMC ( address common . Address , backend bind . ContractBackend ) ( * SMC , error ) {
contract , err := bindSMC ( address , backend , backend , backend )
2018-01-27 19:24:13 +00:00
if err != nil {
return nil , err
}
2018-03-09 00:04:13 +00:00
return & SMC { SMCCaller : SMCCaller { contract : contract } , SMCTransactor : SMCTransactor { contract : contract } , SMCFilterer : SMCFilterer { contract : contract } } , nil
2018-01-27 19:24:13 +00:00
}
2018-03-09 00:04:13 +00:00
// NewSMCCaller creates a new read-only instance of SMC, bound to a specific deployed contract.
func NewSMCCaller ( address common . Address , caller bind . ContractCaller ) ( * SMCCaller , error ) {
contract , err := bindSMC ( address , caller , nil , nil )
2018-01-27 19:24:13 +00:00
if err != nil {
return nil , err
}
2018-03-09 00:04:13 +00:00
return & SMCCaller { contract : contract } , nil
2018-01-27 19:24:13 +00:00
}
2018-03-09 00:04:13 +00:00
// NewSMCTransactor creates a new write-only instance of SMC, bound to a specific deployed contract.
func NewSMCTransactor ( address common . Address , transactor bind . ContractTransactor ) ( * SMCTransactor , error ) {
contract , err := bindSMC ( address , nil , transactor , nil )
2018-01-27 19:24:13 +00:00
if err != nil {
return nil , err
}
2018-03-09 00:04:13 +00:00
return & SMCTransactor { contract : contract } , nil
2018-01-27 19:24:13 +00:00
}
2018-03-09 00:04:13 +00:00
// NewSMCFilterer creates a new log filterer instance of SMC, bound to a specific deployed contract.
func NewSMCFilterer ( address common . Address , filterer bind . ContractFilterer ) ( * SMCFilterer , error ) {
contract , err := bindSMC ( address , nil , nil , filterer )
2018-02-07 13:49:34 +00:00
if err != nil {
return nil , err
}
2018-03-09 00:04:13 +00:00
return & SMCFilterer { contract : contract } , nil
2018-02-07 13:49:34 +00:00
}
2018-03-09 00:04:13 +00:00
// bindSMC binds a generic wrapper to an already deployed contract.
func bindSMC ( address common . Address , caller bind . ContractCaller , transactor bind . ContractTransactor , filterer bind . ContractFilterer ) ( * bind . BoundContract , error ) {
parsed , err := abi . JSON ( strings . NewReader ( SMCABI ) )
2018-01-27 19:24:13 +00:00
if err != nil {
return nil , err
}
2018-02-07 13:49:34 +00:00
return bind . NewBoundContract ( address , parsed , caller , transactor , filterer ) , nil
2018-01-27 19:24:13 +00:00
}
// 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.
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCRaw ) Call ( opts * bind . CallOpts , result interface { } , method string , params ... interface { } ) error {
return _SMC . Contract . SMCCaller . contract . Call ( opts , result , method , params ... )
2018-01-27 19:24:13 +00:00
}
// Transfer initiates a plain transaction to move funds to the contract, calling
// its default method if one is available.
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCRaw ) Transfer ( opts * bind . TransactOpts ) ( * types . Transaction , error ) {
return _SMC . Contract . SMCTransactor . contract . Transfer ( opts )
2018-01-27 19:24:13 +00:00
}
// Transact invokes the (paid) contract method with params as input values.
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCRaw ) Transact ( opts * bind . TransactOpts , method string , params ... interface { } ) ( * types . Transaction , error ) {
return _SMC . Contract . SMCTransactor . contract . Transact ( opts , method , params ... )
2018-01-27 19:24:13 +00:00
}
// 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.
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCallerRaw ) Call ( opts * bind . CallOpts , result interface { } , method string , params ... interface { } ) error {
return _SMC . Contract . contract . Call ( opts , result , method , params ... )
2018-01-27 19:24:13 +00:00
}
// Transfer initiates a plain transaction to move funds to the contract, calling
// its default method if one is available.
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactorRaw ) Transfer ( opts * bind . TransactOpts ) ( * types . Transaction , error ) {
return _SMC . Contract . contract . Transfer ( opts )
2018-01-27 19:24:13 +00:00
}
// Transact invokes the (paid) contract method with params as input values.
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactorRaw ) Transact ( opts * bind . TransactOpts , method string , params ... interface { } ) ( * types . Transaction , error ) {
return _SMC . Contract . contract . Transact ( opts , method , params ... )
2018-01-27 19:24:13 +00:00
}
2018-02-09 09:31:39 +00:00
// CollationHeaders is a free data retrieval call binding the contract method 0xb9d8ef96.
//
// Solidity: function collationHeaders( int256, bytes32) constant returns(parentHash bytes32, score int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCaller ) CollationHeaders ( opts * bind . CallOpts , arg0 * big . Int , arg1 [ 32 ] byte ) ( struct {
2018-02-09 09:31:39 +00:00
ParentHash [ 32 ] byte
Score * big . Int
} , error ) {
ret := new ( struct {
ParentHash [ 32 ] byte
Score * big . Int
} )
out := ret
2018-03-09 00:04:13 +00:00
err := _SMC . contract . Call ( opts , out , "collationHeaders" , arg0 , arg1 )
2018-02-09 09:31:39 +00:00
return * ret , err
}
// CollationHeaders is a free data retrieval call binding the contract method 0xb9d8ef96.
//
// Solidity: function collationHeaders( int256, bytes32) constant returns(parentHash bytes32, score int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCSession ) CollationHeaders ( arg0 * big . Int , arg1 [ 32 ] byte ) ( struct {
2018-02-09 09:31:39 +00:00
ParentHash [ 32 ] byte
Score * big . Int
} , error ) {
2018-03-09 00:04:13 +00:00
return _SMC . Contract . CollationHeaders ( & _SMC . CallOpts , arg0 , arg1 )
2018-02-09 09:31:39 +00:00
}
// CollationHeaders is a free data retrieval call binding the contract method 0xb9d8ef96.
//
// Solidity: function collationHeaders( int256, bytes32) constant returns(parentHash bytes32, score int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCallerSession ) CollationHeaders ( arg0 * big . Int , arg1 [ 32 ] byte ) ( struct {
2018-02-09 09:31:39 +00:00
ParentHash [ 32 ] byte
Score * big . Int
} , error ) {
2018-03-09 00:04:13 +00:00
return _SMC . Contract . CollationHeaders ( & _SMC . CallOpts , arg0 , arg1 )
}
// Collators is a free data retrieval call binding the contract method 0x9c23c6ab.
//
// Solidity: function collators( int256) constant returns(deposit uint256, addr address)
func ( _SMC * SMCCaller ) Collators ( opts * bind . CallOpts , arg0 * big . Int ) ( struct {
Deposit * big . Int
Addr common . Address
} , error ) {
ret := new ( struct {
Deposit * big . Int
Addr common . Address
} )
out := ret
err := _SMC . contract . Call ( opts , out , "collators" , arg0 )
return * ret , err
}
// Collators is a free data retrieval call binding the contract method 0x9c23c6ab.
//
// Solidity: function collators( int256) constant returns(deposit uint256, addr address)
func ( _SMC * SMCSession ) Collators ( arg0 * big . Int ) ( struct {
Deposit * big . Int
Addr common . Address
} , error ) {
return _SMC . Contract . Collators ( & _SMC . CallOpts , arg0 )
}
// Collators is a free data retrieval call binding the contract method 0x9c23c6ab.
//
// Solidity: function collators( int256) constant returns(deposit uint256, addr address)
func ( _SMC * SMCCallerSession ) Collators ( arg0 * big . Int ) ( struct {
Deposit * big . Int
Addr common . Address
} , error ) {
return _SMC . Contract . Collators ( & _SMC . CallOpts , arg0 )
2018-02-09 09:31:39 +00:00
}
2018-01-27 19:24:13 +00:00
// GetCollationGasLimit is a free data retrieval call binding the contract method 0x934586ec.
//
// Solidity: function getCollationGasLimit() constant returns(uint256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCaller ) GetCollationGasLimit ( opts * bind . CallOpts ) ( * big . Int , error ) {
2018-01-27 19:24:13 +00:00
var (
ret0 = new ( * big . Int )
)
out := ret0
2018-03-09 00:04:13 +00:00
err := _SMC . contract . Call ( opts , out , "getCollationGasLimit" )
2018-01-27 19:24:13 +00:00
return * ret0 , err
}
// GetCollationGasLimit is a free data retrieval call binding the contract method 0x934586ec.
//
// Solidity: function getCollationGasLimit() constant returns(uint256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCSession ) GetCollationGasLimit ( ) ( * big . Int , error ) {
return _SMC . Contract . GetCollationGasLimit ( & _SMC . CallOpts )
2018-01-27 19:24:13 +00:00
}
// GetCollationGasLimit is a free data retrieval call binding the contract method 0x934586ec.
//
// Solidity: function getCollationGasLimit() constant returns(uint256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCallerSession ) GetCollationGasLimit ( ) ( * big . Int , error ) {
return _SMC . Contract . GetCollationGasLimit ( & _SMC . CallOpts )
2018-01-27 19:24:13 +00:00
}
2018-03-09 01:40:22 +00:00
// GetEligibleCollator is a free data retrieval call binding the contract method 0x6115a1c3.
2018-01-27 19:24:13 +00:00
//
2018-03-09 01:40:22 +00:00
// Solidity: function getEligibleCollator(_shardId int256, _period uint256) constant returns(address)
func ( _SMC * SMCCaller ) GetEligibleCollator ( opts * bind . CallOpts , _shardId * big . Int , _period * big . Int ) ( common . Address , error ) {
2018-01-27 19:24:13 +00:00
var (
2018-02-07 13:06:14 +00:00
ret0 = new ( common . Address )
2018-01-27 19:24:13 +00:00
)
out := ret0
2018-03-09 01:40:22 +00:00
err := _SMC . contract . Call ( opts , out , "getEligibleCollator" , _shardId , _period )
2018-01-27 19:24:13 +00:00
return * ret0 , err
}
2018-03-09 01:40:22 +00:00
// GetEligibleCollator is a free data retrieval call binding the contract method 0x6115a1c3.
2018-01-27 19:24:13 +00:00
//
2018-03-09 01:40:22 +00:00
// Solidity: function getEligibleCollator(_shardId int256, _period uint256) constant returns(address)
func ( _SMC * SMCSession ) GetEligibleCollator ( _shardId * big . Int , _period * big . Int ) ( common . Address , error ) {
return _SMC . Contract . GetEligibleCollator ( & _SMC . CallOpts , _shardId , _period )
2018-01-27 19:24:13 +00:00
}
2018-03-09 01:40:22 +00:00
// GetEligibleCollator is a free data retrieval call binding the contract method 0x6115a1c3.
2018-01-27 19:24:13 +00:00
//
2018-03-09 01:40:22 +00:00
// Solidity: function getEligibleCollator(_shardId int256, _period uint256) constant returns(address)
func ( _SMC * SMCCallerSession ) GetEligibleCollator ( _shardId * big . Int , _period * big . Int ) ( common . Address , error ) {
return _SMC . Contract . GetEligibleCollator ( & _SMC . CallOpts , _shardId , _period )
2018-01-27 19:24:13 +00:00
}
2018-03-09 00:04:13 +00:00
// IsCollatorDeposited is a free data retrieval call binding the contract method 0xccb180e9.
2018-02-09 09:31:39 +00:00
//
2018-03-09 00:04:13 +00:00
// Solidity: function isCollatorDeposited( address) constant returns(bool)
func ( _SMC * SMCCaller ) IsCollatorDeposited ( opts * bind . CallOpts , arg0 common . Address ) ( bool , error ) {
2018-02-09 09:31:39 +00:00
var (
ret0 = new ( bool )
)
out := ret0
2018-03-09 00:04:13 +00:00
err := _SMC . contract . Call ( opts , out , "isCollatorDeposited" , arg0 )
2018-02-09 09:31:39 +00:00
return * ret0 , err
}
2018-03-09 00:04:13 +00:00
// IsCollatorDeposited is a free data retrieval call binding the contract method 0xccb180e9.
2018-02-09 09:31:39 +00:00
//
2018-03-09 00:04:13 +00:00
// Solidity: function isCollatorDeposited( address) constant returns(bool)
func ( _SMC * SMCSession ) IsCollatorDeposited ( arg0 common . Address ) ( bool , error ) {
return _SMC . Contract . IsCollatorDeposited ( & _SMC . CallOpts , arg0 )
2018-02-09 09:31:39 +00:00
}
2018-03-09 00:04:13 +00:00
// IsCollatorDeposited is a free data retrieval call binding the contract method 0xccb180e9.
2018-02-09 09:31:39 +00:00
//
2018-03-09 00:04:13 +00:00
// Solidity: function isCollatorDeposited( address) constant returns(bool)
func ( _SMC * SMCCallerSession ) IsCollatorDeposited ( arg0 common . Address ) ( bool , error ) {
return _SMC . Contract . IsCollatorDeposited ( & _SMC . CallOpts , arg0 )
2018-02-09 09:31:39 +00:00
}
2018-03-09 00:04:13 +00:00
// NumCollators is a free data retrieval call binding the contract method 0x0908fb31.
2018-02-09 09:31:39 +00:00
//
2018-03-09 00:04:13 +00:00
// Solidity: function numCollators() constant returns(int256)
func ( _SMC * SMCCaller ) NumCollators ( opts * bind . CallOpts ) ( * big . Int , error ) {
2018-02-09 09:31:39 +00:00
var (
ret0 = new ( * big . Int )
)
out := ret0
2018-03-09 00:04:13 +00:00
err := _SMC . contract . Call ( opts , out , "numCollators" )
2018-02-09 09:31:39 +00:00
return * ret0 , err
}
2018-03-09 00:04:13 +00:00
// NumCollators is a free data retrieval call binding the contract method 0x0908fb31.
2018-02-09 09:31:39 +00:00
//
2018-03-09 00:04:13 +00:00
// Solidity: function numCollators() constant returns(int256)
func ( _SMC * SMCSession ) NumCollators ( ) ( * big . Int , error ) {
return _SMC . Contract . NumCollators ( & _SMC . CallOpts )
2018-02-09 09:31:39 +00:00
}
2018-03-09 00:04:13 +00:00
// NumCollators is a free data retrieval call binding the contract method 0x0908fb31.
2018-02-09 09:31:39 +00:00
//
2018-03-09 00:04:13 +00:00
// Solidity: function numCollators() constant returns(int256)
func ( _SMC * SMCCallerSession ) NumCollators ( ) ( * big . Int , error ) {
return _SMC . Contract . NumCollators ( & _SMC . CallOpts )
2018-02-09 09:31:39 +00:00
}
// PeriodHead is a free data retrieval call binding the contract method 0x584475db.
//
// Solidity: function periodHead( int256) constant returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCaller ) PeriodHead ( opts * bind . CallOpts , arg0 * big . Int ) ( * big . Int , error ) {
2018-02-09 09:31:39 +00:00
var (
ret0 = new ( * big . Int )
)
out := ret0
2018-03-09 00:04:13 +00:00
err := _SMC . contract . Call ( opts , out , "periodHead" , arg0 )
2018-02-09 09:31:39 +00:00
return * ret0 , err
}
// PeriodHead is a free data retrieval call binding the contract method 0x584475db.
//
// Solidity: function periodHead( int256) constant returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCSession ) PeriodHead ( arg0 * big . Int ) ( * big . Int , error ) {
return _SMC . Contract . PeriodHead ( & _SMC . CallOpts , arg0 )
2018-02-09 09:31:39 +00:00
}
// PeriodHead is a free data retrieval call binding the contract method 0x584475db.
//
// Solidity: function periodHead( int256) constant returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCallerSession ) PeriodHead ( arg0 * big . Int ) ( * big . Int , error ) {
return _SMC . Contract . PeriodHead ( & _SMC . CallOpts , arg0 )
2018-02-09 09:31:39 +00:00
}
// Receipts is a free data retrieval call binding the contract method 0xd19ca568.
//
// Solidity: function receipts( int256) constant returns(shardId int256, txStartgas uint256, txGasprice uint256, value uint256, data bytes32, sender address, to address)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCaller ) Receipts ( opts * bind . CallOpts , arg0 * big . Int ) ( struct {
2018-02-09 09:31:39 +00:00
ShardId * big . Int
TxStartgas * big . Int
TxGasprice * big . Int
Value * big . Int
Data [ 32 ] byte
Sender common . Address
To common . Address
} , error ) {
ret := new ( struct {
ShardId * big . Int
TxStartgas * big . Int
TxGasprice * big . Int
Value * big . Int
Data [ 32 ] byte
Sender common . Address
To common . Address
} )
out := ret
2018-03-09 00:04:13 +00:00
err := _SMC . contract . Call ( opts , out , "receipts" , arg0 )
2018-02-09 09:31:39 +00:00
return * ret , err
}
// Receipts is a free data retrieval call binding the contract method 0xd19ca568.
//
// Solidity: function receipts( int256) constant returns(shardId int256, txStartgas uint256, txGasprice uint256, value uint256, data bytes32, sender address, to address)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCSession ) Receipts ( arg0 * big . Int ) ( struct {
2018-02-09 09:31:39 +00:00
ShardId * big . Int
TxStartgas * big . Int
TxGasprice * big . Int
Value * big . Int
Data [ 32 ] byte
Sender common . Address
To common . Address
} , error ) {
2018-03-09 00:04:13 +00:00
return _SMC . Contract . Receipts ( & _SMC . CallOpts , arg0 )
2018-02-09 09:31:39 +00:00
}
// Receipts is a free data retrieval call binding the contract method 0xd19ca568.
//
// Solidity: function receipts( int256) constant returns(shardId int256, txStartgas uint256, txGasprice uint256, value uint256, data bytes32, sender address, to address)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCallerSession ) Receipts ( arg0 * big . Int ) ( struct {
2018-02-09 09:31:39 +00:00
ShardId * big . Int
TxStartgas * big . Int
TxGasprice * big . Int
Value * big . Int
Data [ 32 ] byte
Sender common . Address
To common . Address
} , error ) {
2018-03-09 00:04:13 +00:00
return _SMC . Contract . Receipts ( & _SMC . CallOpts , arg0 )
2018-02-09 09:31:39 +00:00
}
2018-02-07 13:06:14 +00:00
// ShardCount is a free data retrieval call binding the contract method 0x04e9c77a.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function shardCount() constant returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCaller ) ShardCount ( opts * bind . CallOpts ) ( * big . Int , error ) {
2018-01-27 19:24:13 +00:00
var (
ret0 = new ( * big . Int )
)
out := ret0
2018-03-09 00:04:13 +00:00
err := _SMC . contract . Call ( opts , out , "shardCount" )
2018-01-27 19:24:13 +00:00
return * ret0 , err
}
2018-02-07 13:06:14 +00:00
// ShardCount is a free data retrieval call binding the contract method 0x04e9c77a.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function shardCount() constant returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCSession ) ShardCount ( ) ( * big . Int , error ) {
return _SMC . Contract . ShardCount ( & _SMC . CallOpts )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// ShardCount is a free data retrieval call binding the contract method 0x04e9c77a.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function shardCount() constant returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCCallerSession ) ShardCount ( ) ( * big . Int , error ) {
return _SMC . Contract . ShardCount ( & _SMC . CallOpts )
2018-02-09 09:31:39 +00:00
}
2018-02-07 13:06:14 +00:00
// AddHeader is a paid mutator transaction binding the contract method 0x0341518d.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function addHeader(_shardId int256, _expectedPeriodNumber uint256, _periodStartPrevHash bytes32, _parentHash bytes32, _transactionRoot bytes32, _coinbase address, _stateRoot bytes32, _receiptRoot bytes32, _number int256) returns(bool)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactor ) AddHeader ( opts * bind . TransactOpts , _shardId * big . Int , _expectedPeriodNumber * big . Int , _periodStartPrevHash [ 32 ] byte , _parentHash [ 32 ] byte , _transactionRoot [ 32 ] byte , _coinbase common . Address , _stateRoot [ 32 ] byte , _receiptRoot [ 32 ] byte , _number * big . Int ) ( * types . Transaction , error ) {
return _SMC . contract . Transact ( opts , "addHeader" , _shardId , _expectedPeriodNumber , _periodStartPrevHash , _parentHash , _transactionRoot , _coinbase , _stateRoot , _receiptRoot , _number )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// AddHeader is a paid mutator transaction binding the contract method 0x0341518d.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function addHeader(_shardId int256, _expectedPeriodNumber uint256, _periodStartPrevHash bytes32, _parentHash bytes32, _transactionRoot bytes32, _coinbase address, _stateRoot bytes32, _receiptRoot bytes32, _number int256) returns(bool)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCSession ) AddHeader ( _shardId * big . Int , _expectedPeriodNumber * big . Int , _periodStartPrevHash [ 32 ] byte , _parentHash [ 32 ] byte , _transactionRoot [ 32 ] byte , _coinbase common . Address , _stateRoot [ 32 ] byte , _receiptRoot [ 32 ] byte , _number * big . Int ) ( * types . Transaction , error ) {
return _SMC . Contract . AddHeader ( & _SMC . TransactOpts , _shardId , _expectedPeriodNumber , _periodStartPrevHash , _parentHash , _transactionRoot , _coinbase , _stateRoot , _receiptRoot , _number )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// AddHeader is a paid mutator transaction binding the contract method 0x0341518d.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function addHeader(_shardId int256, _expectedPeriodNumber uint256, _periodStartPrevHash bytes32, _parentHash bytes32, _transactionRoot bytes32, _coinbase address, _stateRoot bytes32, _receiptRoot bytes32, _number int256) returns(bool)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactorSession ) AddHeader ( _shardId * big . Int , _expectedPeriodNumber * big . Int , _periodStartPrevHash [ 32 ] byte , _parentHash [ 32 ] byte , _transactionRoot [ 32 ] byte , _coinbase common . Address , _stateRoot [ 32 ] byte , _receiptRoot [ 32 ] byte , _number * big . Int ) ( * types . Transaction , error ) {
return _SMC . Contract . AddHeader ( & _SMC . TransactOpts , _shardId , _expectedPeriodNumber , _periodStartPrevHash , _parentHash , _transactionRoot , _coinbase , _stateRoot , _receiptRoot , _number )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function deposit() returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactor ) Deposit ( opts * bind . TransactOpts ) ( * types . Transaction , error ) {
return _SMC . contract . Transact ( opts , "deposit" )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function deposit() returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCSession ) Deposit ( ) ( * types . Transaction , error ) {
return _SMC . Contract . Deposit ( & _SMC . TransactOpts )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// Deposit is a paid mutator transaction binding the contract method 0xd0e30db0.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function deposit() returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactorSession ) Deposit ( ) ( * types . Transaction , error ) {
return _SMC . Contract . Deposit ( & _SMC . TransactOpts )
2018-01-27 19:24:13 +00:00
}
// TxToShard is a paid mutator transaction binding the contract method 0x372a9e2a.
//
// Solidity: function txToShard(_to address, _shardId int256, _txStartgas uint256, _txGasprice uint256, _data bytes12) returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactor ) TxToShard ( opts * bind . TransactOpts , _to common . Address , _shardId * big . Int , _txStartgas * big . Int , _txGasprice * big . Int , _data [ 12 ] byte ) ( * types . Transaction , error ) {
return _SMC . contract . Transact ( opts , "txToShard" , _to , _shardId , _txStartgas , _txGasprice , _data )
2018-01-27 19:24:13 +00:00
}
// TxToShard is a paid mutator transaction binding the contract method 0x372a9e2a.
//
// Solidity: function txToShard(_to address, _shardId int256, _txStartgas uint256, _txGasprice uint256, _data bytes12) returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCSession ) TxToShard ( _to common . Address , _shardId * big . Int , _txStartgas * big . Int , _txGasprice * big . Int , _data [ 12 ] byte ) ( * types . Transaction , error ) {
return _SMC . Contract . TxToShard ( & _SMC . TransactOpts , _to , _shardId , _txStartgas , _txGasprice , _data )
2018-01-27 19:24:13 +00:00
}
// TxToShard is a paid mutator transaction binding the contract method 0x372a9e2a.
//
// Solidity: function txToShard(_to address, _shardId int256, _txStartgas uint256, _txGasprice uint256, _data bytes12) returns(int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactorSession ) TxToShard ( _to common . Address , _shardId * big . Int , _txStartgas * big . Int , _txGasprice * big . Int , _data [ 12 ] byte ) ( * types . Transaction , error ) {
return _SMC . Contract . TxToShard ( & _SMC . TransactOpts , _to , _shardId , _txStartgas , _txGasprice , _data )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// UpdateGasPrice is a paid mutator transaction binding the contract method 0x22131389.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function updateGasPrice(_receiptId int256, _txGasprice uint256) returns(bool)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactor ) UpdateGasPrice ( opts * bind . TransactOpts , _receiptId * big . Int , _txGasprice * big . Int ) ( * types . Transaction , error ) {
return _SMC . contract . Transact ( opts , "updateGasPrice" , _receiptId , _txGasprice )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// UpdateGasPrice is a paid mutator transaction binding the contract method 0x22131389.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function updateGasPrice(_receiptId int256, _txGasprice uint256) returns(bool)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCSession ) UpdateGasPrice ( _receiptId * big . Int , _txGasprice * big . Int ) ( * types . Transaction , error ) {
return _SMC . Contract . UpdateGasPrice ( & _SMC . TransactOpts , _receiptId , _txGasprice )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// UpdateGasPrice is a paid mutator transaction binding the contract method 0x22131389.
2018-01-27 19:24:13 +00:00
//
2018-02-07 13:06:14 +00:00
// Solidity: function updateGasPrice(_receiptId int256, _txGasprice uint256) returns(bool)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCTransactorSession ) UpdateGasPrice ( _receiptId * big . Int , _txGasprice * big . Int ) ( * types . Transaction , error ) {
return _SMC . Contract . UpdateGasPrice ( & _SMC . TransactOpts , _receiptId , _txGasprice )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// Withdraw is a paid mutator transaction binding the contract method 0x7e62eab8.
2018-01-27 19:24:13 +00:00
//
2018-03-09 00:04:13 +00:00
// Solidity: function withdraw(_collatorIndex int256) returns()
func ( _SMC * SMCTransactor ) Withdraw ( opts * bind . TransactOpts , _collatorIndex * big . Int ) ( * types . Transaction , error ) {
return _SMC . contract . Transact ( opts , "withdraw" , _collatorIndex )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// Withdraw is a paid mutator transaction binding the contract method 0x7e62eab8.
2018-01-27 19:24:13 +00:00
//
2018-03-09 00:04:13 +00:00
// Solidity: function withdraw(_collatorIndex int256) returns()
func ( _SMC * SMCSession ) Withdraw ( _collatorIndex * big . Int ) ( * types . Transaction , error ) {
return _SMC . Contract . Withdraw ( & _SMC . TransactOpts , _collatorIndex )
2018-01-27 19:24:13 +00:00
}
2018-02-07 13:06:14 +00:00
// Withdraw is a paid mutator transaction binding the contract method 0x7e62eab8.
2018-01-27 19:24:13 +00:00
//
2018-03-09 00:04:13 +00:00
// Solidity: function withdraw(_collatorIndex int256) returns()
func ( _SMC * SMCTransactorSession ) Withdraw ( _collatorIndex * big . Int ) ( * types . Transaction , error ) {
return _SMC . Contract . Withdraw ( & _SMC . TransactOpts , _collatorIndex )
2018-01-27 19:24:13 +00:00
}
2018-02-07 19:57:25 +00:00
2018-03-09 00:04:13 +00:00
// SMCCollationAddedIterator is returned from FilterCollationAdded and is used to iterate over the raw logs and unpacked data for CollationAdded events raised by the SMC contract.
type SMCCollationAddedIterator struct {
Event * SMCCollationAdded // Event containing the contract specifics and raw log
2018-02-07 19:57:25 +00:00
contract * bind . BoundContract // Generic contract to use for unpacking event data
event string // Event name to use for unpacking event data
logs chan types . Log // Log channel receiving the found contract events
sub ethereum . Subscription // Subscription for errors, completion and termination
done bool // Whether the subscription completed delivering logs
fail error // Occurred error to stop iteration
}
// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
2018-03-09 00:04:13 +00:00
func ( it * SMCCollationAddedIterator ) Next ( ) bool {
2018-02-07 19:57:25 +00:00
// If the iterator failed, stop iterating
if it . fail != nil {
return false
}
// If the iterator completed, deliver directly whatever's available
if it . done {
select {
case log := <- it . logs :
2018-03-09 00:04:13 +00:00
it . Event = new ( SMCCollationAdded )
2018-02-07 19:57:25 +00:00
if err := it . contract . UnpackLog ( it . Event , it . event , log ) ; err != nil {
it . fail = err
return false
}
it . Event . Raw = log
return true
default :
return false
}
}
// Iterator still in progress, wait for either a data or an error event
select {
case log := <- it . logs :
2018-03-09 00:04:13 +00:00
it . Event = new ( SMCCollationAdded )
2018-02-07 19:57:25 +00:00
if err := it . contract . UnpackLog ( it . Event , it . event , log ) ; err != nil {
it . fail = err
return false
}
it . Event . Raw = log
return true
case err := <- it . sub . Err ( ) :
it . done = true
it . fail = err
return it . Next ( )
}
}
// Error returns any retrieval or parsing error occurred during filtering.
2018-03-09 00:04:13 +00:00
func ( it * SMCCollationAddedIterator ) Error ( ) error {
2018-02-07 19:57:25 +00:00
return it . fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
2018-03-09 00:04:13 +00:00
func ( it * SMCCollationAddedIterator ) Close ( ) error {
2018-02-07 19:57:25 +00:00
it . sub . Unsubscribe ( )
return nil
}
2018-03-09 00:04:13 +00:00
// SMCCollationAdded represents a CollationAdded event raised by the SMC contract.
type SMCCollationAdded struct {
2018-02-07 19:57:25 +00:00
ShardId * big . Int
ExpectedPeriodNumber * big . Int
PeriodStartPrevHash [ 32 ] byte
ParentHash [ 32 ] byte
TransactionRoot [ 32 ] byte
Coinbase common . Address
StateRoot [ 32 ] byte
ReceiptRoot [ 32 ] byte
Number * big . Int
IsNewHead bool
Score * big . Int
Raw types . Log // Blockchain specific contextual infos
}
// FilterCollationAdded is a free log retrieval operation binding the contract event 0x788a01fdbeb989d24e706cdd2993ca4213400e7b5fa631819b2acfe8ebad4135.
//
// Solidity: event CollationAdded(shardId indexed int256, expectedPeriodNumber uint256, periodStartPrevHash bytes32, parentHash bytes32, transactionRoot bytes32, coinbase address, stateRoot bytes32, receiptRoot bytes32, number int256, isNewHead bool, score int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCFilterer ) FilterCollationAdded ( opts * bind . FilterOpts , shardId [ ] * big . Int ) ( * SMCCollationAddedIterator , error ) {
2018-02-07 19:57:25 +00:00
var shardIdRule [ ] interface { }
for _ , shardIdItem := range shardId {
shardIdRule = append ( shardIdRule , shardIdItem )
}
2018-03-09 00:04:13 +00:00
logs , sub , err := _SMC . contract . FilterLogs ( opts , "CollationAdded" , shardIdRule )
2018-02-07 19:57:25 +00:00
if err != nil {
return nil , err
}
2018-03-09 00:04:13 +00:00
return & SMCCollationAddedIterator { contract : _SMC . contract , event : "CollationAdded" , logs : logs , sub : sub } , nil
2018-02-07 19:57:25 +00:00
}
// WatchCollationAdded is a free log subscription operation binding the contract event 0x788a01fdbeb989d24e706cdd2993ca4213400e7b5fa631819b2acfe8ebad4135.
//
// Solidity: event CollationAdded(shardId indexed int256, expectedPeriodNumber uint256, periodStartPrevHash bytes32, parentHash bytes32, transactionRoot bytes32, coinbase address, stateRoot bytes32, receiptRoot bytes32, number int256, isNewHead bool, score int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCFilterer ) WatchCollationAdded ( opts * bind . WatchOpts , sink chan <- * SMCCollationAdded , shardId [ ] * big . Int ) ( event . Subscription , error ) {
2018-02-07 19:57:25 +00:00
var shardIdRule [ ] interface { }
for _ , shardIdItem := range shardId {
shardIdRule = append ( shardIdRule , shardIdItem )
}
2018-03-09 00:04:13 +00:00
logs , sub , err := _SMC . contract . WatchLogs ( opts , "CollationAdded" , shardIdRule )
2018-02-07 19:57:25 +00:00
if err != nil {
return nil , err
}
return event . NewSubscription ( func ( quit <- chan struct { } ) error {
defer sub . Unsubscribe ( )
for {
select {
case log := <- logs :
// New log arrived, parse the event and forward to the user
2018-03-09 00:04:13 +00:00
event := new ( SMCCollationAdded )
if err := _SMC . contract . UnpackLog ( event , "CollationAdded" , log ) ; err != nil {
2018-02-07 19:57:25 +00:00
return err
}
event . Raw = log
select {
case sink <- event :
case err := <- sub . Err ( ) :
return err
case <- quit :
return nil
}
case err := <- sub . Err ( ) :
return err
case <- quit :
return nil
}
}
} ) , nil
}
2018-03-09 00:04:13 +00:00
// SMCDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the SMC contract.
type SMCDepositIterator struct {
Event * SMCDeposit // Event containing the contract specifics and raw log
2018-02-07 19:57:25 +00:00
contract * bind . BoundContract // Generic contract to use for unpacking event data
event string // Event name to use for unpacking event data
logs chan types . Log // Log channel receiving the found contract events
sub ethereum . Subscription // Subscription for errors, completion and termination
done bool // Whether the subscription completed delivering logs
fail error // Occurred error to stop iteration
}
// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
2018-03-09 00:04:13 +00:00
func ( it * SMCDepositIterator ) Next ( ) bool {
2018-02-07 19:57:25 +00:00
// If the iterator failed, stop iterating
if it . fail != nil {
return false
}
// If the iterator completed, deliver directly whatever's available
if it . done {
select {
case log := <- it . logs :
2018-03-09 00:04:13 +00:00
it . Event = new ( SMCDeposit )
2018-02-07 19:57:25 +00:00
if err := it . contract . UnpackLog ( it . Event , it . event , log ) ; err != nil {
it . fail = err
return false
}
it . Event . Raw = log
return true
default :
return false
}
}
// Iterator still in progress, wait for either a data or an error event
select {
case log := <- it . logs :
2018-03-09 00:04:13 +00:00
it . Event = new ( SMCDeposit )
2018-02-07 19:57:25 +00:00
if err := it . contract . UnpackLog ( it . Event , it . event , log ) ; err != nil {
it . fail = err
return false
}
it . Event . Raw = log
return true
case err := <- it . sub . Err ( ) :
it . done = true
it . fail = err
return it . Next ( )
}
}
// Error returns any retrieval or parsing error occurred during filtering.
2018-03-09 00:04:13 +00:00
func ( it * SMCDepositIterator ) Error ( ) error {
2018-02-07 19:57:25 +00:00
return it . fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
2018-03-09 00:04:13 +00:00
func ( it * SMCDepositIterator ) Close ( ) error {
2018-02-07 19:57:25 +00:00
it . sub . Unsubscribe ( )
return nil
}
2018-03-09 00:04:13 +00:00
// SMCDeposit represents a Deposit event raised by the SMC contract.
type SMCDeposit struct {
Collator common . Address
Index * big . Int
Raw types . Log // Blockchain specific contextual infos
2018-02-07 19:57:25 +00:00
}
// FilterDeposit is a free log retrieval operation binding the contract event 0xd8a6d38df847dcba70dfdeb4948fb1457d61a81d132801f40dc9c00d52dfd478.
//
2018-03-09 00:04:13 +00:00
// Solidity: event Deposit(collator address, index int256)
func ( _SMC * SMCFilterer ) FilterDeposit ( opts * bind . FilterOpts ) ( * SMCDepositIterator , error ) {
2018-02-07 19:57:25 +00:00
2018-03-09 00:04:13 +00:00
logs , sub , err := _SMC . contract . FilterLogs ( opts , "Deposit" )
2018-02-07 19:57:25 +00:00
if err != nil {
return nil , err
}
2018-03-09 00:04:13 +00:00
return & SMCDepositIterator { contract : _SMC . contract , event : "Deposit" , logs : logs , sub : sub } , nil
2018-02-07 19:57:25 +00:00
}
// WatchDeposit is a free log subscription operation binding the contract event 0xd8a6d38df847dcba70dfdeb4948fb1457d61a81d132801f40dc9c00d52dfd478.
//
2018-03-09 00:04:13 +00:00
// Solidity: event Deposit(collator address, index int256)
func ( _SMC * SMCFilterer ) WatchDeposit ( opts * bind . WatchOpts , sink chan <- * SMCDeposit ) ( event . Subscription , error ) {
2018-02-07 19:57:25 +00:00
2018-03-09 00:04:13 +00:00
logs , sub , err := _SMC . contract . WatchLogs ( opts , "Deposit" )
2018-02-07 19:57:25 +00:00
if err != nil {
return nil , err
}
return event . NewSubscription ( func ( quit <- chan struct { } ) error {
defer sub . Unsubscribe ( )
for {
select {
case log := <- logs :
// New log arrived, parse the event and forward to the user
2018-03-09 00:04:13 +00:00
event := new ( SMCDeposit )
if err := _SMC . contract . UnpackLog ( event , "Deposit" , log ) ; err != nil {
2018-02-07 19:57:25 +00:00
return err
}
event . Raw = log
select {
case sink <- event :
case err := <- sub . Err ( ) :
return err
case <- quit :
return nil
}
case err := <- sub . Err ( ) :
return err
case <- quit :
return nil
}
}
} ) , nil
}
2018-03-09 00:04:13 +00:00
// SMCTxToShardIterator is returned from FilterTxToShard and is used to iterate over the raw logs and unpacked data for TxToShard events raised by the SMC contract.
type SMCTxToShardIterator struct {
Event * SMCTxToShard // Event containing the contract specifics and raw log
2018-02-07 19:57:25 +00:00
contract * bind . BoundContract // Generic contract to use for unpacking event data
event string // Event name to use for unpacking event data
logs chan types . Log // Log channel receiving the found contract events
sub ethereum . Subscription // Subscription for errors, completion and termination
done bool // Whether the subscription completed delivering logs
fail error // Occurred error to stop iteration
}
// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
2018-03-09 00:04:13 +00:00
func ( it * SMCTxToShardIterator ) Next ( ) bool {
2018-02-07 19:57:25 +00:00
// If the iterator failed, stop iterating
if it . fail != nil {
return false
}
// If the iterator completed, deliver directly whatever's available
if it . done {
select {
case log := <- it . logs :
2018-03-09 00:04:13 +00:00
it . Event = new ( SMCTxToShard )
2018-02-07 19:57:25 +00:00
if err := it . contract . UnpackLog ( it . Event , it . event , log ) ; err != nil {
it . fail = err
return false
}
it . Event . Raw = log
return true
default :
return false
}
}
// Iterator still in progress, wait for either a data or an error event
select {
case log := <- it . logs :
2018-03-09 00:04:13 +00:00
it . Event = new ( SMCTxToShard )
2018-02-07 19:57:25 +00:00
if err := it . contract . UnpackLog ( it . Event , it . event , log ) ; err != nil {
it . fail = err
return false
}
it . Event . Raw = log
return true
case err := <- it . sub . Err ( ) :
it . done = true
it . fail = err
return it . Next ( )
}
}
// Error returns any retrieval or parsing error occurred during filtering.
2018-03-09 00:04:13 +00:00
func ( it * SMCTxToShardIterator ) Error ( ) error {
2018-02-07 19:57:25 +00:00
return it . fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
2018-03-09 00:04:13 +00:00
func ( it * SMCTxToShardIterator ) Close ( ) error {
2018-02-07 19:57:25 +00:00
it . sub . Unsubscribe ( )
return nil
}
2018-03-09 00:04:13 +00:00
// SMCTxToShard represents a TxToShard event raised by the SMC contract.
type SMCTxToShard struct {
2018-02-07 19:57:25 +00:00
To common . Address
ShardId * big . Int
ReceiptId * big . Int
Raw types . Log // Blockchain specific contextual infos
}
// FilterTxToShard is a free log retrieval operation binding the contract event 0xfc322e0c42ee41e0d74b940ceeee9cd5971acdd6ace8ff8010ee7134c31d9ea5.
//
// Solidity: event TxToShard(to indexed address, shardId indexed int256, receiptId int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCFilterer ) FilterTxToShard ( opts * bind . FilterOpts , to [ ] common . Address , shardId [ ] * big . Int ) ( * SMCTxToShardIterator , error ) {
2018-02-07 19:57:25 +00:00
var toRule [ ] interface { }
for _ , toItem := range to {
toRule = append ( toRule , toItem )
}
var shardIdRule [ ] interface { }
for _ , shardIdItem := range shardId {
shardIdRule = append ( shardIdRule , shardIdItem )
}
2018-03-09 00:04:13 +00:00
logs , sub , err := _SMC . contract . FilterLogs ( opts , "TxToShard" , toRule , shardIdRule )
2018-02-07 19:57:25 +00:00
if err != nil {
return nil , err
}
2018-03-09 00:04:13 +00:00
return & SMCTxToShardIterator { contract : _SMC . contract , event : "TxToShard" , logs : logs , sub : sub } , nil
2018-02-07 19:57:25 +00:00
}
// WatchTxToShard is a free log subscription operation binding the contract event 0xfc322e0c42ee41e0d74b940ceeee9cd5971acdd6ace8ff8010ee7134c31d9ea5.
//
// Solidity: event TxToShard(to indexed address, shardId indexed int256, receiptId int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCFilterer ) WatchTxToShard ( opts * bind . WatchOpts , sink chan <- * SMCTxToShard , to [ ] common . Address , shardId [ ] * big . Int ) ( event . Subscription , error ) {
2018-02-07 19:57:25 +00:00
var toRule [ ] interface { }
for _ , toItem := range to {
toRule = append ( toRule , toItem )
}
var shardIdRule [ ] interface { }
for _ , shardIdItem := range shardId {
shardIdRule = append ( shardIdRule , shardIdItem )
}
2018-03-09 00:04:13 +00:00
logs , sub , err := _SMC . contract . WatchLogs ( opts , "TxToShard" , toRule , shardIdRule )
2018-02-07 19:57:25 +00:00
if err != nil {
return nil , err
}
return event . NewSubscription ( func ( quit <- chan struct { } ) error {
defer sub . Unsubscribe ( )
for {
select {
case log := <- logs :
// New log arrived, parse the event and forward to the user
2018-03-09 00:04:13 +00:00
event := new ( SMCTxToShard )
if err := _SMC . contract . UnpackLog ( event , "TxToShard" , log ) ; err != nil {
2018-02-07 19:57:25 +00:00
return err
}
event . Raw = log
select {
case sink <- event :
case err := <- sub . Err ( ) :
return err
case <- quit :
return nil
}
case err := <- sub . Err ( ) :
return err
case <- quit :
return nil
}
}
} ) , nil
}
2018-03-09 00:04:13 +00:00
// SMCWithdrawIterator is returned from FilterWithdraw and is used to iterate over the raw logs and unpacked data for Withdraw events raised by the SMC contract.
type SMCWithdrawIterator struct {
Event * SMCWithdraw // Event containing the contract specifics and raw log
2018-02-07 19:57:25 +00:00
contract * bind . BoundContract // Generic contract to use for unpacking event data
event string // Event name to use for unpacking event data
logs chan types . Log // Log channel receiving the found contract events
sub ethereum . Subscription // Subscription for errors, completion and termination
done bool // Whether the subscription completed delivering logs
fail error // Occurred error to stop iteration
}
// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
2018-03-09 00:04:13 +00:00
func ( it * SMCWithdrawIterator ) Next ( ) bool {
2018-02-07 19:57:25 +00:00
// If the iterator failed, stop iterating
if it . fail != nil {
return false
}
// If the iterator completed, deliver directly whatever's available
if it . done {
select {
case log := <- it . logs :
2018-03-09 00:04:13 +00:00
it . Event = new ( SMCWithdraw )
2018-02-07 19:57:25 +00:00
if err := it . contract . UnpackLog ( it . Event , it . event , log ) ; err != nil {
it . fail = err
return false
}
it . Event . Raw = log
return true
default :
return false
}
}
// Iterator still in progress, wait for either a data or an error event
select {
case log := <- it . logs :
2018-03-09 00:04:13 +00:00
it . Event = new ( SMCWithdraw )
2018-02-07 19:57:25 +00:00
if err := it . contract . UnpackLog ( it . Event , it . event , log ) ; err != nil {
it . fail = err
return false
}
it . Event . Raw = log
return true
case err := <- it . sub . Err ( ) :
it . done = true
it . fail = err
return it . Next ( )
}
}
// Error returns any retrieval or parsing error occurred during filtering.
2018-03-09 00:04:13 +00:00
func ( it * SMCWithdrawIterator ) Error ( ) error {
2018-02-07 19:57:25 +00:00
return it . fail
}
// Close terminates the iteration process, releasing any pending underlying
// resources.
2018-03-09 00:04:13 +00:00
func ( it * SMCWithdrawIterator ) Close ( ) error {
2018-02-07 19:57:25 +00:00
it . sub . Unsubscribe ( )
return nil
}
2018-03-09 00:04:13 +00:00
// SMCWithdraw represents a Withdraw event raised by the SMC contract.
type SMCWithdraw struct {
2018-02-09 09:31:39 +00:00
Index * big . Int
Raw types . Log // Blockchain specific contextual infos
2018-02-07 19:57:25 +00:00
}
// FilterWithdraw is a free log retrieval operation binding the contract event 0xe13f360aa18d414ccdb598da6c447faa89d0477ffc7549dab5678fca76910b8c.
//
2018-02-09 09:31:39 +00:00
// Solidity: event Withdraw(index int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCFilterer ) FilterWithdraw ( opts * bind . FilterOpts ) ( * SMCWithdrawIterator , error ) {
2018-02-07 19:57:25 +00:00
2018-03-09 00:04:13 +00:00
logs , sub , err := _SMC . contract . FilterLogs ( opts , "Withdraw" )
2018-02-07 19:57:25 +00:00
if err != nil {
return nil , err
}
2018-03-09 00:04:13 +00:00
return & SMCWithdrawIterator { contract : _SMC . contract , event : "Withdraw" , logs : logs , sub : sub } , nil
2018-02-07 19:57:25 +00:00
}
// WatchWithdraw is a free log subscription operation binding the contract event 0xe13f360aa18d414ccdb598da6c447faa89d0477ffc7549dab5678fca76910b8c.
//
2018-02-09 09:31:39 +00:00
// Solidity: event Withdraw(index int256)
2018-03-09 00:04:13 +00:00
func ( _SMC * SMCFilterer ) WatchWithdraw ( opts * bind . WatchOpts , sink chan <- * SMCWithdraw ) ( event . Subscription , error ) {
2018-02-07 19:57:25 +00:00
2018-03-09 00:04:13 +00:00
logs , sub , err := _SMC . contract . WatchLogs ( opts , "Withdraw" )
2018-02-07 19:57:25 +00:00
if err != nil {
return nil , err
}
return event . NewSubscription ( func ( quit <- chan struct { } ) error {
defer sub . Unsubscribe ( )
for {
select {
case log := <- logs :
// New log arrived, parse the event and forward to the user
2018-03-09 00:04:13 +00:00
event := new ( SMCWithdraw )
if err := _SMC . contract . UnpackLog ( event , "Withdraw" , log ) ; err != nil {
2018-02-07 19:57:25 +00:00
return err
}
event . Raw = log
select {
case sink <- event :
case err := <- sub . Err ( ) :
return err
case <- quit :
return nil
}
case err := <- sub . Err ( ) :
return err
case <- quit :
return nil
}
}
} ) , nil
}