statechannels

package
v0.0.0-...-b547f01 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const BoardHandlerABI = "" /* 8153-byte string literal not displayed */

BoardHandlerABI is the input ABI used to generate the binding from.

View Source
const EthBoardsABI = "" /* 2075-byte string literal not displayed */

EthBoardsABI is the input ABI used to generate the binding from.

Variables

This section is empty.

Functions

func GameExist

func GameExist(
	ethClient *ethclient.Client,
	boardId uint64,
	gameId uint64,
) (bool, error)

Verify if a specific game exist TODO: Check if the game is finished

func GameValues

func GameValues(
	ethClient *ethclient.Client,
	boardId uint64,
	gameId uint64,
) (string, string, [121]uint8, error)

Get the two players and the initial state of the game

func GetTurnSignatureAddress

func GetTurnSignatureAddress(
	ethClient *ethclient.Client,
	nonce [3]uint64,
	state [121]uint8,
	move [4]uint8,
	r [32]uint8,
	s [32]uint8,
	v uint8,
) (*common.Address, error)

func LastBlock

func LastBlock(ethClient *ethclient.Client) (*big.Int, error)

func NewEthClient

func NewEthClient(url string) (*ethclient.Client, error)

func PerformMove

func PerformMove(
	ethClient *ethclient.Client,
	boardId uint64,
	gameId uint64,
	player uint8,
	move [4]uint8,
	state [121]uint8,
) ([121]uint8, error)

Simulate a move aand get the new state

Types

type BoardHandler

type BoardHandler struct {
	BoardHandlerCaller     // Read-only binding to the contract
	BoardHandlerTransactor // Write-only binding to the contract
	BoardHandlerFilterer   // Log filterer for contract events
}

BoardHandler is an auto generated Go binding around an Ethereum contract.

func NewBoardHandler

func NewBoardHandler(address common.Address, backend bind.ContractBackend) (*BoardHandler, error)

NewBoardHandler creates a new instance of BoardHandler, bound to a specific deployed contract.

type BoardHandlerBoardCreated

type BoardHandlerBoardCreated struct {
	Creator common.Address
	BoardId *big.Int
	Name    string
	Raw     types.Log // Blockchain specific contextual infos
}

BoardHandlerBoardCreated represents a BoardCreated event raised by the BoardHandler contract.

type BoardHandlerBoardCreatedIterator

type BoardHandlerBoardCreatedIterator struct {
	Event *BoardHandlerBoardCreated // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

BoardHandlerBoardCreatedIterator is returned from FilterBoardCreated and is used to iterate over the raw logs and unpacked data for BoardCreated events raised by the BoardHandler contract.

func (*BoardHandlerBoardCreatedIterator) Close

Close terminates the iteration process, releasing any pending underlying resources.

func (*BoardHandlerBoardCreatedIterator) Error

Error returns any retrieval or parsing error occurred during filtering.

func (*BoardHandlerBoardCreatedIterator) Next

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.

type BoardHandlerCaller

type BoardHandlerCaller struct {
	// contains filtered or unexported fields
}

BoardHandlerCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewBoardHandlerCaller

func NewBoardHandlerCaller(address common.Address, caller bind.ContractCaller) (*BoardHandlerCaller, error)

NewBoardHandlerCaller creates a new read-only instance of BoardHandler, bound to a specific deployed contract.

func (*BoardHandlerCaller) GetBoardContractAddress

func (_BoardHandler *BoardHandlerCaller) GetBoardContractAddress(opts *bind.CallOpts, boardId *big.Int) (common.Address, error)

GetBoardContractAddress is a free data retrieval call binding the contract method 0xf881add2.

Solidity: function getBoardContractAddress(uint256 boardId) view returns(address)

func (*BoardHandlerCaller) GetBoardNumber

func (_BoardHandler *BoardHandlerCaller) GetBoardNumber(opts *bind.CallOpts) (*big.Int, error)

GetBoardNumber is a free data retrieval call binding the contract method 0x16796dee.

Solidity: function getBoardNumber() view returns(uint256)

func (*BoardHandlerCaller) GetBoardPawnNumber

func (_BoardHandler *BoardHandlerCaller) GetBoardPawnNumber(opts *bind.CallOpts, boardId *big.Int) (uint8, error)

GetBoardPawnNumber is a free data retrieval call binding the contract method 0x5cbecfc4.

Solidity: function getBoardPawnNumber(uint256 boardId) view returns(uint8)

func (*BoardHandlerCaller) GetBoardPawnTypeContract

func (_BoardHandler *BoardHandlerCaller) GetBoardPawnTypeContract(opts *bind.CallOpts, boardId *big.Int, pawnType uint8) (common.Address, error)

GetBoardPawnTypeContract is a free data retrieval call binding the contract method 0x56a112c7.

Solidity: function getBoardPawnTypeContract(uint256 boardId, uint8 pawnType) view returns(address)

func (*BoardHandlerCaller) GetBoardPawnTypeContractFromPawnIndex

func (_BoardHandler *BoardHandlerCaller) GetBoardPawnTypeContractFromPawnIndex(opts *bind.CallOpts, boardId *big.Int, pawnIndex uint8) (common.Address, error)

GetBoardPawnTypeContractFromPawnIndex is a free data retrieval call binding the contract method 0x65577aa4.

Solidity: function getBoardPawnTypeContractFromPawnIndex(uint256 boardId, uint8 pawnIndex) view returns(address)

func (*BoardHandlerCaller) GetBoardPawnTypeNumber

func (_BoardHandler *BoardHandlerCaller) GetBoardPawnTypeNumber(opts *bind.CallOpts, boardId *big.Int) (uint8, error)

GetBoardPawnTypeNumber is a free data retrieval call binding the contract method 0xfd9c102d.

Solidity: function getBoardPawnTypeNumber(uint256 boardId) view returns(uint8)

func (*BoardHandlerCaller) GetGameNumber

func (_BoardHandler *BoardHandlerCaller) GetGameNumber(opts *bind.CallOpts, boardId *big.Int) (*big.Int, error)

GetGameNumber is a free data retrieval call binding the contract method 0x9439060f.

Solidity: function getGameNumber(uint256 boardId) view returns(uint256)

func (*BoardHandlerCaller) GetGamePlayerAddress

func (_BoardHandler *BoardHandlerCaller) GetGamePlayerAddress(opts *bind.CallOpts, boardId *big.Int, gameId *big.Int, turnNumber *big.Int) (common.Address, error)

GetGamePlayerAddress is a free data retrieval call binding the contract method 0x72e57afd.

Solidity: function getGamePlayerAddress(uint256 boardId, uint256 gameId, uint256 turnNumber) view returns(address)

func (*BoardHandlerCaller) GetGamePlayerIndex

func (_BoardHandler *BoardHandlerCaller) GetGamePlayerIndex(opts *bind.CallOpts, boardId *big.Int, gameId *big.Int, playerAddress common.Address) (*big.Int, error)

GetGamePlayerIndex is a free data retrieval call binding the contract method 0x65d377a9.

Solidity: function getGamePlayerIndex(uint256 boardId, uint256 gameId, address playerAddress) view returns(int256)

func (*BoardHandlerCaller) GetInitialState

func (_BoardHandler *BoardHandlerCaller) GetInitialState(opts *bind.CallOpts, boardId *big.Int) ([121]uint8, error)

GetInitialState is a free data retrieval call binding the contract method 0x140604cc.

Solidity: function getInitialState(uint256 boardId) view returns(uint8[121] state)

func (*BoardHandlerCaller) IsDeployed

func (_BoardHandler *BoardHandlerCaller) IsDeployed(opts *bind.CallOpts, boardId *big.Int) (bool, error)

IsDeployed is a free data retrieval call binding the contract method 0xe3336f2b.

Solidity: function isDeployed(uint256 boardId) view returns(bool)

func (*BoardHandlerCaller) IsGameOver

func (_BoardHandler *BoardHandlerCaller) IsGameOver(opts *bind.CallOpts, boardId *big.Int, gameId *big.Int) (bool, error)

IsGameOver is a free data retrieval call binding the contract method 0xfe2be323.

Solidity: function isGameOver(uint256 boardId, uint256 gameId) view returns(bool)

func (*BoardHandlerCaller) IsWaitingPlayer

func (_BoardHandler *BoardHandlerCaller) IsWaitingPlayer(opts *bind.CallOpts, boardId *big.Int) (struct {
	IsWaiting     bool
	WaitingPlayer common.Address
}, error)

IsWaitingPlayer is a free data retrieval call binding the contract method 0x08c4a77e.

Solidity: function isWaitingPlayer(uint256 boardId) view returns(bool isWaiting, address waitingPlayer)

type BoardHandlerCallerRaw

type BoardHandlerCallerRaw struct {
	Contract *BoardHandlerCaller // Generic read-only contract binding to access the raw methods on
}

BoardHandlerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*BoardHandlerCallerRaw) Call

