Best Ginkgo code snippet using internal.Bytes
rolluputils.go
Source:rolluputils.go
...43 Balance *big.Int44 Nonce *big.Int45}46// RolluputilsABI is the input ABI used to generate the binding from.47const RolluputilsABI = "[{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"pubkey\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.PDALeaf\",\"name\":\"_PDA_Leaf\",\"type\":\"tuple\"}],\"name\":\"PDALeafToHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"ID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"structTypes.UserAccount\",\"name\":\"original_account\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"new_balance\",\"type\":\"uint256\"}],\"name\":\"UpdateBalanceInAccount\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"ID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"structTypes.UserAccount\",\"name\":\"updated_account\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"ID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"structTypes.UserAccount\",\"name\":\"account\",\"type\":\"tuple\"}],\"name\":\"BalanceFromAccount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"accountBytes\",\"type\":\"bytes\"}],\"name\":\"AccountFromBytes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"ID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"structTypes.UserAccount\",\"name\":\"account\",\"type\":\"tuple\"}],\"name\":\"BytesFromAccount\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"}],\"name\":\"BytesFromAccountDeconstructed\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"}],\"name\":\"getAccountHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"ID\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"structTypes.UserAccount\",\"name\":\"account\",\"type\":\"tuple\"}],\"name\":\"HashFromAccount\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fromIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"txType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.Transaction\",\"name\":\"_tx\",\"type\":\"tuple\"}],\"name\":\"CompressTx\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"txBytes\",\"type\":\"bytes\"}],\"name\":\"DecompressTx\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"from\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"to\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"sig\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sig\",\"type\":\"bytes\"}],\"name\":\"CompressTxWithMessage\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"txBytes\",\"type\":\"bytes\"}],\"name\":\"TxFromBytesDeconstructed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"from\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"to\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"txType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"txBytes\",\"type\":\"bytes\"}],\"name\":\"TxFromBytes\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fromIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"txType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.Transaction\",\"name\":\"\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fromIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"txType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.Transaction\",\"name\":\"_tx\",\"type\":\"tuple\"}],\"name\":\"BytesFromTx\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"from\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"to\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"txType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BytesFromTxDeconstructed\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fromIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"txType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"structTypes.Transaction\",\"name\":\"_tx\",\"type\":\"tuple\"}],\"name\":\"HashFromTx\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"fromIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"toIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tokenType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"txType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"getTxSignBytes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"pub\",\"type\":\"bytes\"}],\"name\":\"calculateAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"GetGenesisLeaves\",\"outputs\":[{\"internalType\":\"bytes32[2]\",\"name\":\"leaves\",\"type\":\"bytes32[2]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"GetGenesisDataBlocks\",\"outputs\":[{\"internalType\":\"bytes[2]\",\"name\":\"dataBlocks\",\"type\":\"bytes[2]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]"48// Rolluputils is an auto generated Go binding around an Ethereum contract.49type Rolluputils struct {50 RolluputilsCaller // Read-only binding to the contract51 RolluputilsTransactor // Write-only binding to the contract52 RolluputilsFilterer // Log filterer for contract events53}54// RolluputilsCaller is an auto generated read-only Go binding around an Ethereum contract.55type RolluputilsCaller struct {56 contract *bind.BoundContract // Generic contract wrapper for the low level calls57}58// RolluputilsTransactor is an auto generated write-only Go binding around an Ethereum contract.59type RolluputilsTransactor struct {60 contract *bind.BoundContract // Generic contract wrapper for the low level calls61}62// RolluputilsFilterer is an auto generated log filtering Go binding around an Ethereum contract events.63type RolluputilsFilterer struct {64 contract *bind.BoundContract // Generic contract wrapper for the low level calls65}66// RolluputilsSession is an auto generated Go binding around an Ethereum contract,67// with pre-set call and transact options.68type RolluputilsSession struct {69 Contract *Rolluputils // Generic contract binding to set the session for70 CallOpts bind.CallOpts // Call options to use throughout this session71 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session72}73// RolluputilsCallerSession is an auto generated read-only Go binding around an Ethereum contract,74// with pre-set call options.75type RolluputilsCallerSession struct {76 Contract *RolluputilsCaller // Generic contract caller binding to set the session for77 CallOpts bind.CallOpts // Call options to use throughout this session78}79// RolluputilsTransactorSession is an auto generated write-only Go binding around an Ethereum contract,80// with pre-set transact options.81type RolluputilsTransactorSession struct {82 Contract *RolluputilsTransactor // Generic contract transactor binding to set the session for83 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session84}85// RolluputilsRaw is an auto generated low-level Go binding around an Ethereum contract.86type RolluputilsRaw struct {87 Contract *Rolluputils // Generic contract binding to access the raw methods on88}89// RolluputilsCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.90type RolluputilsCallerRaw struct {91 Contract *RolluputilsCaller // Generic read-only contract binding to access the raw methods on92}93// RolluputilsTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.94type RolluputilsTransactorRaw struct {95 Contract *RolluputilsTransactor // Generic write-only contract binding to access the raw methods on96}97// NewRolluputils creates a new instance of Rolluputils, bound to a specific deployed contract.98func NewRolluputils(address common.Address, backend bind.ContractBackend) (*Rolluputils, error) {99 contract, err := bindRolluputils(address, backend, backend, backend)100 if err != nil {101 return nil, err102 }103 return &Rolluputils{RolluputilsCaller: RolluputilsCaller{contract: contract}, RolluputilsTransactor: RolluputilsTransactor{contract: contract}, RolluputilsFilterer: RolluputilsFilterer{contract: contract}}, nil104}105// NewRolluputilsCaller creates a new read-only instance of Rolluputils, bound to a specific deployed contract.106func NewRolluputilsCaller(address common.Address, caller bind.ContractCaller) (*RolluputilsCaller, error) {107 contract, err := bindRolluputils(address, caller, nil, nil)108 if err != nil {109 return nil, err110 }111 return &RolluputilsCaller{contract: contract}, nil112}113// NewRolluputilsTransactor creates a new write-only instance of Rolluputils, bound to a specific deployed contract.114func NewRolluputilsTransactor(address common.Address, transactor bind.ContractTransactor) (*RolluputilsTransactor, error) {115 contract, err := bindRolluputils(address, nil, transactor, nil)116 if err != nil {117 return nil, err118 }119 return &RolluputilsTransactor{contract: contract}, nil120}121// NewRolluputilsFilterer creates a new log filterer instance of Rolluputils, bound to a specific deployed contract.122func NewRolluputilsFilterer(address common.Address, filterer bind.ContractFilterer) (*RolluputilsFilterer, error) {123 contract, err := bindRolluputils(address, nil, nil, filterer)124 if err != nil {125 return nil, err126 }127 return &RolluputilsFilterer{contract: contract}, nil128}129// bindRolluputils binds a generic wrapper to an already deployed contract.130func bindRolluputils(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {131 parsed, err := abi.JSON(strings.NewReader(RolluputilsABI))132 if err != nil {133 return nil, err134 }135 return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil136}137// Call invokes the (constant) contract method with params as input values and138// sets the output to result. The result type might be a single field for simple139// returns, a slice of interfaces for anonymous returns and a struct for named140// returns.141func (_Rolluputils *RolluputilsRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {142 return _Rolluputils.Contract.RolluputilsCaller.contract.Call(opts, result, method, params...)143}144// Transfer initiates a plain transaction to move funds to the contract, calling145// its default method if one is available.146func (_Rolluputils *RolluputilsRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {147 return _Rolluputils.Contract.RolluputilsTransactor.contract.Transfer(opts)148}149// Transact invokes the (paid) contract method with params as input values.150func (_Rolluputils *RolluputilsRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {151 return _Rolluputils.Contract.RolluputilsTransactor.contract.Transact(opts, method, params...)152}153// Call invokes the (constant) contract method with params as input values and154// sets the output to result. The result type might be a single field for simple155// returns, a slice of interfaces for anonymous returns and a struct for named156// returns.157func (_Rolluputils *RolluputilsCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {158 return _Rolluputils.Contract.contract.Call(opts, result, method, params...)159}160// Transfer initiates a plain transaction to move funds to the contract, calling161// its default method if one is available.162func (_Rolluputils *RolluputilsTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {163 return _Rolluputils.Contract.contract.Transfer(opts)164}165// Transact invokes the (paid) contract method with params as input values.166func (_Rolluputils *RolluputilsTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {167 return _Rolluputils.Contract.contract.Transact(opts, method, params...)168}169// AccountFromBytes is a free data retrieval call binding the contract method 0x1a636e86.170//171// Solidity: function AccountFromBytes(bytes accountBytes) pure returns(uint256 ID, uint256 balance, uint256 nonce, uint256 tokenType)172func (_Rolluputils *RolluputilsCaller) AccountFromBytes(opts *bind.CallOpts, accountBytes []byte) (struct {173 ID *big.Int174 Balance *big.Int175 Nonce *big.Int176 TokenType *big.Int177}, error) {178 ret := new(struct {179 ID *big.Int180 Balance *big.Int181 Nonce *big.Int182 TokenType *big.Int183 })184 out := ret185 err := _Rolluputils.contract.Call(opts, out, "AccountFromBytes", accountBytes)186 return *ret, err187}188// AccountFromBytes is a free data retrieval call binding the contract method 0x1a636e86.189//190// Solidity: function AccountFromBytes(bytes accountBytes) pure returns(uint256 ID, uint256 balance, uint256 nonce, uint256 tokenType)191func (_Rolluputils *RolluputilsSession) AccountFromBytes(accountBytes []byte) (struct {192 ID *big.Int193 Balance *big.Int194 Nonce *big.Int195 TokenType *big.Int196}, error) {197 return _Rolluputils.Contract.AccountFromBytes(&_Rolluputils.CallOpts, accountBytes)198}199// AccountFromBytes is a free data retrieval call binding the contract method 0x1a636e86.200//201// Solidity: function AccountFromBytes(bytes accountBytes) pure returns(uint256 ID, uint256 balance, uint256 nonce, uint256 tokenType)202func (_Rolluputils *RolluputilsCallerSession) AccountFromBytes(accountBytes []byte) (struct {203 ID *big.Int204 Balance *big.Int205 Nonce *big.Int206 TokenType *big.Int207}, error) {208 return _Rolluputils.Contract.AccountFromBytes(&_Rolluputils.CallOpts, accountBytes)209}210// BalanceFromAccount is a free data retrieval call binding the contract method 0x0f9b2cb2.211//212// Solidity: function BalanceFromAccount(TypesUserAccount account) pure returns(uint256)213func (_Rolluputils *RolluputilsCaller) BalanceFromAccount(opts *bind.CallOpts, account TypesUserAccount) (*big.Int, error) {214 var (215 ret0 = new(*big.Int)216 )217 out := ret0218 err := _Rolluputils.contract.Call(opts, out, "BalanceFromAccount", account)219 return *ret0, err220}221// BalanceFromAccount is a free data retrieval call binding the contract method 0x0f9b2cb2.222//223// Solidity: function BalanceFromAccount(TypesUserAccount account) pure returns(uint256)224func (_Rolluputils *RolluputilsSession) BalanceFromAccount(account TypesUserAccount) (*big.Int, error) {225 return _Rolluputils.Contract.BalanceFromAccount(&_Rolluputils.CallOpts, account)226}227// BalanceFromAccount is a free data retrieval call binding the contract method 0x0f9b2cb2.228//229// Solidity: function BalanceFromAccount(TypesUserAccount account) pure returns(uint256)230func (_Rolluputils *RolluputilsCallerSession) BalanceFromAccount(account TypesUserAccount) (*big.Int, error) {231 return _Rolluputils.Contract.BalanceFromAccount(&_Rolluputils.CallOpts, account)232}233// BytesFromAccount is a free data retrieval call binding the contract method 0x3035226f.234//235// Solidity: function BytesFromAccount(TypesUserAccount account) pure returns(bytes)236func (_Rolluputils *RolluputilsCaller) BytesFromAccount(opts *bind.CallOpts, account TypesUserAccount) ([]byte, error) {237 var (238 ret0 = new([]byte)239 )240 out := ret0241 err := _Rolluputils.contract.Call(opts, out, "BytesFromAccount", account)242 return *ret0, err243}244// BytesFromAccount is a free data retrieval call binding the contract method 0x3035226f.245//246// Solidity: function BytesFromAccount(TypesUserAccount account) pure returns(bytes)247func (_Rolluputils *RolluputilsSession) BytesFromAccount(account TypesUserAccount) ([]byte, error) {248 return _Rolluputils.Contract.BytesFromAccount(&_Rolluputils.CallOpts, account)249}250// BytesFromAccount is a free data retrieval call binding the contract method 0x3035226f.251//252// Solidity: function BytesFromAccount(TypesUserAccount account) pure returns(bytes)253func (_Rolluputils *RolluputilsCallerSession) BytesFromAccount(account TypesUserAccount) ([]byte, error) {254 return _Rolluputils.Contract.BytesFromAccount(&_Rolluputils.CallOpts, account)255}256// BytesFromAccountDeconstructed is a free data retrieval call binding the contract method 0x5bc64a2b.257//258// Solidity: function BytesFromAccountDeconstructed(uint256 ID, uint256 balance, uint256 nonce, uint256 tokenType) pure returns(bytes)259func (_Rolluputils *RolluputilsCaller) BytesFromAccountDeconstructed(opts *bind.CallOpts, ID *big.Int, balance *big.Int, nonce *big.Int, tokenType *big.Int) ([]byte, error) {260 var (261 ret0 = new([]byte)262 )263 out := ret0264 err := _Rolluputils.contract.Call(opts, out, "BytesFromAccountDeconstructed", ID, balance, nonce, tokenType)265 return *ret0, err266}267// BytesFromAccountDeconstructed is a free data retrieval call binding the contract method 0x5bc64a2b.268//269// Solidity: function BytesFromAccountDeconstructed(uint256 ID, uint256 balance, uint256 nonce, uint256 tokenType) pure returns(bytes)270func (_Rolluputils *RolluputilsSession) BytesFromAccountDeconstructed(ID *big.Int, balance *big.Int, nonce *big.Int, tokenType *big.Int) ([]byte, error) {271 return _Rolluputils.Contract.BytesFromAccountDeconstructed(&_Rolluputils.CallOpts, ID, balance, nonce, tokenType)272}273// BytesFromAccountDeconstructed is a free data retrieval call binding the contract method 0x5bc64a2b.274//275// Solidity: function BytesFromAccountDeconstructed(uint256 ID, uint256 balance, uint256 nonce, uint256 tokenType) pure returns(bytes)276func (_Rolluputils *RolluputilsCallerSession) BytesFromAccountDeconstructed(ID *big.Int, balance *big.Int, nonce *big.Int, tokenType *big.Int) ([]byte, error) {277 return _Rolluputils.Contract.BytesFromAccountDeconstructed(&_Rolluputils.CallOpts, ID, balance, nonce, tokenType)278}279// BytesFromTx is a free data retrieval call binding the contract method 0xd0dbc902.280//281// Solidity: function BytesFromTx(TypesTransaction _tx) pure returns(bytes)282func (_Rolluputils *RolluputilsCaller) BytesFromTx(opts *bind.CallOpts, _tx TypesTransaction) ([]byte, error) {283 var (284 ret0 = new([]byte)285 )286 out := ret0287 err := _Rolluputils.contract.Call(opts, out, "BytesFromTx", _tx)288 return *ret0, err289}290// BytesFromTx is a free data retrieval call binding the contract method 0xd0dbc902.291//292// Solidity: function BytesFromTx(TypesTransaction _tx) pure returns(bytes)293func (_Rolluputils *RolluputilsSession) BytesFromTx(_tx TypesTransaction) ([]byte, error) {294 return _Rolluputils.Contract.BytesFromTx(&_Rolluputils.CallOpts, _tx)295}296// BytesFromTx is a free data retrieval call binding the contract method 0xd0dbc902.297//298// Solidity: function BytesFromTx(TypesTransaction _tx) pure returns(bytes)299func (_Rolluputils *RolluputilsCallerSession) BytesFromTx(_tx TypesTransaction) ([]byte, error) {300 return _Rolluputils.Contract.BytesFromTx(&_Rolluputils.CallOpts, _tx)301}302// BytesFromTxDeconstructed is a free data retrieval call binding the contract method 0xb1b84d99.303//304// Solidity: function BytesFromTxDeconstructed(uint256 from, uint256 to, uint256 tokenType, uint256 nonce, uint256 txType, uint256 amount) pure returns(bytes)305func (_Rolluputils *RolluputilsCaller) BytesFromTxDeconstructed(opts *bind.CallOpts, from *big.Int, to *big.Int, tokenType *big.Int, nonce *big.Int, txType *big.Int, amount *big.Int) ([]byte, error) {306 var (307 ret0 = new([]byte)308 )309 out := ret0310 err := _Rolluputils.contract.Call(opts, out, "BytesFromTxDeconstructed", from, to, tokenType, nonce, txType, amount)311 return *ret0, err312}313// BytesFromTxDeconstructed is a free data retrieval call binding the contract method 0xb1b84d99.314//315// Solidity: function BytesFromTxDeconstructed(uint256 from, uint256 to, uint256 tokenType, uint256 nonce, uint256 txType, uint256 amount) pure returns(bytes)316func (_Rolluputils *RolluputilsSession) BytesFromTxDeconstructed(from *big.Int, to *big.Int, tokenType *big.Int, nonce *big.Int, txType *big.Int, amount *big.Int) ([]byte, error) {317 return _Rolluputils.Contract.BytesFromTxDeconstructed(&_Rolluputils.CallOpts, from, to, tokenType, nonce, txType, amount)318}319// BytesFromTxDeconstructed is a free data retrieval call binding the contract method 0xb1b84d99.320//321// Solidity: function BytesFromTxDeconstructed(uint256 from, uint256 to, uint256 tokenType, uint256 nonce, uint256 txType, uint256 amount) pure returns(bytes)322func (_Rolluputils *RolluputilsCallerSession) BytesFromTxDeconstructed(from *big.Int, to *big.Int, tokenType *big.Int, nonce *big.Int, txType *big.Int, amount *big.Int) ([]byte, error) {323 return _Rolluputils.Contract.BytesFromTxDeconstructed(&_Rolluputils.CallOpts, from, to, tokenType, nonce, txType, amount)324}325// CompressTx is a free data retrieval call binding the contract method 0x02c36512.326//327// Solidity: function CompressTx(TypesTransaction _tx) pure returns(bytes)328func (_Rolluputils *RolluputilsCaller) CompressTx(opts *bind.CallOpts, _tx TypesTransaction) ([]byte, error) {329 var (330 ret0 = new([]byte)331 )332 out := ret0333 err := _Rolluputils.contract.Call(opts, out, "CompressTx", _tx)334 return *ret0, err335}336// CompressTx is a free data retrieval call binding the contract method 0x02c36512.337//338// Solidity: function CompressTx(TypesTransaction _tx) pure returns(bytes)339func (_Rolluputils *RolluputilsSession) CompressTx(_tx TypesTransaction) ([]byte, error) {340 return _Rolluputils.Contract.CompressTx(&_Rolluputils.CallOpts, _tx)341}342// CompressTx is a free data retrieval call binding the contract method 0x02c36512.343//344// Solidity: function CompressTx(TypesTransaction _tx) pure returns(bytes)345func (_Rolluputils *RolluputilsCallerSession) CompressTx(_tx TypesTransaction) ([]byte, error) {346 return _Rolluputils.Contract.CompressTx(&_Rolluputils.CallOpts, _tx)347}348// CompressTxWithMessage is a free data retrieval call binding the contract method 0x6877401d.349//350// Solidity: function CompressTxWithMessage(bytes message, bytes sig) pure returns(bytes)351func (_Rolluputils *RolluputilsCaller) CompressTxWithMessage(opts *bind.CallOpts, message []byte, sig []byte) ([]byte, error) {352 var (353 ret0 = new([]byte)354 )355 out := ret0356 err := _Rolluputils.contract.Call(opts, out, "CompressTxWithMessage", message, sig)357 return *ret0, err358}359// CompressTxWithMessage is a free data retrieval call binding the contract method 0x6877401d.360//361// Solidity: function CompressTxWithMessage(bytes message, bytes sig) pure returns(bytes)362func (_Rolluputils *RolluputilsSession) CompressTxWithMessage(message []byte, sig []byte) ([]byte, error) {363 return _Rolluputils.Contract.CompressTxWithMessage(&_Rolluputils.CallOpts, message, sig)364}365// CompressTxWithMessage is a free data retrieval call binding the contract method 0x6877401d.366//367// Solidity: function CompressTxWithMessage(bytes message, bytes sig) pure returns(bytes)368func (_Rolluputils *RolluputilsCallerSession) CompressTxWithMessage(message []byte, sig []byte) ([]byte, error) {369 return _Rolluputils.Contract.CompressTxWithMessage(&_Rolluputils.CallOpts, message, sig)370}371// DecompressTx is a free data retrieval call binding the contract method 0xeedeb9d9.372//373// Solidity: function DecompressTx(bytes txBytes) pure returns(uint256 from, uint256 to, uint256 amount, bytes sig)374func (_Rolluputils *RolluputilsCaller) DecompressTx(opts *bind.CallOpts, txBytes []byte) (struct {375 From *big.Int376 To *big.Int377 Amount *big.Int378 Sig []byte379}, error) {380 ret := new(struct {381 From *big.Int382 To *big.Int383 Amount *big.Int384 Sig []byte385 })386 out := ret387 err := _Rolluputils.contract.Call(opts, out, "DecompressTx", txBytes)388 return *ret, err389}390// DecompressTx is a free data retrieval call binding the contract method 0xeedeb9d9.391//392// Solidity: function DecompressTx(bytes txBytes) pure returns(uint256 from, uint256 to, uint256 amount, bytes sig)393func (_Rolluputils *RolluputilsSession) DecompressTx(txBytes []byte) (struct {394 From *big.Int395 To *big.Int396 Amount *big.Int397 Sig []byte398}, error) {399 return _Rolluputils.Contract.DecompressTx(&_Rolluputils.CallOpts, txBytes)400}401// DecompressTx is a free data retrieval call binding the contract method 0xeedeb9d9.402//403// Solidity: function DecompressTx(bytes txBytes) pure returns(uint256 from, uint256 to, uint256 amount, bytes sig)404func (_Rolluputils *RolluputilsCallerSession) DecompressTx(txBytes []byte) (struct {405 From *big.Int406 To *big.Int407 Amount *big.Int408 Sig []byte409}, error) {410 return _Rolluputils.Contract.DecompressTx(&_Rolluputils.CallOpts, txBytes)411}412// GetGenesisDataBlocks is a free data retrieval call binding the contract method 0x5e31c831.413//414// Solidity: function GetGenesisDataBlocks() view returns(bytes[2] dataBlocks)415func (_Rolluputils *RolluputilsCaller) GetGenesisDataBlocks(opts *bind.CallOpts) ([2][]byte, error) {416 var (417 ret0 = new([2][]byte)418 )419 out := ret0420 err := _Rolluputils.contract.Call(opts, out, "GetGenesisDataBlocks")421 return *ret0, err422}423// GetGenesisDataBlocks is a free data retrieval call binding the contract method 0x5e31c831.424//425// Solidity: function GetGenesisDataBlocks() view returns(bytes[2] dataBlocks)426func (_Rolluputils *RolluputilsSession) GetGenesisDataBlocks() ([2][]byte, error) {427 return _Rolluputils.Contract.GetGenesisDataBlocks(&_Rolluputils.CallOpts)428}429// GetGenesisDataBlocks is a free data retrieval call binding the contract method 0x5e31c831.430//431// Solidity: function GetGenesisDataBlocks() view returns(bytes[2] dataBlocks)432func (_Rolluputils *RolluputilsCallerSession) GetGenesisDataBlocks() ([2][]byte, error) {433 return _Rolluputils.Contract.GetGenesisDataBlocks(&_Rolluputils.CallOpts)434}435// GetGenesisLeaves is a free data retrieval call binding the contract method 0x3043be91.436//437// Solidity: function GetGenesisLeaves() view returns(bytes32[2] leaves)438func (_Rolluputils *RolluputilsCaller) GetGenesisLeaves(opts *bind.CallOpts) ([2][32]byte, error) {439 var (440 ret0 = new([2][32]byte)441 )442 out := ret0443 err := _Rolluputils.contract.Call(opts, out, "GetGenesisLeaves")444 return *ret0, err445}446// GetGenesisLeaves is a free data retrieval call binding the contract method 0x3043be91.447//448// Solidity: function GetGenesisLeaves() view returns(bytes32[2] leaves)449func (_Rolluputils *RolluputilsSession) GetGenesisLeaves() ([2][32]byte, error) {450 return _Rolluputils.Contract.GetGenesisLeaves(&_Rolluputils.CallOpts)451}452// GetGenesisLeaves is a free data retrieval call binding the contract method 0x3043be91.453//454// Solidity: function GetGenesisLeaves() view returns(bytes32[2] leaves)455func (_Rolluputils *RolluputilsCallerSession) GetGenesisLeaves() ([2][32]byte, error) {456 return _Rolluputils.Contract.GetGenesisLeaves(&_Rolluputils.CallOpts)457}458// HashFromAccount is a free data retrieval call binding the contract method 0xcadbd919.459//460// Solidity: function HashFromAccount(TypesUserAccount account) pure returns(bytes32)461func (_Rolluputils *RolluputilsCaller) HashFromAccount(opts *bind.CallOpts, account TypesUserAccount) ([32]byte, error) {462 var (463 ret0 = new([32]byte)464 )465 out := ret0466 err := _Rolluputils.contract.Call(opts, out, "HashFromAccount", account)467 return *ret0, err468}469// HashFromAccount is a free data retrieval call binding the contract method 0xcadbd919.470//471// Solidity: function HashFromAccount(TypesUserAccount account) pure returns(bytes32)472func (_Rolluputils *RolluputilsSession) HashFromAccount(account TypesUserAccount) ([32]byte, error) {473 return _Rolluputils.Contract.HashFromAccount(&_Rolluputils.CallOpts, account)474}475// HashFromAccount is a free data retrieval call binding the contract method 0xcadbd919.476//477// Solidity: function HashFromAccount(TypesUserAccount account) pure returns(bytes32)478func (_Rolluputils *RolluputilsCallerSession) HashFromAccount(account TypesUserAccount) ([32]byte, error) {479 return _Rolluputils.Contract.HashFromAccount(&_Rolluputils.CallOpts, account)480}481// HashFromTx is a free data retrieval call binding the contract method 0xb90cbf51.482//483// Solidity: function HashFromTx(TypesTransaction _tx) pure returns(bytes32)484func (_Rolluputils *RolluputilsCaller) HashFromTx(opts *bind.CallOpts, _tx TypesTransaction) ([32]byte, error) {485 var (486 ret0 = new([32]byte)487 )488 out := ret0489 err := _Rolluputils.contract.Call(opts, out, "HashFromTx", _tx)490 return *ret0, err491}492// HashFromTx is a free data retrieval call binding the contract method 0xb90cbf51.493//494// Solidity: function HashFromTx(TypesTransaction _tx) pure returns(bytes32)495func (_Rolluputils *RolluputilsSession) HashFromTx(_tx TypesTransaction) ([32]byte, error) {496 return _Rolluputils.Contract.HashFromTx(&_Rolluputils.CallOpts, _tx)497}498// HashFromTx is a free data retrieval call binding the contract method 0xb90cbf51.499//500// Solidity: function HashFromTx(TypesTransaction _tx) pure returns(bytes32)501func (_Rolluputils *RolluputilsCallerSession) HashFromTx(_tx TypesTransaction) ([32]byte, error) {502 return _Rolluputils.Contract.HashFromTx(&_Rolluputils.CallOpts, _tx)503}504// PDALeafToHash is a free data retrieval call binding the contract method 0xc2ddab33.505//506// Solidity: function PDALeafToHash(TypesPDALeaf _PDA_Leaf) pure returns(bytes32)507func (_Rolluputils *RolluputilsCaller) PDALeafToHash(opts *bind.CallOpts, _PDA_Leaf TypesPDALeaf) ([32]byte, error) {508 var (509 ret0 = new([32]byte)510 )511 out := ret0512 err := _Rolluputils.contract.Call(opts, out, "PDALeafToHash", _PDA_Leaf)513 return *ret0, err514}515// PDALeafToHash is a free data retrieval call binding the contract method 0xc2ddab33.516//517// Solidity: function PDALeafToHash(TypesPDALeaf _PDA_Leaf) pure returns(bytes32)518func (_Rolluputils *RolluputilsSession) PDALeafToHash(_PDA_Leaf TypesPDALeaf) ([32]byte, error) {519 return _Rolluputils.Contract.PDALeafToHash(&_Rolluputils.CallOpts, _PDA_Leaf)520}521// PDALeafToHash is a free data retrieval call binding the contract method 0xc2ddab33.522//523// Solidity: function PDALeafToHash(TypesPDALeaf _PDA_Leaf) pure returns(bytes32)524func (_Rolluputils *RolluputilsCallerSession) PDALeafToHash(_PDA_Leaf TypesPDALeaf) ([32]byte, error) {525 return _Rolluputils.Contract.PDALeafToHash(&_Rolluputils.CallOpts, _PDA_Leaf)526}527// TxFromBytes is a free data retrieval call binding the contract method 0xbdbf417a.528//529// Solidity: function TxFromBytes(bytes txBytes) pure returns(TypesTransaction)530func (_Rolluputils *RolluputilsCaller) TxFromBytes(opts *bind.CallOpts, txBytes []byte) (TypesTransaction, error) {531 var (532 ret0 = new(TypesTransaction)533 )534 out := ret0535 err := _Rolluputils.contract.Call(opts, out, "TxFromBytes", txBytes)536 return *ret0, err537}538// TxFromBytes is a free data retrieval call binding the contract method 0xbdbf417a.539//540// Solidity: function TxFromBytes(bytes txBytes) pure returns(TypesTransaction)541func (_Rolluputils *RolluputilsSession) TxFromBytes(txBytes []byte) (TypesTransaction, error) {542 return _Rolluputils.Contract.TxFromBytes(&_Rolluputils.CallOpts, txBytes)543}544// TxFromBytes is a free data retrieval call binding the contract method 0xbdbf417a.545//546// Solidity: function TxFromBytes(bytes txBytes) pure returns(TypesTransaction)547func (_Rolluputils *RolluputilsCallerSession) TxFromBytes(txBytes []byte) (TypesTransaction, error) {548 return _Rolluputils.Contract.TxFromBytes(&_Rolluputils.CallOpts, txBytes)549}550// TxFromBytesDeconstructed is a free data retrieval call binding the contract method 0x2013a0cf.551//552// Solidity: function TxFromBytesDeconstructed(bytes txBytes) pure returns(uint256 from, uint256 to, uint256 tokenType, uint256 nonce, uint256 txType, uint256 amount)553func (_Rolluputils *RolluputilsCaller) TxFromBytesDeconstructed(opts *bind.CallOpts, txBytes []byte) (struct {554 From *big.Int555 To *big.Int556 TokenType *big.Int557 Nonce *big.Int558 TxType *big.Int559 Amount *big.Int560}, error) {561 ret := new(struct {562 From *big.Int563 To *big.Int564 TokenType *big.Int565 Nonce *big.Int566 TxType *big.Int567 Amount *big.Int568 })569 out := ret570 err := _Rolluputils.contract.Call(opts, out, "TxFromBytesDeconstructed", txBytes)571 return *ret, err572}573// TxFromBytesDeconstructed is a free data retrieval call binding the contract method 0x2013a0cf.574//575// Solidity: function TxFromBytesDeconstructed(bytes txBytes) pure returns(uint256 from, uint256 to, uint256 tokenType, uint256 nonce, uint256 txType, uint256 amount)576func (_Rolluputils *RolluputilsSession) TxFromBytesDeconstructed(txBytes []byte) (struct {577 From *big.Int578 To *big.Int579 TokenType *big.Int580 Nonce *big.Int581 TxType *big.Int582 Amount *big.Int583}, error) {584 return _Rolluputils.Contract.TxFromBytesDeconstructed(&_Rolluputils.CallOpts, txBytes)585}586// TxFromBytesDeconstructed is a free data retrieval call binding the contract method 0x2013a0cf.587//588// Solidity: function TxFromBytesDeconstructed(bytes txBytes) pure returns(uint256 from, uint256 to, uint256 tokenType, uint256 nonce, uint256 txType, uint256 amount)589func (_Rolluputils *RolluputilsCallerSession) TxFromBytesDeconstructed(txBytes []byte) (struct {590 From *big.Int591 To *big.Int592 TokenType *big.Int593 Nonce *big.Int594 TxType *big.Int595 Amount *big.Int596}, error) {597 return _Rolluputils.Contract.TxFromBytesDeconstructed(&_Rolluputils.CallOpts, txBytes)598}599// UpdateBalanceInAccount is a free data retrieval call binding the contract method 0x2e9be49a.600//601// Solidity: function UpdateBalanceInAccount(TypesUserAccount original_account, uint256 new_balance) pure returns(TypesUserAccount updated_account)602func (_Rolluputils *RolluputilsCaller) UpdateBalanceInAccount(opts *bind.CallOpts, original_account TypesUserAccount, new_balance *big.Int) (TypesUserAccount, error) {603 var (604 ret0 = new(TypesUserAccount)605 )606 out := ret0607 err := _Rolluputils.contract.Call(opts, out, "UpdateBalanceInAccount", original_account, new_balance)608 return *ret0, err609}610// UpdateBalanceInAccount is a free data retrieval call binding the contract method 0x2e9be49a.611//612// Solidity: function UpdateBalanceInAccount(TypesUserAccount original_account, uint256 new_balance) pure returns(TypesUserAccount updated_account)613func (_Rolluputils *RolluputilsSession) UpdateBalanceInAccount(original_account TypesUserAccount, new_balance *big.Int) (TypesUserAccount, error) {614 return _Rolluputils.Contract.UpdateBalanceInAccount(&_Rolluputils.CallOpts, original_account, new_balance)615}616// UpdateBalanceInAccount is a free data retrieval call binding the contract method 0x2e9be49a.617//618// Solidity: function UpdateBalanceInAccount(TypesUserAccount original_account, uint256 new_balance) pure returns(TypesUserAccount updated_account)619func (_Rolluputils *RolluputilsCallerSession) UpdateBalanceInAccount(original_account TypesUserAccount, new_balance *big.Int) (TypesUserAccount, error) {620 return _Rolluputils.Contract.UpdateBalanceInAccount(&_Rolluputils.CallOpts, original_account, new_balance)621}622// CalculateAddress is a free data retrieval call binding the contract method 0xe8a4c04e.623//624// Solidity: function calculateAddress(bytes pub) pure returns(address addr)625func (_Rolluputils *RolluputilsCaller) CalculateAddress(opts *bind.CallOpts, pub []byte) (common.Address, error) {626 var (627 ret0 = new(common.Address)628 )629 out := ret0630 err := _Rolluputils.contract.Call(opts, out, "calculateAddress", pub)631 return *ret0, err632}633// CalculateAddress is a free data retrieval call binding the contract method 0xe8a4c04e.634//635// Solidity: function calculateAddress(bytes pub) pure returns(address addr)636func (_Rolluputils *RolluputilsSession) CalculateAddress(pub []byte) (common.Address, error) {637 return _Rolluputils.Contract.CalculateAddress(&_Rolluputils.CallOpts, pub)638}639// CalculateAddress is a free data retrieval call binding the contract method 0xe8a4c04e.640//641// Solidity: function calculateAddress(bytes pub) pure returns(address addr)642func (_Rolluputils *RolluputilsCallerSession) CalculateAddress(pub []byte) (common.Address, error) {643 return _Rolluputils.Contract.CalculateAddress(&_Rolluputils.CallOpts, pub)644}645// GetAccountHash is a free data retrieval call binding the contract method 0x61a8c3c2.646//647// Solidity: function getAccountHash(uint256 id, uint256 balance, uint256 nonce, uint256 tokenType) pure returns(bytes32)648func (_Rolluputils *RolluputilsCaller) GetAccountHash(opts *bind.CallOpts, id *big.Int, balance *big.Int, nonce *big.Int, tokenType *big.Int) ([32]byte, error) {649 var (650 ret0 = new([32]byte)651 )652 out := ret0653 err := _Rolluputils.contract.Call(opts, out, "getAccountHash", id, balance, nonce, tokenType)654 return *ret0, err655}656// GetAccountHash is a free data retrieval call binding the contract method 0x61a8c3c2.657//658// Solidity: function getAccountHash(uint256 id, uint256 balance, uint256 nonce, uint256 tokenType) pure returns(bytes32)659func (_Rolluputils *RolluputilsSession) GetAccountHash(id *big.Int, balance *big.Int, nonce *big.Int, tokenType *big.Int) ([32]byte, error) {660 return _Rolluputils.Contract.GetAccountHash(&_Rolluputils.CallOpts, id, balance, nonce, tokenType)661}662// GetAccountHash is a free data retrieval call binding the contract method 0x61a8c3c2.663//664// Solidity: function getAccountHash(uint256 id, uint256 balance, uint256 nonce, uint256 tokenType) pure returns(bytes32)665func (_Rolluputils *RolluputilsCallerSession) GetAccountHash(id *big.Int, balance *big.Int, nonce *big.Int, tokenType *big.Int) ([32]byte, error) {666 return _Rolluputils.Contract.GetAccountHash(&_Rolluputils.CallOpts, id, balance, nonce, tokenType)667}668// GetTxSignBytes is a free data retrieval call binding the contract method 0x3ff55544.669//670// Solidity: function getTxSignBytes(uint256 fromIndex, uint256 toIndex, uint256 tokenType, uint256 txType, uint256 nonce, uint256 amount) pure returns(bytes32)671func (_Rolluputils *RolluputilsCaller) GetTxSignBytes(opts *bind.CallOpts, fromIndex *big.Int, toIndex *big.Int, tokenType *big.Int, txType *big.Int, nonce *big.Int, amount *big.Int) ([32]byte, error) {672 var (673 ret0 = new([32]byte)674 )675 out := ret0676 err := _Rolluputils.contract.Call(opts, out, "getTxSignBytes", fromIndex, toIndex, tokenType, txType, nonce, amount)677 return *ret0, err678}679// GetTxSignBytes is a free data retrieval call binding the contract method 0x3ff55544.680//681// Solidity: function getTxSignBytes(uint256 fromIndex, uint256 toIndex, uint256 tokenType, uint256 txType, uint256 nonce, uint256 amount) pure returns(bytes32)682func (_Rolluputils *RolluputilsSession) GetTxSignBytes(fromIndex *big.Int, toIndex *big.Int, tokenType *big.Int, txType *big.Int, nonce *big.Int, amount *big.Int) ([32]byte, error) {683 return _Rolluputils.Contract.GetTxSignBytes(&_Rolluputils.CallOpts, fromIndex, toIndex, tokenType, txType, nonce, amount)684}685// GetTxSignBytes is a free data retrieval call binding the contract method 0x3ff55544.686//687// Solidity: function getTxSignBytes(uint256 fromIndex, uint256 toIndex, uint256 tokenType, uint256 txType, uint256 nonce, uint256 amount) pure returns(bytes32)688func (_Rolluputils *RolluputilsCallerSession) GetTxSignBytes(fromIndex *big.Int, toIndex *big.Int, tokenType *big.Int, txType *big.Int, nonce *big.Int, amount *big.Int) ([32]byte, error) {689 return _Rolluputils.Contract.GetTxSignBytes(&_Rolluputils.CallOpts, fromIndex, toIndex, tokenType, txType, nonce, amount)690}...
mysql.go
Source:mysql.go
...70 compressed, ok := connMetadata.Internal.(connMetadataInternal).clientCapabilities[clientCompress]71 if ok && compressed {72 // https://dev.mysql.com/doc/internals/en/compressed-packet-header.html73 buff := bytes.NewBuffer(in)74 lenCompressed := int(bytesToUint64(readBytes(buff, 3))) // 3:length of compressed payload75 _ = readBytes(buff, 1) // 1:compressed sequence id76 lenUncompressed := bytesToUint64(readBytes(buff, 3)) // 3:length of payload before compression77 if buff.Len() == lenCompressed {78 if lenUncompressed > 0 {79 // https://dev.mysql.com/doc/internals/en/compressed-payload.html80 r, err := zlib.NewReader(buff)81 if err != nil {82 return values, err83 }84 newBuff := new(bytes.Buffer)85 _, err = io.Copy(newBuff, r) // #nosec86 if err != nil {87 return values, err88 }89 in = newBuff.Bytes()90 } else {91 // https://dev.mysql.com/doc/internals/en/uncompressed-payload.html92 in = buff.Bytes()93 }94 }95 }96 if direction == dumper.RemoteToClient || direction == dumper.DstToSrc || direction == dumper.Unknown {97 // COM_STMT_PREPARE Response https://dev.mysql.com/doc/internals/en/com-stmt-prepare-response.html98 if len(in) >= 16 && in[4] == comStmtPrepareOK && in[13] == 0x00 {99 buff := bytes.NewBuffer(in[5:])100 stmtID := readBytes(buff, 4)101 stmtIDNum := int(bytesToUint64(stmtID))102 _ = readBytes(buff, 2)103 numParams := readBytes(buff, 2)104 numParamsNum := int(bytesToUint64(numParams))105 connMetadata.Internal.(connMetadataInternal).stmtNumParams[stmtIDNum] = numParamsNum106 }107 return []dumper.DumpValue{}, nil108 }109 if len(in) < 6 {110 return []dumper.DumpValue{}, nil111 }112 var payloadLength uint32113 internal := connMetadata.Internal.(connMetadataInternal)114 if internal.payloadLength > 0 {115 payloadLength = internal.payloadLength116 } else {117 pl := make([]byte, 3)118 copy(pl, in[0:3])119 payloadLength = bytesToUint32(pl) // 3:payload_length120 }121 if uint32(len(in[4:])) < payloadLength {122 internal.payloadLength = payloadLength123 internal.longPacketCache = append(internal.longPacketCache, in...)124 connMetadata.Internal = internal125 return []dumper.DumpValue{}, nil126 }127 internal.payloadLength = uint32(0)128 connMetadata.Internal = internal129 seqNum := int64(in[3])130 commandID := in[4]131 var dumps = []dumper.DumpValue{}132 switch commandID {133 case comQuery:134 query := readString(in[5:], cSet)135 dumps = []dumper.DumpValue{136 dumper.DumpValue{137 Key: "query",138 Value: query,139 },140 }141 case comStmtPrepare:142 stmtPrepare := readString(in[5:], cSet)143 dumps = []dumper.DumpValue{144 dumper.DumpValue{145 Key: "stmt_prepare_query",146 Value: stmtPrepare,147 },148 }149 case comStmtExecute:150 // https://dev.mysql.com/doc/internals/en/com-stmt-execute.html151 buff := bytes.NewBuffer(in[5:])152 stmtID := readBytes(buff, 4) // 4:stmt-id153 stmtIDNum := int(bytesToUint64(stmtID))154 numParamsNum, ok := connMetadata.Internal.(connMetadataInternal).stmtNumParams[stmtIDNum]155 if ok && numParamsNum > 0 {156 _ = readBytes(buff, 5) // 1:flags 4:iteration-count157 _ = readBytes(buff, (numParamsNum+7)/8) // NULL-bitmap, length: (num-params+7)/8158 newParamsBoundFlag, _ := buff.ReadByte()159 if newParamsBoundFlag == 0x01 {160 // type of each parameter, length: num-params * 2161 dataTypes := []dataType{}162 for i := 0; i < numParamsNum; i++ {163 t := readMysqlType(buff)164 dataTypes = append(dataTypes, t)165 _, _ = buff.ReadByte()166 }167 // value of each parameter168 values := []interface{}{}169 for i := 0; i < numParamsNum; i++ {170 // https://dev.mysql.com/doc/internals/en/binary-protocol-value.html171 v := readBinaryProtocolValue(buff, dataTypes[i], cSet)172 values = append(values, v)173 }174 dumps = []dumper.DumpValue{175 dumper.DumpValue{176 Key: "stmt_id",177 Value: stmtIDNum,178 },179 dumper.DumpValue{180 Key: "stmt_execute_values",181 Value: values,182 },183 }184 } else {185 dumps = []dumper.DumpValue{186 dumper.DumpValue{187 Key: "stmt_id",188 Value: stmtIDNum,189 },190 dumper.DumpValue{191 Key: "stmt_execute_values",192 Value: []interface{}{},193 },194 }195 }196 } else if ok && numParamsNum == 0 {197 dumps = []dumper.DumpValue{198 dumper.DumpValue{199 Key: "stmt_id",200 Value: stmtIDNum,201 },202 dumper.DumpValue{203 Key: "stmt_execute_values",204 Value: []interface{}{},205 },206 }207 } else {208 values := readString(in[5:], cSet)209 dumps = []dumper.DumpValue{210 dumper.DumpValue{211 Key: "stmt_id",212 Value: stmtIDNum,213 },214 dumper.DumpValue{215 Key: "stmt_execute_values",216 Value: []string{values},217 },218 }219 }220 default:221 return []dumper.DumpValue{}, nil222 }223 return append(dumps, []dumper.DumpValue{224 dumper.DumpValue{225 Key: "seq_num",226 Value: seqNum,227 },228 dumper.DumpValue{229 Key: "command_id",230 Value: commandID,231 },232 }...), nil233}234// Log values235func (m *Dumper) Log(values []dumper.DumpValue) {236 fields := []zapcore.Field{}237 for _, kv := range values {238 fields = append(fields, zap.Any(kv.Key, kv.Value))239 }240 m.logger.Info("-", fields...)241}242// NewConnMetadata return metadata per TCP connection243func (m *Dumper) NewConnMetadata() *dumper.ConnMetadata {244 return &dumper.ConnMetadata{245 DumpValues: []dumper.DumpValue{},246 Internal: connMetadataInternal{247 stmtNumParams: stmtNumParams{},248 clientCapabilities: clientCapabilities{},249 charSet: charSetUnknown,250 payloadLength: uint32(0),251 },252 }253}254func (m *Dumper) readHandshakeResponse(in []byte, direction dumper.Direction, connMetadata *dumper.ConnMetadata) ([]dumper.DumpValue, error) {255 values := []dumper.DumpValue{}256 if direction == dumper.RemoteToClient || direction == dumper.DstToSrc {257 return values, nil258 }259 if len(connMetadata.Internal.(connMetadataInternal).clientCapabilities) > 0 {260 return values, nil261 }262 if len(in) < 9 {263 return values, nil264 }265 clientCapabilities := binary.LittleEndian.Uint32(in[4:8])266 // parse Protocol::HandshakeResponse41267 if len(in) > 35 && clientCapabilities&uint32(clientProtocol41) > 0 && bytes.Compare(in[13:36], []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}) == 0 {268 internal := connMetadata.Internal.(connMetadataInternal)269 cSet := charSet(uint32(in[12]))270 values = append(values, dumper.DumpValue{271 Key: "character_set",272 Value: cSet.String(),273 })274 internal.charSet = cSet275 connMetadata.Internal = internal276 connMetadata.Internal.(connMetadataInternal).clientCapabilities[clientProtocol41] = true277 if clientCapabilities&uint32(clientSSL) > 0 {278 // tcpdp mysql dumper not support SSL connection.279 err := errors.New("client is trying to connect using SSL. tcpdp mysql dumper not support SSL connection")280 fields := []zapcore.Field{281 zap.Error(err),282 }283 for _, kv := range connMetadata.DumpValues {284 fields = append(fields, zap.Any(kv.Key, kv.Value))285 }286 for _, kv := range values {287 fields = append(fields, zap.Any(kv.Key, kv.Value))288 }289 m.logger.Warn("-", fields...)290 return values, err291 }292 buff := bytes.NewBuffer(in[36:])293 readed, _ := buff.ReadBytes(0x00)294 username := readString(readed, cSet)295 values = append(values, dumper.DumpValue{296 Key: "username",297 Value: username,298 })299 if clientCapabilities&uint32(clientPluginAuthLenEncClientData) > 0 {300 connMetadata.Internal.(connMetadataInternal).clientCapabilities[clientPluginAuthLenEncClientData] = true301 n := readLengthEncodedInteger(buff)302 _, _ = buff.Read(make([]byte, n))303 } else if clientCapabilities&uint32(clientSecureConnection) > 0 {304 connMetadata.Internal.(connMetadataInternal).clientCapabilities[clientSecureConnection] = true305 l, _ := buff.ReadByte()306 _, _ = buff.Read(make([]byte, l))307 } else {308 _, _ = buff.ReadString(0x00)309 }310 if clientCapabilities&uint32(clientConnectWithDB) > 0 {311 connMetadata.Internal.(connMetadataInternal).clientCapabilities[clientConnectWithDB] = true312 readed, _ := buff.ReadBytes(0x00)313 database := readString(readed, cSet)314 values = append(values, dumper.DumpValue{315 Key: "database",316 Value: database,317 })318 }319 connMetadata.Internal.(connMetadataInternal).clientCapabilities[clientCompress] = (clientCapabilities&uint32(clientCompress) > 0)320 return values, nil321 }322 // parse Protocol::HandshakeResponse320323 clientCapabilities = bytesToUint32(in[4:6]) // 2:capability flags, CLIENT_PROTOCOL_41 never set324 if clientCapabilities&uint32(clientProtocol41) == 0 {325 if clientCapabilities&uint32(clientSSL) > 0 {326 // tcpdp mysql dumper not support SSL connection.327 err := errors.New("client is trying to connect using SSL. tcpdp mysql dumper not support SSL connection")328 return values, err329 }330 v := []dumper.DumpValue{}331 internal := connMetadata.Internal.(connMetadataInternal)332 connMetadata.Internal = internal333 connMetadata.Internal.(connMetadataInternal).clientCapabilities[clientProtocol41] = false334 buff := bytes.NewBuffer(in[9:])335 readed, _ := buff.ReadBytes(0x00)336 username := readString(readed, charSetUtf8)337 v = append(v, dumper.DumpValue{338 Key: "username",339 Value: username,340 })341 if clientCapabilities&uint32(clientConnectWithDB) > 0 {342 _, _ = buff.ReadBytes(0x00)343 readed, _ := buff.ReadBytes(0x00)344 database := readString(readed, charSetUtf8)345 v = append(v, dumper.DumpValue{346 Key: "database",347 Value: database,348 })349 } else {350 _, _ = buff.ReadBytes(0x00)351 }352 if buff.Len() == 0 {353 values = append(values, v...)354 }355 }356 return values, nil357}358func readMysqlType(buff *bytes.Buffer) dataType {359 b, _ := buff.ReadByte()360 return dataType(b)361}362// https://dev.mysql.com/doc/internals/en/integer.html#length-encoded-integer363func readLengthEncodedInteger(buff *bytes.Buffer) uint64 {364 l, _ := buff.ReadByte()365 n := bytesToUint64([]byte{l})366 if l == 0xfc {367 n = bytesToUint64(readBytes(buff, 2))368 }369 if l == 0xfd {370 n = bytesToUint64(readBytes(buff, 3))371 }372 if l == 0xfe {373 n = bytesToUint64(readBytes(buff, 8))374 }375 return n376}377// https://dev.mysql.com/doc/internals/en/binary-protocol-value.html378func readBinaryProtocolValue(buff *bytes.Buffer, dataType dataType, cSet charSet) interface{} {379 switch dataType {380 case typeLonglong:381 v := readBytes(buff, 8)382 return int64(binary.LittleEndian.Uint64(v))383 case typeLong, typeInt24:384 v := readBytes(buff, 4)385 return int32(binary.LittleEndian.Uint32(v))386 case typeShort, typeYear:387 v := readBytes(buff, 2)388 return int16(binary.LittleEndian.Uint16(v))389 case typeTiny:390 v := readBytes(buff, 1)391 return int8(v[0])392 case typeDouble:393 bits := bytesToUint64(readBytes(buff, 8))394 float := math.Float64frombits(bits)395 return float396 case typeFloat:397 bits := bytesToUint64(readBytes(buff, 4))398 float := math.Float32frombits(uint32(bits))399 return float400 case typeDate, typeDatetime, typeTimestamp:401 return readDatetime(buff, dataType)402 case typeTime:403 return readTime(buff)404 case typeNull:405 return nil406 default:407 l := readLengthEncodedInteger(buff)408 v := readBytes(buff, int(l))409 return readString(v, cSet)410 }411}412// ProtocolBinary::MYSQL_TYPE_DATE, ProtocolBinary::MYSQL_TYPE_DATETIME, ProtocolBinary::MYSQL_TYPE_TIMESTAMP413// https://dev.mysql.com/doc/internals/en/binary-protocol-value.html414func readDatetime(buff *bytes.Buffer, dataType dataType) string {415 l := bytesToUint64(readBytes(buff, 1))416 year := 0417 var month time.Month418 day := 0419 hour := 0420 min := 0421 sec := 0422 microSecond := 0423 switch l {424 case 0:425 case 4:426 year = int(bytesToUint64(readBytes(buff, 2)))427 month = time.Month(int(bytesToUint64(readBytes(buff, 1))))428 day = int(bytesToUint64(readBytes(buff, 1)))429 case 7:430 year = int(bytesToUint64(readBytes(buff, 2)))431 month = time.Month(int(bytesToUint64(readBytes(buff, 1))))432 day = int(bytesToUint64(readBytes(buff, 1)))433 hour = int(bytesToUint64(readBytes(buff, 1)))434 min = int(bytesToUint64(readBytes(buff, 1)))435 sec = int(bytesToUint64(readBytes(buff, 1)))436 case 11:437 year = int(bytesToUint64(readBytes(buff, 2)))438 month = time.Month(int(bytesToUint64(readBytes(buff, 1))))439 day = int(bytesToUint64(readBytes(buff, 1)))440 hour = int(bytesToUint64(readBytes(buff, 1)))441 min = int(bytesToUint64(readBytes(buff, 1)))442 sec = int(bytesToUint64(readBytes(buff, 1)))443 microSecond = int(bytesToUint64(readBytes(buff, 4)))444 }445 t := time.Date(year, month, day, hour, min, sec, microSecond*1000, time.UTC)446 if dataType == typeDate {447 return t.Format("2006-01-02")448 }449 ms := fmt.Sprintf("%06d", microSecond)450 return fmt.Sprintf("%s.%s %s", t.Format("2006-01-02 15:04:05"), ms[0:3], ms[3:6])451}452// ProtocolBinary::MYSQL_TYPE_TIME453// https://dev.mysql.com/doc/internals/en/binary-protocol-value.html454func readTime(buff *bytes.Buffer) string {455 l := bytesToUint64(readBytes(buff, 1))456 days := 0457 negative := 0458 hour := 0459 min := 0460 sec := 0461 microSecond := 0462 switch l {463 case 0:464 case 8:465 negative = int(bytesToUint64(readBytes(buff, 1)))466 days = int(bytesToUint64(readBytes(buff, 4)))467 hour = int(bytesToUint64(readBytes(buff, 1)))468 min = int(bytesToUint64(readBytes(buff, 1)))469 sec = int(bytesToUint64(readBytes(buff, 1)))470 case 12:471 negative = int(bytesToUint64(readBytes(buff, 1)))472 days = int(bytesToUint64(readBytes(buff, 4)))473 hour = int(bytesToUint64(readBytes(buff, 1)))474 min = int(bytesToUint64(readBytes(buff, 1)))475 sec = int(bytesToUint64(readBytes(buff, 1)))476 microSecond = int(bytesToUint64(readBytes(buff, 4)))477 }478 op := ""479 if negative == 1 {480 op = "-"481 }482 t := time.Date(0, time.January, 0, hour, min, sec, microSecond*1000, time.UTC)483 ms := fmt.Sprintf("%06d", microSecond)484 switch l {485 case 0:486 return ""487 case 12:488 return fmt.Sprintf("%s%dd %s.%s %s", op, days, t.Format("15:04:05"), ms[0:3], ms[3:6])489 default:490 return fmt.Sprintf("%s%dd %s", op, days, t.Format("15:04:05"))491 }492}493func bytesToUint32(b []byte) uint32 {494 c := make([]byte, len(b))495 copy(c, b)496 padding := make([]byte, 4-len(c))497 return binary.LittleEndian.Uint32(append(c, padding...))498}499func bytesToUint64(b []byte) uint64 {500 c := make([]byte, len(b))501 copy(c, b)502 padding := make([]byte, 8-len(c))503 return binary.LittleEndian.Uint64(append(c, padding...))504}505func readBytes(buff *bytes.Buffer, len int) []byte {506 b := make([]byte, len)507 _, _ = buff.Read(b)508 return b509}...
utils.go
Source:utils.go
1package interfaces2import (3 "fmt"4 reflect "reflect"5 "strings"6 "github.com/ethereum/go-ethereum/accounts/abi"7 "github.com/ethereum/go-ethereum/common"8 "github.com/ethereum/go-ethereum/ethclient"9)10var (11 // GoodDataSrvAddr ...12 // TODO: Need be updated for prodction13 GoodDataSrvAddr = common.HexToAddress("2222222222222222222222222222222222222222")14)15var goodDataSrvAbi = `16[17 {18 "anonymous": false,19 "inputs": [20 {21 "indexed": false,22 "internalType": "bytes",23 "name": "uuid",24 "type": "bytes"25 },26 {27 "indexed": false,28 "internalType": "bytes",29 "name": "publicKey",30 "type": "bytes"31 }32 ],33 "name": "DORegistered",34 "type": "event"35 },36 {37 "anonymous": false,38 "inputs": [39 {40 "indexed": false,41 "internalType": "bytes",42 "name": "queryUUID",43 "type": "bytes"44 },45 {46 "indexed": false,47 "internalType": "bytes",48 "name": "doUUIDs",49 "type": "bytes"50 }51 ],52 "name": "DOsOfQuery",53 "type": "event"54 },55 {56 "anonymous": false,57 "inputs": [58 {59 "indexed": false,60 "internalType": "bytes",61 "name": "uuid",62 "type": "bytes"63 },64 {65 "indexed": false,66 "internalType": "bytes",67 "name": "payload",68 "type": "bytes"69 }70 ],71 "name": "LogAdded",72 "type": "event"73 },74 {75 "anonymous": false,76 "inputs": [77 {78 "indexed": false,79 "internalType": "bytes",80 "name": "uuid",81 "type": "bytes"82 },83 {84 "indexed": false,85 "internalType": "bytes",86 "name": "publicKey",87 "type": "bytes"88 }89 ],90 "name": "MPCRegistered",91 "type": "event"92 },93 {94 "anonymous": false,95 "inputs": [96 {97 "indexed": false,98 "internalType": "bytes",99 "name": "queryUUID",100 "type": "bytes"101 },102 {103 "indexed": false,104 "internalType": "bytes",105 "name": "mpcUUIDs",106 "type": "bytes"107 }108 ],109 "name": "MPCsOfQuery",110 "type": "event"111 },112 {113 "anonymous": false,114 "inputs": [115 {116 "indexed": false,117 "internalType": "bytes",118 "name": "predictionUUID",119 "type": "bytes"120 }121 ],122 "name": "PredictionFinished",123 "type": "event"124 },125 {126 "anonymous": false,127 "inputs": [128 {129 "indexed": false,130 "internalType": "bytes",131 "name": "queryUUID",132 "type": "bytes"133 },134 {135 "indexed": false,136 "internalType": "bytes",137 "name": "predictionUUID",138 "type": "bytes"139 }140 ],141 "name": "PredictionSubmitted",142 "type": "event"143 },144 {145 "anonymous": false,146 "inputs": [147 {148 "indexed": false,149 "internalType": "bytes",150 "name": "uuid",151 "type": "bytes"152 },153 {154 "indexed": false,155 "internalType": "bytes",156 "name": "publicKey",157 "type": "bytes"158 }159 ],160 "name": "QCRegistered",161 "type": "event"162 },163 {164 "anonymous": false,165 "inputs": [166 {167 "indexed": false,168 "internalType": "bytes",169 "name": "queryUUID",170 "type": "bytes"171 }172 ],173 "name": "QueryFinished",174 "type": "event"175 },176 {177 "anonymous": false,178 "inputs": [179 {180 "indexed": false,181 "internalType": "bytes",182 "name": "queryUUID",183 "type": "bytes"184 },185 {186 "indexed": false,187 "internalType": "bytes",188 "name": "doUUID",189 "type": "bytes"190 }191 ],192 "name": "QueryFinishedInOneDO",193 "type": "event"194 },195 {196 "anonymous": false,197 "inputs": [198 {199 "indexed": false,200 "internalType": "bytes",201 "name": "queryUUID",202 "type": "bytes"203 },204 {205 "indexed": false,206 "internalType": "bytes",207 "name": "qcUUID",208 "type": "bytes"209 },210 {211 "indexed": false,212 "internalType": "int64",213 "name": "dataSet",214 "type": "int64"215 }216 ],217 "name": "QuerySubmitted",218 "type": "event"219 },220 {221 "inputs": [222 {223 "internalType": "bytes",224 "name": "uuid",225 "type": "bytes"226 },227 {228 "internalType": "bytes",229 "name": "payload",230 "type": "bytes"231 }232 ],233 "name": "addLog",234 "outputs": [],235 "stateMutability": "nonpayable",236 "type": "function"237 },238 {239 "inputs": [240 {241 "internalType": "bytes",242 "name": "queryUUID",243 "type": "bytes"244 },245 {246 "internalType": "bytes",247 "name": "doUUIDs",248 "type": "bytes"249 }250 ],251 "name": "assignQueryToDOs",252 "outputs": [],253 "stateMutability": "nonpayable",254 "type": "function"255 },256 {257 "inputs": [258 {259 "internalType": "bytes",260 "name": "queryUUID",261 "type": "bytes"262 },263 {264 "internalType": "bytes",265 "name": "mpcUUIDs",266 "type": "bytes"267 }268 ],269 "name": "assignQueryToMPCs",270 "outputs": [],271 "stateMutability": "nonpayable",272 "type": "function"273 },274 {275 "inputs": [276 {277 "internalType": "bytes",278 "name": "predictionUUID",279 "type": "bytes"280 }281 ],282 "name": "finishPrediction",283 "outputs": [],284 "stateMutability": "nonpayable",285 "type": "function"286 },287 {288 "inputs": [289 {290 "internalType": "bytes",291 "name": "queryUUID",292 "type": "bytes"293 }294 ],295 "name": "finishQuery",296 "outputs": [],297 "stateMutability": "nonpayable",298 "type": "function"299 },300 {301 "inputs": [302 {303 "internalType": "bytes",304 "name": "queryUUID",305 "type": "bytes"306 },307 {308 "internalType": "bytes",309 "name": "doUUID",310 "type": "bytes"311 }312 ],313 "name": "finishQueryInOneDO",314 "outputs": [],315 "stateMutability": "nonpayable",316 "type": "function"317 },318 {319 "inputs": [320 {321 "internalType": "bytes",322 "name": "uuid",323 "type": "bytes"324 },325 {326 "internalType": "bytes",327 "name": "publicKey",328 "type": "bytes"329 }330 ],331 "name": "registerDO",332 "outputs": [],333 "stateMutability": "nonpayable",334 "type": "function"335 },336 {337 "inputs": [338 {339 "internalType": "bytes",340 "name": "uuid",341 "type": "bytes"342 },343 {344 "internalType": "bytes",345 "name": "publicKey",346 "type": "bytes"347 }348 ],349 "name": "registerMPC",350 "outputs": [],351 "stateMutability": "nonpayable",352 "type": "function"353 },354 {355 "inputs": [356 {357 "internalType": "bytes",358 "name": "uuid",359 "type": "bytes"360 },361 {362 "internalType": "bytes",363 "name": "publicKey",364 "type": "bytes"365 }366 ],367 "name": "registerQC",368 "outputs": [],369 "stateMutability": "nonpayable",370 "type": "function"371 },372 {373 "inputs": [374 {375 "internalType": "bytes",376 "name": "queryUUID",377 "type": "bytes"378 },379 {380 "internalType": "bytes",381 "name": "predictionUUID",382 "type": "bytes"383 }384 ],385 "name": "submitPrediction",386 "outputs": [],387 "stateMutability": "nonpayable",388 "type": "function"389 },390 {391 "inputs": [392 {393 "internalType": "bytes",394 "name": "queryUUID",395 "type": "bytes"396 },397 {398 "internalType": "bytes",399 "name": "qcUUID",400 "type": "bytes"401 },402 {403 "internalType": "int64",404 "name": "dataSet",405 "type": "int64"406 },407 {408 "internalType": "uint256",409 "name": "fees",410 "type": "uint256"411 }412 ],413 "name": "submitQuery",414 "outputs": [],415 "stateMutability": "nonpayable",416 "type": "function"417 }418]419`420var (421 GdSrvAbi, _ = abi.JSON(strings.NewReader(goodDataSrvAbi))422)423// GetEthWSClient returns ethclient with websocket424func GetEthWSClient() *ethclient.Client {425 conn, err := ethclient.Dial("ws://localhost:8546")426 if err != nil {427 fmt.Printf("Failed to connect ws port, err: %s\n", err)428 return nil429 }430 return conn431}432// ValidateParamsType validate type of params433// returns nil if valid434// returns non-nil if invalid435func ValidateParamsType(actuals []interface{}, expects []interface{}) error {436 if len(actuals) != len(expects) {437 return fmt.Errorf("params length not equal, expect %d, actual: %d", len(expects), len(actuals))438 }439 i := 0440 for ; i < len(actuals); i++ {441 t1 := reflect.TypeOf(actuals[i])442 t2 := reflect.TypeOf(expects[i])443 if t1.String() != t2.String() {444 return fmt.Errorf("params[%d] type not equal, expect: %T, actual: %T", i, expects[i], actuals[i])445 }446 }447 return nil448}...
Bytes
Using AI Code Generation
1import (2func main() {3 fmt.Println(internal.Bytes("Hello World"))4}5func Bytes(s string) []byte {6 return []byte(s)7}8import "testing"9func TestBytes(t *testing.T) {10 if len(Bytes("Hello World")) != 11 {11 t.Error("Length of string is not 11")12 }13}14func Bytes(s string) []byte {15 return []byte(s)16}17import "testing"18func TestBytes(t *testing.T) {19 if len(Bytes("Hello World")) != 11 {20 t.Error("Length of string is not 11")21 }22}23func Bytes(s string) []byte {24 return []byte(s)25}26import (27func TestBytes(t *testing.T) {28 if len(internal.Bytes("Hello World")) != 11 {29 t.Error("Length of string is not 11")30 }31}32--- FAIL: TestBytes (0.00s)
Bytes
Using AI Code Generation
1import (2func main() {3 fmt.Println(MyPackage.Bytes())4}5import (6func main() {7 fmt.Println(MyPackage.Bytes())8}9import (10func main() {11 fmt.Println(MyPackage.Bytes())12}13import (14func main() {15 fmt.Println(MyPackage.Bytes())16}17import (18func main() {19 fmt.Println(MyPackage.Bytes())20}21import (22func main() {23 fmt.Println(MyPackage.Bytes())24}25import (26func main() {27 fmt.Println(MyPackage.Bytes())28}29import (30func main() {31 fmt.Println(MyPackage.Bytes())32}33import (34func main() {35 fmt.Println(MyPackage.Bytes())36}37import (38func main() {39 fmt.Println(MyPackage.Bytes())40}41import (42func main() {43 fmt.Println(MyPackage.Bytes
Bytes
Using AI Code Generation
1import (2func main() {3 b := bytealg.Bytes(s)4 fmt.Println(s, string(b))5}6func Bytes(s string) []byte {7 return *(*[]byte)(unsafe.Pointer(&s))8}9import (10func TestBytes(t *testing.T) {11 b := Bytes(s)12 if string(b) != "hello World" {13 t.Errorf("Expected hello World, got %q", string(b))14 }15}
Bytes
Using AI Code Generation
1import (2func main() {3 _ = _2.New().Bytes()4}5type _3 struct{}6func New() *_3 {7 return &_3{}8}9func (_3) Bytes() []byte {10 return []byte("hello")11}12type _3 struct{}13func New() *_3 {14 return &_3{}15}16func (_3) Bytes() []byte {17 return []byte("hello")18}19type _3 struct{}20func New() *_3 {21 return &_3{}22}23func (_3) Bytes() []byte {24 return []byte("hello")25}26type _3 struct{}27func New() *_3 {28 return &_3{}29}30func (_3) Bytes() []byte {31 return []byte("hello")32}33type _3 struct{}34func New() *_3 {35 return &_3{}36}37func (_3) Bytes() []byte {38 return []byte("hello")39}40type _3 struct{}41func New() *_3 {42 return &_3{}43}44func (_3) Bytes() []byte {45 return []byte("hello")46}47type _3 struct{}48func New() *_3 {49 return &_3{}50}51func (_3) Bytes() []byte {52 return []byte("hello")53}54type _3 struct{}55func New() *_3 {56 return &_3{}57}58func (_3) Bytes() []byte {59 return []byte("hello")60}
Bytes
Using AI Code Generation
1import "fmt"2import "internal"3func main() {4 fmt.Println(internal.Bytes())5}6func Bytes() []byte {7 return []byte{1,2,3}8}9We have moved the internal package to the parent directory. Now, let’s try to access the internal.Bytes() method from main package. The following is the code:10import "fmt"11import "internal"12func main() {13 fmt.Println(internal.Bytes())14}15func Bytes() []byte {16 return []byte{1,2,3}17}18 /usr/local/go/src/internal (from $GOROOT)19 /home/ashish/go/src/internal (from $GOPATH)
Bytes
Using AI Code Generation
1import (2func main() {3 fmt.Println(internal.Bytes(10))4}5func Bytes(n int) string {6}71: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=J1d7pGj-9PfjZQ2bq3qV/1Dx6CnG7MgX9d1p7Zu9a/7KjTf8OwH0l0uB6T1T7U/1sUZV6K2z6UHj7_1k8cI, not stripped81: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=J1d7pGj-9PfjZQ2bq3qV/1Dx6CnG7MgX9d1p7Zu9a/7KjTf8OwH0l0uB6T1T7U/1sUZV6K2z6UHj7_1k8cI, not stripped
Bytes
Using AI Code Generation
1import (2func main() {3 b := bytes.NewBuffer([]byte("hello"))4 fmt.Println(b.Bytes())5}6import (7func main() {8 b := bytes.NewBuffer([]byte("hello"))9 fmt.Println(b.buffer)10}11import (12func main() {13 b := bytes.NewBuffer([]byte("hello"))14 fmt.Println(b.Buffer)15}
Bytes
Using AI Code Generation
1import (2func main() {3 b = 2.Bytes()4}5import (6func Bytes() []byte {7 return 3.Bytes()8}9func Bytes() []byte {10 return []byte("hello world")11}12To make the code above compile, we need to change the import path of package 3 to “example.com/1/internal/3” and add the following line of code to 1.go:13import _ "example.com/1/internal/3"14The import path of package 3 is “example.com/1/internal/3” but the import path of package 3 is still “example.com/1/3” when package 3 is used. This is because the import path of a package is always relative to the directory containing the file containing the import statement. The directory containing the file containing the import statement is always the directory of the package containing the file containing the import
Bytes
Using AI Code Generation
1import (2func main() {3 fmt.Println(bytes.Bytes(10))4}5import (6func main() {7 fmt.Println(bytes.Bytes(10))8}9import (10func main() {11 fmt.Println(bytes.Bytes(10))12}13import (14func main() {15 fmt.Println(bytes.Bytes(10))16}17import (18func main() {19 fmt.Println(bytes.Bytes(10))20}21import (22func main() {23 fmt.Println(bytes.Bytes(10))24}25import (26func main() {27 fmt.Println(bytes.Bytes(10))28}29import (30func main() {31 fmt.Println(bytes.Bytes(10))32}
Bytes
Using AI Code Generation
1import (2func main() {3 fmt.Println(internal.Bytes(10))4}5import "fmt"6func main() {7 fmt.Println(internal.Bytes(10))8}93. How to import internal package in the same package10import (11func main() {12 fmt.Println(internal.Bytes(10))13}144. How to import internal package in another package15import (16func main() {17 fmt.Println(internal.Bytes(10))18}195. How to import internal package in the subpackage20import (21func main() {22 fmt.Println(internal.Bytes(10))23}246. How to import internal package in the same package in another module
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!