Documentation ¶
Overview ¶
* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.
Index ¶
- func BigEndianToUint64(array []byte) uint64
- func EncodeBigInt(b *big.Int) string
- func GetCurveLabel(name string) (byte, error)
- func GetEthNoCompressKey(key keypair.PublicKey) []byte
- func GetExplorerUrl(chainId uint64) string
- func GetNoCompresskey(key keypair.PublicKey) []byte
- func GetNodeHeader(url string, restClient *RestClient, height uint64) ([]byte, error)
- func GetNodeHeight(url string, restClient *RestClient) (uint64, error)
- func GetProof(url string, contractAddress string, key string, blockheight string, ...) ([]byte, error)
- func HexReverse(arr []byte) []byte
- func HexStringReverse(value string) string
- func ParseAuditpath(path []byte) ([]byte, []byte, [][32]byte, error)
- func Uint64ToBigEndian(i uint64) []byte
- type ETHProof
- type EthKeyStore
- func (this *EthKeyStore) GetAccounts() []accounts.Account
- func (this *EthKeyStore) GetChainId() uint64
- func (this *EthKeyStore) SignTransaction(tx *types.Transaction, acc accounts.Account) (*types.Transaction, error)
- func (this *EthKeyStore) TestPwd(acc accounts.Account, pwd string) error
- func (this *EthKeyStore) UnlockKeys(sigConfig *config.ETHConfig) error
- type NonceManager
- type RestClient
- type SortedNonceArr
- type StorageProof
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BigEndianToUint64 ¶
func EncodeBigInt ¶
func GetCurveLabel ¶
func GetEthNoCompressKey ¶
func GetExplorerUrl ¶
func GetNoCompresskey ¶
func GetNodeHeader ¶
func GetNodeHeader(url string, restClient *RestClient, height uint64) ([]byte, error)
func GetNodeHeight ¶
func GetNodeHeight(url string, restClient *RestClient) (uint64, error)
func HexReverse ¶
func HexStringReverse ¶
func Uint64ToBigEndian ¶
Uint64ToBigEndian - marshals uint64 to a bigendian byte slice so it can be sorted
Types ¶
type EthKeyStore ¶
type EthKeyStore struct {
// contains filtered or unexported fields
}
func NewEthKeyStore ¶
func NewEthKeyStore(sigConfig *config.ETHConfig, chainId *big.Int) *EthKeyStore
func (*EthKeyStore) GetAccounts ¶
func (this *EthKeyStore) GetAccounts() []accounts.Account
func (*EthKeyStore) GetChainId ¶
func (this *EthKeyStore) GetChainId() uint64
func (*EthKeyStore) SignTransaction ¶
func (this *EthKeyStore) SignTransaction(tx *types.Transaction, acc accounts.Account) (*types.Transaction, error)
func (*EthKeyStore) TestPwd ¶
func (this *EthKeyStore) TestPwd(acc accounts.Account, pwd string) error
func (*EthKeyStore) UnlockKeys ¶
func (this *EthKeyStore) UnlockKeys(sigConfig *config.ETHConfig) error
type NonceManager ¶
type NonceManager struct {
// contains filtered or unexported fields
}
func NewNonceManager ¶
func NewNonceManager(ethClient *ethclient.Client) *NonceManager
func (*NonceManager) DecreaseAddressNonce ¶
func (this *NonceManager) DecreaseAddressNonce(address common.Address)
func (*NonceManager) GetAddressNonce ¶
func (this *NonceManager) GetAddressNonce(address common.Address) uint64
return account nonce, and than nonce++
func (*NonceManager) ReturnNonce ¶
func (this *NonceManager) ReturnNonce(addr common.Address, nonce uint64)
type RestClient ¶
type RestClient struct { Addr string // contains filtered or unexported fields }
func NewRestClient ¶
func NewRestClient() *RestClient
func (*RestClient) SendRestRequest ¶
func (self *RestClient) SendRestRequest(addr string, data []byte) ([]byte, error)
func (*RestClient) SetAddr ¶
func (self *RestClient) SetAddr(addr string) *RestClient
func (*RestClient) SetRestClient ¶
func (self *RestClient) SetRestClient(restClient *http.Client) *RestClient
type SortedNonceArr ¶
type SortedNonceArr []uint64
func (SortedNonceArr) Len ¶
func (arr SortedNonceArr) Len() int
func (SortedNonceArr) Less ¶
func (arr SortedNonceArr) Less(i, j int) bool
func (SortedNonceArr) Swap ¶
func (arr SortedNonceArr) Swap(i, j int)