func (_BoardHandler *BoardHandlerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

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.

type BoardHandlerCallerSession

type BoardHandlerCallerSession struct {
	Contract *BoardHandlerCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts       // Call options to use throughout this session
}

BoardHandlerCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*BoardHandlerCallerSession) GetBoardContractAddress

func (_BoardHandler *BoardHandlerCallerSession) GetBoardContractAddress(boardId *big.Int) (common.Address, error)

GetBoardContractAddress is a free data retrieval call binding the contract method 0xf881add2.

Solidity: function getBoardContractAddress(uint256 boardId) view returns(address)

func (*BoardHandlerCallerSession) GetBoardNumber

func (_BoardHandler *BoardHandlerCallerSession) GetBoardNumber() (*big.Int, error)

GetBoardNumber is a free data retrieval call binding the contract method 0x16796dee.

Solidity: function getBoardNumber() view returns(uint256)

func (*BoardHandlerCallerSession) GetBoardPawnNumber

func (_BoardHandler *BoardHandlerCallerSession) GetBoardPawnNumber(boardId *big.Int) (uint8, error)

GetBoardPawnNumber is a free data retrieval call binding the contract method 0x5cbecfc4.

Solidity: function getBoardPawnNumber(uint256 boardId) view returns(uint8)

func (*BoardHandlerCallerSession) GetBoardPawnTypeContract

func (_BoardHandler *BoardHandlerCallerSession) GetBoardPawnTypeContract(boardId *big.Int, pawnType uint8) (common.Address, error)

GetBoardPawnTypeContract is a free data retrieval call binding the contract method 0x56a112c7.

Solidity: function getBoardPawnTypeContract(uint256 boardId, uint8 pawnType) view returns(address)

func (*BoardHandlerCallerSession) GetBoardPawnTypeContractFromPawnIndex

func (_BoardHandler *BoardHandlerCallerSession) GetBoardPawnTypeContractFromPawnIndex(boardId *big.Int, pawnIndex uint8) (common.Address, error)

GetBoardPawnTypeContractFromPawnIndex is a free data retrieval call binding the contract method 0x65577aa4.

Solidity: function getBoardPawnTypeContractFromPawnIndex(uint256 boardId, uint8 pawnIndex) view returns(address)

func (*BoardHandlerCallerSession) GetBoardPawnTypeNumber

func (_BoardHandler *BoardHandlerCallerSession) GetBoardPawnTypeNumber(boardId *big.Int) (uint8, error)

GetBoardPawnTypeNumber is a free data retrieval call binding the contract method 0xfd9c102d.

Solidity: function getBoardPawnTypeNumber(uint256 boardId) view returns(uint8)

func (*BoardHandlerCallerSession) GetGameNumber

func (_BoardHandler *BoardHandlerCallerSession) GetGameNumber(boardId *big.Int) (*big.Int, error)

GetGameNumber is a free data retrieval call binding the contract method 0x9439060f.

Solidity: function getGameNumber(uint256 boardId) view returns(uint256)

func (*BoardHandlerCallerSession) GetGamePlayerAddress

func (_BoardHandler *BoardHandlerCallerSession) GetGamePlayerAddress(boardId *big.Int, gameId *big.Int, turnNumber *big.Int) (common.Address, error)

GetGamePlayerAddress is a free data retrieval call binding the contract method 0x72e57afd.

Solidity: function getGamePlayerAddress(uint256 boardId, uint256 gameId, uint256 turnNumber) view returns(address)

func (*BoardHandlerCallerSession) GetGamePlayerIndex

func (_BoardHandler *BoardHandlerCallerSession) GetGamePlayerIndex(boardId *big.Int, gameId *big.Int, playerAddress common.Address) (*big.Int, error)

GetGamePlayerIndex is a free data retrieval call binding the contract method 0x65d377a9.

Solidity: function getGamePlayerIndex(uint256 boardId, uint256 gameId, address playerAddress) view returns(int256)

func (*BoardHandlerCallerSession) GetInitialState

func (_BoardHandler *BoardHandlerCallerSession) GetInitialState(boardId *big.Int) ([121]uint8, error)

GetInitialState is a free data retrieval call binding the contract method 0x140604cc.

Solidity: function getInitialState(uint256 boardId) view returns(uint8[121] state)

func (*BoardHandlerCallerSession) IsDeployed

func (_BoardHandler *BoardHandlerCallerSession) IsDeployed(boardId *big.Int) (bool, error)

IsDeployed is a free data retrieval call binding the contract method 0xe3336f2b.

Solidity: function isDeployed(uint256 boardId) view returns(bool)

func (*BoardHandlerCallerSession) IsGameOver

func (_BoardHandler *BoardHandlerCallerSession) IsGameOver(boardId *big.Int, gameId *big.Int) (bool, error)

IsGameOver is a free data retrieval call binding the contract method 0xfe2be323.

Solidity: function isGameOver(uint256 boardId, uint256 gameId) view returns(bool)

func (*BoardHandlerCallerSession) IsWaitingPlayer

func (_BoardHandler *BoardHandlerCallerSession) IsWaitingPlayer(boardId *big.Int) (struct {
	IsWaiting     bool
	WaitingPlayer common.Address
}, error)

IsWaitingPlayer is a free data retrieval call binding the contract method 0x08c4a77e.

Solidity: function isWaitingPlayer(uint256 boardId) view returns(bool isWaiting, address waitingPlayer)

type BoardHandlerFilterer

type BoardHandlerFilterer struct {
	// contains filtered or unexported fields
}

BoardHandlerFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewBoardHandlerFilterer

func NewBoardHandlerFilterer(address common.Address, filterer bind.ContractFilterer) (*BoardHandlerFilterer, error)

NewBoardHandlerFilterer creates a new log filterer instance of BoardHandler, bound to a specific deployed contract.

func (*BoardHandlerFilterer) FilterBoardCreated

func (_BoardHandler *BoardHandlerFilterer) FilterBoardCreated(opts *bind.FilterOpts, creator []common.Address, boardId []*big.Int) (*BoardHandlerBoardCreatedIterator, error)

FilterBoardCreated is a free log retrieval operation binding the contract event 0xe820c892428a1b85fdf99f24e32fbe1165413ebb7119bde5dfa6cb72334f7580.

Solidity: event BoardCreated(address indexed creator, uint256 indexed boardId, string name)

func (*BoardHandlerFilterer) FilterGameFinished

func (_BoardHandler *BoardHandlerFilterer) FilterGameFinished(opts *bind.FilterOpts, playerA []common.Address, playerB []common.Address) (*BoardHandlerGameFinishedIterator, error)

FilterGameFinished is a free log retrieval operation binding the contract event 0x0ffff200143c07c471e3d4bd1972a1b601d278491708eef4ec7cf9e921fda192.

Solidity: event GameFinished(address indexed playerA, address indexed playerB, address winner, uint256 boardId, uint256 gameId)

func (*BoardHandlerFilterer) FilterGameStarted

func (_BoardHandler *BoardHandlerFilterer) FilterGameStarted(opts *bind.FilterOpts, playerA []common.Address, playerB []common.Address, boardId []*big.Int) (*BoardHandlerGameStartedIterator, error)

FilterGameStarted is a free log retrieval operation binding the contract event 0x89e651d0d1f877f5c444ff351a9449c3b36bbc92b470093d9fc085b1bbd1e3bc.

Solidity: event GameStarted(address indexed playerA, address indexed playerB, uint256 indexed boardId, uint256 gameId)

func (*BoardHandlerFilterer) FilterPawnTypeAdded

func (_BoardHandler *BoardHandlerFilterer) FilterPawnTypeAdded(opts *bind.FilterOpts, boardId []*big.Int) (*BoardHandlerPawnTypeAddedIterator, error)

FilterPawnTypeAdded is a free log retrieval operation binding the contract event 0x7a341913bd407cbdd72b8c3f62dfc23385bcb7f37bb7cc42280c3b7d21d64ea6.

Solidity: event PawnTypeAdded(uint256 indexed boardId, address pawnTypeContract)

func (*BoardHandlerFilterer) ParseBoardCreated

func (_BoardHandler *BoardHandlerFilterer) ParseBoardCreated(log types.Log) (*BoardHandlerBoardCreated, error)

ParseBoardCreated is a log parse operation binding the contract event 0xe820c892428a1b85fdf99f24e32fbe1165413ebb7119bde5dfa6cb72334f7580.

Solidity: event BoardCreated(address indexed creator, uint256 indexed boardId, string name)

func (*BoardHandlerFilterer) ParseGameFinished

func (_BoardHandler *BoardHandlerFilterer) ParseGameFinished(log types.Log) (*BoardHandlerGameFinished, error)

ParseGameFinished is a log parse operation binding the contract event 0x0ffff200143c07c471e3d4bd1972a1b601d278491708eef4ec7cf9e921fda192.

Solidity: event GameFinished(address indexed playerA, address indexed playerB, address winner, uint256 boardId, uint256 gameId)

func (*BoardHandlerFilterer) ParseGameStarted

func (_BoardHandler *BoardHandlerFilterer) ParseGameStarted(log types.Log) (*BoardHandlerGameStarted, error)

ParseGameStarted is a log parse operation binding the contract event 0x89e651d0d1f877f5c444ff351a9449c3b36bbc92b470093d9fc085b1bbd1e3bc.

Solidity: event GameStarted(address indexed playerA, address indexed playerB, uint256 indexed boardId, uint256 gameId)

func (*BoardHandlerFilterer) ParsePawnTypeAdded

func (_BoardHandler *BoardHandlerFilterer) ParsePawnTypeAdded(log types.Log) (*BoardHandlerPawnTypeAdded, error)

ParsePawnTypeAdded is a log parse operation binding the contract event 0x7a341913bd407cbdd72b8c3f62dfc23385bcb7f37bb7cc42280c3b7d21d64ea6.

Solidity: event PawnTypeAdded(uint256 indexed boardId, address pawnTypeContract)

func (*BoardHandlerFilterer) WatchBoardCreated

func (_BoardHandler *BoardHandlerFilterer) WatchBoardCreated(opts *bind.WatchOpts, sink chan<- *BoardHandlerBoardCreated, creator []common.Address, boardId []*big.Int) (event.Subscription, error)

WatchBoardCreated is a free log subscription operation binding the contract event 0xe820c892428a1b85fdf99f24e32fbe1165413ebb7119bde5dfa6cb72334f7580.

Solidity: event BoardCreated(address indexed creator, uint256 indexed boardId, string name)

func (*BoardHandlerFilterer) WatchGameFinished

func (_BoardHandler *BoardHandlerFilterer) WatchGameFinished(opts *bind.WatchOpts, sink chan<- *BoardHandlerGameFinished, playerA []common.Address, playerB []common.Address) (event.Subscription, error)

WatchGameFinished is a free log subscription operation binding the contract event 0x0ffff200143c07c471e3d4bd1972a1b601d278491708eef4ec7cf9e921fda192.

Solidity: event GameFinished(address indexed playerA, address indexed playerB, address winner, uint256 boardId, uint256 gameId)

func (*BoardHandlerFilterer) WatchGameStarted

func (_BoardHandler *BoardHandlerFilterer) WatchGameStarted(opts *bind.WatchOpts, sink chan<- *BoardHandlerGameStarted, playerA []common.Address, playerB []common.Address, boardId []*big.Int) (event.Subscription, error)

WatchGameStarted is a free log subscription operation binding the contract event 0x89e651d0d1f877f5c444ff351a9449c3b36bbc92b470093d9fc085b1bbd1e3bc.

Solidity: event GameStarted(address indexed playerA, address indexed playerB, uint256 indexed boardId, uint256 gameId)

func (*BoardHandlerFilterer) WatchPawnTypeAdded

func (_BoardHandler *BoardHandlerFilterer) WatchPawnTypeAdded(opts *bind.WatchOpts, sink chan<- *BoardHandlerPawnTypeAdded, boardId []*big.Int) (event.Subscription, error)

WatchPawnTypeAdded is a free log subscription operation binding the contract event 0x7a341913bd407cbdd72b8c3f62dfc23385bcb7f37bb7cc42280c3b7d21d64ea6.

Solidity: event PawnTypeAdded(uint256 indexed boardId, address pawnTypeContract)

type BoardHandlerGameFinished

type BoardHandlerGameFinished struct {
	PlayerA common.Address
	PlayerB common.Address
	Winner  common.Address
	BoardId *big.Int
	GameId  *big.Int
	Raw     types.Log // Blockchain specific contextual infos
}

BoardHandlerGameFinished represents a GameFinished event raised by the BoardHandler contract.

type BoardHandlerGameFinishedIterator

type BoardHandlerGameFinishedIterator struct {
	Event *BoardHandlerGameFinished // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

BoardHandlerGameFinishedIterator is returned from FilterGameFinished and is used to iterate over the raw logs and unpacked data for GameFinished events raised by the BoardHandler contract.

func (*BoardHandlerGameFinishedIterator) Close

Close terminates the iteration process, releasing any pending underlying resources.

func (*BoardHandlerGameFinishedIterator) Error

Error returns any retrieval or parsing error occurred during filtering.

func (*BoardHandlerGameFinishedIterator) Next

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.

type BoardHandlerGameStarted

type BoardHandlerGameStarted struct {
	PlayerA common.Address
	PlayerB common.Address
	BoardId *big.Int
	GameId  *big.Int
	Raw     types.Log // Blockchain specific contextual infos
}

BoardHandlerGameStarted represents a GameStarted event raised by the BoardHandler contract.

type BoardHandlerGameStartedIterator

type BoardHandlerGameStartedIterator struct {
	Event *BoardHandlerGameStarted // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

BoardHandlerGameStartedIterator is returned from FilterGameStarted and is used to iterate over the raw logs and unpacked data for GameStarted events raised by the BoardHandler contract.

func (*BoardHandlerGameStartedIterator) Close

Close terminates the iteration process, releasing any pending underlying resources.

func (*BoardHandlerGameStartedIterator) Error

Error returns any retrieval or parsing error occurred during filtering.

func (*BoardHandlerGameStartedIterator) Next

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.

type BoardHandlerPawnTypeAdded

type BoardHandlerPawnTypeAdded struct {
	BoardId          *big.Int
	PawnTypeContract common.Address
	Raw              types.Log // Blockchain specific contextual infos
}

BoardHandlerPawnTypeAdded represents a PawnTypeAdded event raised by the BoardHandler contract.

type BoardHandlerPawnTypeAddedIterator

type BoardHandlerPawnTypeAddedIterator struct {
	Event *BoardHandlerPawnTypeAdded // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

BoardHandlerPawnTypeAddedIterator is returned from FilterPawnTypeAdded and is used to iterate over the raw logs and unpacked data for PawnTypeAdded events raised by the BoardHandler contract.

func (*BoardHandlerPawnTypeAddedIterator) Close

Close terminates the iteration process, releasing any pending underlying resources.

func (*BoardHandlerPawnTypeAddedIterator) Error

Error returns any retrieval or parsing error occurred during filtering.

func (*BoardHandlerPawnTypeAddedIterator) Next

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.

type BoardHandlerRaw

type BoardHandlerRaw struct {
	Contract *BoardHandler // Generic contract binding to access the raw methods on
}

BoardHandlerRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*BoardHandlerRaw) Call

func (_BoardHandler *BoardHandlerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

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 (*BoardHandlerRaw) Transact

func (_BoardHandler *BoardHandlerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*BoardHandlerRaw) Transfer

func (_BoardHandler *BoardHandlerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type BoardHandlerSession

type BoardHandlerSession struct {
	Contract     *BoardHandler     // 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
}

BoardHandlerSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*BoardHandlerSession) AddPawnTypeToBoard

func (_BoardHandler *BoardHandlerSession) AddPawnTypeToBoard(boardId *big.Int, pawnTypeAddress common.Address) (*types.Transaction, error)

AddPawnTypeToBoard is a paid mutator transaction binding the contract method 0x8412ad80.

Solidity: function addPawnTypeToBoard(uint256 boardId, address pawnTypeAddress) returns()

func (*BoardHandlerSession) AddPawnsToBoard

func (_BoardHandler *BoardHandlerSession) AddPawnsToBoard(boardId *big.Int, x [10]uint8, y [10]uint8, pawnType [10]uint8, nbPawn uint8) (*types.Transaction, error)

AddPawnsToBoard is a paid mutator transaction binding the contract method 0x014820d1.

Solidity: function addPawnsToBoard(uint256 boardId, uint8[10] x, uint8[10] y, uint8[10] pawnType, uint8 nbPawn) returns()

func (*BoardHandlerSession) CreateBoard

func (_BoardHandler *BoardHandlerSession) CreateBoard(name string, boardContract common.Address) (*types.Transaction, error)

CreateBoard is a paid mutator transaction binding the contract method 0x75f6ccd3.

Solidity: function createBoard(string name, address boardContract) returns()

func (*BoardHandlerSession) DeployBoard

func (_BoardHandler *BoardHandlerSession) DeployBoard(boardId *big.Int) (*types.Transaction, error)

DeployBoard is a paid mutator transaction binding the contract method 0x47dadc15.

Solidity: function deployBoard(uint256 boardId) returns()

func (*BoardHandlerSession) FinishGame

func (_BoardHandler *BoardHandlerSession) FinishGame(boardId *big.Int, gameId *big.Int, winner uint8) (*types.Transaction, error)

FinishGame is a paid mutator transaction binding the contract method 0x4d79b758.

Solidity: function finishGame(uint256 boardId, uint256 gameId, uint8 winner) returns()

func (*BoardHandlerSession) GetBoardContractAddress

func (_BoardHandler *BoardHandlerSession) GetBoardContractAddress(boardId *big.Int) (common.Address, error)

GetBoardContractAddress is a free data retrieval call binding the contract method 0xf881add2.

Solidity: function getBoardContractAddress(uint256 boardId) view returns(address)

func (*BoardHandlerSession) GetBoardNumber

func (_BoardHandler *BoardHandlerSession) GetBoardNumber() (*big.Int, error)

GetBoardNumber is a free data retrieval call binding the contract method 0x16796dee.

Solidity: function getBoardNumber() view returns(uint256)

func (*BoardHandlerSession) GetBoardPawnNumber

func (_BoardHandler *BoardHandlerSession) GetBoardPawnNumber(boardId *big.Int) (uint8, error)

GetBoardPawnNumber is a free data retrieval call binding the contract method 0x5cbecfc4.

Solidity: function getBoardPawnNumber(uint256 boardId) view returns(uint8)

func (*BoardHandlerSession) GetBoardPawnTypeContract

func (_BoardHandler *BoardHandlerSession) GetBoardPawnTypeContract(boardId *big.Int, pawnType uint8) (common.Address, error)

GetBoardPawnTypeContract is a free data retrieval call binding the contract method 0x56a112c7.

Solidity: function getBoardPawnTypeContract(uint256 boardId, uint8 pawnType) view returns(address)

func (*BoardHandlerSession) GetBoardPawnTypeContractFromPawnIndex

func (_BoardHandler *BoardHandlerSession) GetBoardPawnTypeContractFromPawnIndex(boardId *big.Int, pawnIndex uint8) (common.Address, error)

GetBoardPawnTypeContractFromPawnIndex is a free data retrieval call binding the contract method 0x65577aa4.

Solidity: function getBoardPawnTypeContractFromPawnIndex(uint256 boardId, uint8 pawnIndex) view returns(address)

func (*BoardHandlerSession) GetBoardPawnTypeNumber

func (_BoardHandler *BoardHandlerSession) GetBoardPawnTypeNumber(boardId *big.Int) (uint8, error)

GetBoardPawnTypeNumber is a free data retrieval call binding the contract method 0xfd9c102d.

Solidity: function getBoardPawnTypeNumber(uint256 boardId) view returns(uint8)

func (*BoardHandlerSession) GetGameNumber

func (_BoardHandler *BoardHandlerSession) GetGameNumber(boardId *big.Int) (*big.Int, error)

GetGameNumber is a free data retrieval call binding the contract method 0x9439060f.

Solidity: function getGameNumber(uint256 boardId) view returns(uint256)

func (*BoardHandlerSession) GetGamePlayerAddress

func (_BoardHandler *BoardHandlerSession) GetGamePlayerAddress(boardId *big.Int, gameId *big.Int, turnNumber *big.Int) (common.Address, error)

GetGamePlayerAddress is a free data retrieval call binding the contract method 0x72e57afd.

Solidity: function getGamePlayerAddress(uint256 boardId, uint256 gameId, uint256 turnNumber) view returns(address)

func (*BoardHandlerSession) GetGamePlayerIndex

func (_BoardHandler *BoardHandlerSession) GetGamePlayerIndex(boardId *big.Int, gameId *big.Int, playerAddress common.Address) (*big.Int, error)

GetGamePlayerIndex is a free data retrieval call binding the contract method 0x65d377a9.

Solidity: function getGamePlayerIndex(uint256 boardId, uint256 gameId, address playerAddress) view returns(int256)

func (*BoardHandlerSession) GetInitialState

func (_BoardHandler *BoardHandlerSession) GetInitialState(boardId *big.Int) ([121]uint8, error)

GetInitialState is a free data retrieval call binding the contract method 0x140604cc.

Solidity: function getInitialState(uint256 boardId) view returns(uint8[121] state)

func (*BoardHandlerSession) IsDeployed

func (_BoardHandler *BoardHandlerSession) IsDeployed(boardId *big.Int) (bool, error)

IsDeployed is a free data retrieval call binding the contract method 0xe3336f2b.

Solidity: function isDeployed(uint256 boardId) view returns(bool)

func (*BoardHandlerSession) IsGameOver

func (_BoardHandler *BoardHandlerSession) IsGameOver(boardId *big.Int, gameId *big.Int) (bool, error)

IsGameOver is a free data retrieval call binding the contract method 0xfe2be323.

Solidity: function isGameOver(uint256 boardId, uint256 gameId) view returns(bool)

func (*BoardHandlerSession) IsWaitingPlayer

func (_BoardHandler *BoardHandlerSession) IsWaitingPlayer(boardId *big.Int) (struct {
	IsWaiting     bool
	WaitingPlayer common.Address
}, error)

IsWaitingPlayer is a free data retrieval call binding the contract method 0x08c4a77e.

Solidity: function isWaitingPlayer(uint256 boardId) view returns(bool isWaiting, address waitingPlayer)

func (*BoardHandlerSession) JoinGame

func (_BoardHandler *BoardHandlerSession) JoinGame(boardId *big.Int) (*types.Transaction, error)

JoinGame is a paid mutator transaction binding the contract method 0xefaa55a0.

Solidity: function joinGame(uint256 boardId) returns()

func (*BoardHandlerSession) ResetBoard

func (_BoardHandler *BoardHandlerSession) ResetBoard(boardId *big.Int) (*types.Transaction, error)

ResetBoard is a paid mutator transaction binding the contract method 0xc6be19d7.

Solidity: function resetBoard(uint256 boardId) returns()

type BoardHandlerTransactor

type BoardHandlerTransactor struct {
	// contains filtered or unexported fields
}

BoardHandlerTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewBoardHandlerTransactor

func NewBoardHandlerTransactor(address common.Address, transactor bind.ContractTransactor) (*BoardHandlerTransactor, error)

NewBoardHandlerTransactor creates a new write-only instance of BoardHandler, bound to a specific deployed contract.

func (*BoardHandlerTransactor) AddPawnTypeToBoard

func (_BoardHandler *BoardHandlerTransactor) AddPawnTypeToBoard(opts *bind.TransactOpts, boardId *big.Int, pawnTypeAddress common.Address) (*types.Transaction, error)

AddPawnTypeToBoard is a paid mutator transaction binding the contract method 0x8412ad80.

Solidity: function addPawnTypeToBoard(uint256 boardId, address pawnTypeAddress) returns()

func (*BoardHandlerTransactor) AddPawnsToBoard

func (_BoardHandler *BoardHandlerTransactor) AddPawnsToBoard(opts *bind.TransactOpts, boardId *big.Int, x [10]uint8, y [10]uint8, pawnType [10]uint8, nbPawn uint8) (*types.Transaction, error)

AddPawnsToBoard is a paid mutator transaction binding the contract method 0x014820d1.

Solidity: function addPawnsToBoard(uint256 boardId, uint8[10] x, uint8[10] y, uint8[10] pawnType, uint8 nbPawn) returns()

func (*BoardHandlerTransactor) CreateBoard

func (_BoardHandler *BoardHandlerTransactor) CreateBoard(opts *bind.TransactOpts, name string, boardContract common.Address) (*types.Transaction, error)

CreateBoard is a paid mutator transaction binding the contract method 0x75f6ccd3.

Solidity: function createBoard(string name, address boardContract) returns()

func (*BoardHandlerTransactor) DeployBoard

func (_BoardHandler *BoardHandlerTransactor) DeployBoard(opts *bind.TransactOpts, boardId *big.Int) (*types.Transaction, error)

DeployBoard is a paid mutator transaction binding the contract method 0x47dadc15.

Solidity: function deployBoard(uint256 boardId) returns()

func (*BoardHandlerTransactor) FinishGame

func (_BoardHandler *BoardHandlerTransactor) FinishGame(opts *bind.TransactOpts, boardId *big.Int, gameId *big.Int, winner uint8) (*types.Transaction, error)

FinishGame is a paid mutator transaction binding the contract method 0x4d79b758.

Solidity: function finishGame(uint256 boardId, uint256 gameId, uint8 winner) returns()

func (*BoardHandlerTransactor) JoinGame

func (_BoardHandler *BoardHandlerTransactor) JoinGame(opts *bind.TransactOpts, boardId *big.Int) (*types.Transaction, error)

JoinGame is a paid mutator transaction binding the contract method 0xefaa55a0.

Solidity: function joinGame(uint256 boardId) returns()

func (*BoardHandlerTransactor) ResetBoard

func (_BoardHandler *BoardHandlerTransactor) ResetBoard(opts *bind.TransactOpts, boardId *big.Int) (*types.Transaction, error)

ResetBoard is a paid mutator transaction binding the contract method 0xc6be19d7.

Solidity: function resetBoard(uint256 boardId) returns()

type BoardHandlerTransactorRaw

type BoardHandlerTransactorRaw struct {
	Contract *BoardHandlerTransactor // Generic write-only contract binding to access the raw methods on
}

BoardHandlerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*BoardHandlerTransactorRaw) Transact

func (_BoardHandler *BoardHandlerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*BoardHandlerTransactorRaw) Transfer

func (_BoardHandler *BoardHandlerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type BoardHandlerTransactorSession

type BoardHandlerTransactorSession struct {
	Contract     *BoardHandlerTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts       // Transaction auth options to use throughout this session
}

BoardHandlerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*BoardHandlerTransactorSession) AddPawnTypeToBoard

func (_BoardHandler *BoardHandlerTransactorSession) AddPawnTypeToBoard(boardId *big.Int, pawnTypeAddress common.Address) (*types.Transaction, error)

AddPawnTypeToBoard is a paid mutator transaction binding the contract method 0x8412ad80.

Solidity: function addPawnTypeToBoard(uint256 boardId, address pawnTypeAddress) returns()

func (*BoardHandlerTransactorSession) AddPawnsToBoard

func (_BoardHandler *BoardHandlerTransactorSession) AddPawnsToBoard(boardId *big.Int, x [10]uint8, y [10]uint8, pawnType [10]uint8, nbPawn uint8) (*types.Transaction, error)

AddPawnsToBoard is a paid mutator transaction binding the contract method 0x014820d1.

Solidity: function addPawnsToBoard(uint256 boardId, uint8[10] x, uint8[10] y, uint8[10] pawnType, uint8 nbPawn) returns()

func (*BoardHandlerTransactorSession) CreateBoard

func (_BoardHandler *BoardHandlerTransactorSession) CreateBoard(name string, boardContract common.Address) (*types.Transaction, error)

CreateBoard is a paid mutator transaction binding the contract method 0x75f6ccd3.

Solidity: function createBoard(string name, address boardContract) returns()

func (*BoardHandlerTransactorSession) DeployBoard

func (_BoardHandler *BoardHandlerTransactorSession) DeployBoard(boardId *big.Int) (*types.Transaction, error)

DeployBoard is a paid mutator transaction binding the contract method 0x47dadc15.

Solidity: function deployBoard(uint256 boardId) returns()

func (*BoardHandlerTransactorSession) FinishGame

func (_BoardHandler *BoardHandlerTransactorSession) FinishGame(boardId *big.Int, gameId *big.Int, winner uint8) (*types.Transaction, error)

FinishGame is a paid mutator transaction binding the contract method 0x4d79b758.

Solidity: function finishGame(uint256 boardId, uint256 gameId, uint8 winner) returns()

func (*BoardHandlerTransactorSession) JoinGame

func (_BoardHandler *BoardHandlerTransactorSession) JoinGame(boardId *big.Int) (*types.Transaction, error)

JoinGame is a paid mutator transaction binding the contract method 0xefaa55a0.

Solidity: function joinGame(uint256 boardId) returns()

func (*BoardHandlerTransactorSession) ResetBoard

func (_BoardHandler *BoardHandlerTransactorSession) ResetBoard(boardId *big.Int) (*types.Transaction, error)

ResetBoard is a paid mutator transaction binding the contract method 0xc6be19d7.

Solidity: function resetBoard(uint256 boardId) returns()

type EthBoards

type EthBoards struct {
	EthBoardsCaller     // Read-only binding to the contract
	EthBoardsTransactor // Write-only binding to the contract
	EthBoardsFilterer   // Log filterer for contract events
}

EthBoards is an auto generated Go binding around an Ethereum contract.

func NewEthBoards

func NewEthBoards(address common.Address, backend bind.ContractBackend) (*EthBoards, error)

NewEthBoards creates a new instance of EthBoards, bound to a specific deployed contract.

type EthBoardsCaller

type EthBoardsCaller struct {
	// contains filtered or unexported fields
}

EthBoardsCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewEthBoardsCaller

func NewEthBoardsCaller(address common.Address, caller bind.ContractCaller) (*EthBoardsCaller, error)

NewEthBoardsCaller creates a new read-only instance of EthBoards, bound to a specific deployed contract.

func (*EthBoardsCaller) GetTurnSignatureAddress

func (_EthBoards *EthBoardsCaller) GetTurnSignatureAddress(opts *bind.CallOpts, state [121]uint8, nonce [3]*big.Int, move [4]uint8, r [32]byte, s [32]byte, v uint8) (common.Address, error)

GetTurnSignatureAddress is a free data retrieval call binding the contract method 0xead5e463.

Solidity: function getTurnSignatureAddress(uint8[121] state, uint256[3] nonce, uint8[4] move, bytes32 r, bytes32 s, uint8 v) pure returns(address recovered)

func (*EthBoardsCaller) Simulate

func (_EthBoards *EthBoardsCaller) Simulate(opts *bind.CallOpts, boardHandlerAddress common.Address, boardId *big.Int, player uint8, move [4]uint8, state [121]uint8) ([121]uint8, error)

Simulate is a free data retrieval call binding the contract method 0xe3e490d4.

Solidity: function simulate(address boardHandlerAddress, uint256 boardId, uint8 player, uint8[4] move, uint8[121] state) view returns(uint8[121])

type EthBoardsCallerRaw

type EthBoardsCallerRaw struct {
	Contract *EthBoardsCaller // Generic read-only contract binding to access the raw methods on
}

EthBoardsCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*EthBoardsCallerRaw) Call

func (_EthBoards *EthBoardsCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

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.

type EthBoardsCallerSession

type EthBoardsCallerSession struct {
	Contract *EthBoardsCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts    // Call options to use throughout this session
}

EthBoardsCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*EthBoardsCallerSession) GetTurnSignatureAddress

func (_EthBoards *EthBoardsCallerSession) GetTurnSignatureAddress(state [121]uint8, nonce [3]*big.Int, move [4]uint8, r [32]byte, s [32]byte, v uint8) (common.Address, error)

GetTurnSignatureAddress is a free data retrieval call binding the contract method 0xead5e463.

Solidity: function getTurnSignatureAddress(uint8[121] state, uint256[3] nonce, uint8[4] move, bytes32 r, bytes32 s, uint8 v) pure returns(address recovered)

func (*EthBoardsCallerSession) Simulate

func (_EthBoards *EthBoardsCallerSession) Simulate(boardHandlerAddress common.Address, boardId *big.Int, player uint8, move [4]uint8, state [121]uint8) ([121]uint8, error)

Simulate is a free data retrieval call binding the contract method 0xe3e490d4.

Solidity: function simulate(address boardHandlerAddress, uint256 boardId, uint8 player, uint8[4] move, uint8[121] state) view returns(uint8[121])

type EthBoardsFilterer

type EthBoardsFilterer struct {
	// contains filtered or unexported fields
}

EthBoardsFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewEthBoardsFilterer

func NewEthBoardsFilterer(address common.Address, filterer bind.ContractFilterer) (*EthBoardsFilterer, error)

NewEthBoardsFilterer creates a new log filterer instance of EthBoards, bound to a specific deployed contract.

type EthBoardsRaw

type EthBoardsRaw struct {
	Contract *EthBoards // Generic contract binding to access the raw methods on
}

EthBoardsRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*EthBoardsRaw) Call

func (_EthBoards *EthBoardsRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

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 (*EthBoardsRaw) Transact

func (_EthBoards *EthBoardsRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*EthBoardsRaw) Transfer

func (_EthBoards *EthBoardsRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type EthBoardsSession

type EthBoardsSession struct {
	Contract     *EthBoards        // 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
}

EthBoardsSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*EthBoardsSession) ClaimVictory

func (_EthBoards *EthBoardsSession) ClaimVictory(boardHandlerAddress common.Address, boardId *big.Int, gameId *big.Int, initialTurnNumber *big.Int, move [2][4]uint8, r [2][32]byte, s [2][32]byte, v [2]uint8, inputState [121]uint8) (*types.Transaction, error)

ClaimVictory is a paid mutator transaction binding the contract method 0x65a91aca.

Solidity: function claimVictory(address boardHandlerAddress, uint256 boardId, uint256 gameId, uint256 initialTurnNumber, uint8[4][2] move, bytes32[2] r, bytes32[2] s, uint8[2] v, uint8[121] inputState) returns()

func (*EthBoardsSession) GetTurnSignatureAddress

func (_EthBoards *EthBoardsSession) GetTurnSignatureAddress(state [121]uint8, nonce [3]*big.Int, move [4]uint8, r [32]byte, s [32]byte, v uint8) (common.Address, error)

GetTurnSignatureAddress is a free data retrieval call binding the contract method 0xead5e463.

Solidity: function getTurnSignatureAddress(uint8[121] state, uint256[3] nonce, uint8[4] move, bytes32 r, bytes32 s, uint8 v) pure returns(address recovered)

func (*EthBoardsSession) Simulate

func (_EthBoards *EthBoardsSession) Simulate(boardHandlerAddress common.Address, boardId *big.Int, player uint8, move [4]uint8, state [121]uint8) ([121]uint8, error)

Simulate is a free data retrieval call binding the contract method 0xe3e490d4.

Solidity: function simulate(address boardHandlerAddress, uint256 boardId, uint8 player, uint8[4] move, uint8[121] state) view returns(uint8[121])

type EthBoardsTransactor

type EthBoardsTransactor struct {
	// contains filtered or unexported fields
}

EthBoardsTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewEthBoardsTransactor

func NewEthBoardsTransactor(address common.Address, transactor bind.ContractTransactor) (*EthBoardsTransactor, error)

NewEthBoardsTransactor creates a new write-only instance of EthBoards, bound to a specific deployed contract.

func (*EthBoardsTransactor) ClaimVictory

func (_EthBoards *EthBoardsTransactor) ClaimVictory(opts *bind.TransactOpts, boardHandlerAddress common.Address, boardId *big.Int, gameId *big.Int, initialTurnNumber *big.Int, move [2][4]uint8, r [2][32]byte, s [2][32]byte, v [2]uint8, inputState [121]uint8) (*types.Transaction, error)

ClaimVictory is a paid mutator transaction binding the contract method 0x65a91aca.

Solidity: function claimVictory(address boardHandlerAddress, uint256 boardId, uint256 gameId, uint256 initialTurnNumber, uint8[4][2] move, bytes32[2] r, bytes32[2] s, uint8[2] v, uint8[121] inputState) returns()

type EthBoardsTransactorRaw

type EthBoardsTransactorRaw struct {
	Contract *EthBoardsTransactor // Generic write-only contract binding to access the raw methods on
}

EthBoardsTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*EthBoardsTransactorRaw) Transact

func (_EthBoards *EthBoardsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*EthBoardsTransactorRaw) Transfer

func (_EthBoards *EthBoardsTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type EthBoardsTransactorSession

type EthBoardsTransactorSession struct {
	Contract     *EthBoardsTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts    // Transaction auth options to use throughout this session
}

EthBoardsTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*EthBoardsTransactorSession) ClaimVictory

func (_EthBoards *EthBoardsTransactorSession) ClaimVictory(boardHandlerAddress common.Address, boardId *big.Int, gameId *big.Int, initialTurnNumber *big.Int, move [2][4]uint8, r [2][32]byte, s [2][32]byte, v [2]uint8, inputState [121]uint8) (*types.Transaction, error)

ClaimVictory is a paid mutator transaction binding the contract method 0x65a91aca.

Solidity: function claimVictory(address boardHandlerAddress, uint256 boardId, uint256 gameId, uint256 initialTurnNumber, uint8[4][2] move, bytes32[2] r, bytes32[2] s, uint8[2] v, uint8[121] inputState) returns()

type StateChannel

type StateChannel struct {
	BoardId   uint64
	GameId    uint64
	PlayerA   string
	PlayerB   string
	StateList [][121]uint8
	MoveList  [][4]uint8
	R         [][32]uint8
	S         [][32]uint8
	V         []uint
}

func NewStateChannel

func NewStateChannel(
	boardId uint64,
	gameId uint64,
	playerA string,
	playerB string,
	initialState [121]uint8,
) StateChannel

type StateChannelConnection

type StateChannelConnection struct {
	Client    *mongo.Client
	EthClient *ethclient.Client
}

func NewMongoConnection

func NewMongoConnection(
	ethUrl string,
) (*StateChannelConnection, error)

func (*StateChannelConnection) AppendMove

func (conn *StateChannelConnection) AppendMove(
	boardId uint64,
	gameId uint64,
	move [4]uint8,
	r [32]uint8,
	s [32]uint8,
	v uint8,
) ([121]uint8, uint64, error)

func (*StateChannelConnection) CloseConnection

func (conn *StateChannelConnection) CloseConnection() error

func (*StateChannelConnection) CurrentState

func (conn *StateChannelConnection) CurrentState(
	boardId uint64,
	gameId uint64,
) ([121]uint8, error)

func (*StateChannelConnection) GetStateChannel

func (conn *StateChannelConnection) GetStateChannel(
	boardId uint64,
	gameId uint64,
) (*StateChannel, error)

func (*StateChannelConnection) LatestStateSignature

func (conn *StateChannelConnection) LatestStateSignature(
	boardId uint64,
	gameId uint64,
) (*StateSignature, error)

TODO: Verify integrity of data (if turn is 4 there are 4 signatures, etc...)

func (*StateChannelConnection) StateChannelCount

func (conn *StateChannelConnection) StateChannelCount() (int, error)

func (*StateChannelConnection) TurnCount

func (conn *StateChannelConnection) TurnCount(
	boardId uint64,
	gameId uint64,
) (uint64, error)

func (*StateChannelConnection) VerifySignature

func (conn *StateChannelConnection) VerifySignature(
	boardId uint64,
	gameId uint64,
	move [4]uint8,
	r [32]uint8,
	s [32]uint8,
	v uint8,
) (bool, error)

type StateSignature

type StateSignature struct {
	Turn       uint64       `json:"turn,string"`
	InputState [121]uint8   `json:"state,string"`
	Move       [2][4]uint8  `json:"move,string"`
	R          [2][32]uint8 `json:"r,string"`
	S          [2][32]uint8 `json:"s,string"`
	V          [2]uint8     `json:"v,string"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL