Documentation ¶
Index ¶
- Constants
- Variables
- func SafeAdd(x, y uint64) (uint64, bool)
- func SafeMul(x, y uint64) (uint64, bool)
- func SafeSub(x, y uint64) (uint64, bool)
- func SplitPubKeys(rawBytes string) ([]string, error)
- func SplitSignature(rawBytes string) ([]string, error)
- type Address
- type LockProxy
- func (l *LockProxy) BindAssetHash(fromAssetHash, toChainId, toAssetHash string) (*transaction.Transaction, error)
- func (l *LockProxy) BindProxyHash(toChainId, targetProxyHash string) (*transaction.Transaction, error)
- func (l *LockProxy) ClaimAdmin() (*transaction.Transaction, error)
- func (l *LockProxy) Lock(fromAssetHash, toChainId, toAddress, amount string) (*transaction.Transaction, error)
- func (l *LockProxy) Pause() (*transaction.Transaction, error)
- func (l *LockProxy) SetManager(newManager string) (*transaction.Transaction, error)
- func (l *LockProxy) SetManagerProxy(newManagerProxy string) (*transaction.Transaction, error)
- func (l *LockProxy) UnPause() (*transaction.Transaction, error)
- func (l *LockProxy) Unlock(txData, fromContractAddr, fromChainId string) (*transaction.Transaction, error)
- func (l *LockProxy) UpdateAdmin(newAdmin string) (*transaction.Transaction, error)
- type ProofEntity
- type ProofPair
- type Proxy
- func (p *Proxy) ChangeBookKeeper(rawHeader string, pubKeys []string, sigList []string) (*transaction.Transaction, error)
- func (p *Proxy) ChangeBookKeeperWithNonce(rawHeader string, pubKeys []string, sigList []string, nonce string) (*transaction.Transaction, error)
- func (p *Proxy) InitGenesisBlock(rawHeader string, pubKeys []string) (*transaction.Transaction, error)
- func (p *Proxy) PopulateConKeepersPublicKeyList(keepers []string) (*transaction.Transaction, error)
- func (p *Proxy) PopulateCurEpochStartHeight(height string) (*transaction.Transaction, error)
- func (p *Proxy) PopulateFromChainTxExist(chainId, txId string) (*transaction.Transaction, error)
- func (p *Proxy) PopulateFromChainTxExistWithNonce(chainId, txId, nonce string) (*transaction.Transaction, error)
- func (p *Proxy) PopulateWhiteListFromContract(addr, val string) (*transaction.Transaction, error)
- func (p *Proxy) PopulateWhiteListMethod(method, val string) (*transaction.Transaction, error)
- func (p *Proxy) PopulateWhiteListToContract(addr, val string) (*transaction.Transaction, error)
- func (p *Proxy) PopulateZilToPolyTxHashIndex(index string) (*transaction.Transaction, error)
- func (p *Proxy) PopulateZilToPolyTxHashMap(index, val string) (*transaction.Transaction, error)
- func (p *Proxy) Unpause() (*transaction.Transaction, error)
- func (p *Proxy) UpgradeTo() (*transaction.Transaction, error)
- func (p *Proxy) VerifyHeaderAndExecuteTx(proof *ProofEntity, rawHeader string, headerProof *ProofEntity, ...) (*transaction.Transaction, error)
- func (p *Proxy) VerifyHeaderAndExecuteTxWithNonce(proof *ProofEntity, rawHeader string, headerProof *ProofEntity, ...) (*transaction.Transaction, error)
- type Uint256
- type ZeroCopySource
- func (self *ZeroCopySource) BackUp(n uint64)
- func (self *ZeroCopySource) Bytes() []byte
- func (self *ZeroCopySource) Len() uint64
- func (self *ZeroCopySource) NextAddress() (data Address, eof bool)
- func (self *ZeroCopySource) NextBool() (data bool, eof bool)
- func (self *ZeroCopySource) NextByte() (data byte, eof bool)
- func (self *ZeroCopySource) NextBytes(n uint64) (data []byte, eof bool)
- func (self *ZeroCopySource) NextHash() (data Uint256, eof bool)
- func (self *ZeroCopySource) NextInt16() (data int16, eof bool)
- func (self *ZeroCopySource) NextInt32() (data int32, eof bool)
- func (self *ZeroCopySource) NextInt64() (data int64, eof bool)
- func (self *ZeroCopySource) NextString() (data string, eof bool)
- func (self *ZeroCopySource) NextUint16() (data uint16, eof bool)
- func (self *ZeroCopySource) NextUint32() (data uint32, eof bool)
- func (self *ZeroCopySource) NextUint64() (data uint64, eof bool)
- func (self *ZeroCopySource) NextUint8() (data uint8, eof bool)
- func (self *ZeroCopySource) NextVarBytes() (data []byte, eof bool)
- func (self *ZeroCopySource) NextVarUint() (data uint64, eof bool)
- func (self *ZeroCopySource) OffBytes() []byte
- func (self *ZeroCopySource) Pos() uint64
- func (self *ZeroCopySource) Size() uint64
- func (self *ZeroCopySource) Skip(n uint64) (eof bool)
Constants ¶
View Source
const ( MAX_UINT64 = math.MaxUint64 MAX_INT64 = math.MaxInt64 )
View Source
const ( UINT16_SIZE = 2 UINT32_SIZE = 4 UINT64_SIZE = 8 UINT256_SIZE = 32 ADDR_LEN = 20 )
Variables ¶
View Source
var UINT256_EMPTY = Uint256{}
Functions ¶
func SplitPubKeys ¶
func SplitSignature ¶
Types ¶
type LockProxy ¶
type LockProxy struct { Addr string Wallet *account.Wallet Client *provider.Provider ChainId int MsgVersion int }
func (*LockProxy) BindAssetHash ¶
func (l *LockProxy) BindAssetHash(fromAssetHash, toChainId, toAssetHash string) (*transaction.Transaction, error)
func (*LockProxy) BindProxyHash ¶
func (l *LockProxy) BindProxyHash(toChainId, targetProxyHash string) (*transaction.Transaction, error)
func (*LockProxy) ClaimAdmin ¶
func (l *LockProxy) ClaimAdmin() (*transaction.Transaction, error)
func (*LockProxy) Lock ¶
func (l *LockProxy) Lock(fromAssetHash, toChainId, toAddress, amount string) (*transaction.Transaction, error)
func (*LockProxy) Pause ¶
func (l *LockProxy) Pause() (*transaction.Transaction, error)
func (*LockProxy) SetManager ¶
func (l *LockProxy) SetManager(newManager string) (*transaction.Transaction, error)
func (*LockProxy) SetManagerProxy ¶
func (l *LockProxy) SetManagerProxy(newManagerProxy string) (*transaction.Transaction, error)
func (*LockProxy) UnPause ¶
func (l *LockProxy) UnPause() (*transaction.Transaction, error)
func (*LockProxy) Unlock ¶
func (l *LockProxy) Unlock(txData, fromContractAddr, fromChainId string) (*transaction.Transaction, error)
func (*LockProxy) UpdateAdmin ¶
func (l *LockProxy) UpdateAdmin(newAdmin string) (*transaction.Transaction, error)
type ProofEntity ¶
func DeserializeProof ¶
func DeserializeProof(proof string, position uint64) *ProofEntity
type Proxy ¶
type Proxy struct { ProxyAddr string ImplAddr string Wallet *account.Wallet Client *provider.Provider ChainId int MsgVersion int }
Proxy for cross chain manager smart contract
func (*Proxy) ChangeBookKeeper ¶
func (p *Proxy) ChangeBookKeeper(rawHeader string, pubKeys []string, sigList []string) (*transaction.Transaction, error)
func (*Proxy) ChangeBookKeeperWithNonce ¶
func (p *Proxy) ChangeBookKeeperWithNonce(rawHeader string, pubKeys []string, sigList []string, nonce string) (*transaction.Transaction, error)
func (*Proxy) InitGenesisBlock ¶
func (p *Proxy) InitGenesisBlock(rawHeader string, pubKeys []string) (*transaction.Transaction, error)
func (*Proxy) PopulateConKeepersPublicKeyList ¶
func (p *Proxy) PopulateConKeepersPublicKeyList(keepers []string) (*transaction.Transaction, error)
func (*Proxy) PopulateCurEpochStartHeight ¶
func (p *Proxy) PopulateCurEpochStartHeight(height string) (*transaction.Transaction, error)
func (*Proxy) PopulateFromChainTxExist ¶
func (p *Proxy) PopulateFromChainTxExist(chainId, txId string) (*transaction.Transaction, error)
func (*Proxy) PopulateFromChainTxExistWithNonce ¶
func (p *Proxy) PopulateFromChainTxExistWithNonce(chainId, txId, nonce string) (*transaction.Transaction, error)
func (*Proxy) PopulateWhiteListFromContract ¶
func (p *Proxy) PopulateWhiteListFromContract(addr, val string) (*transaction.Transaction, error)
func (*Proxy) PopulateWhiteListMethod ¶
func (p *Proxy) PopulateWhiteListMethod(method, val string) (*transaction.Transaction, error)
func (*Proxy) PopulateWhiteListToContract ¶
func (p *Proxy) PopulateWhiteListToContract(addr, val string) (*transaction.Transaction, error)
func (*Proxy) PopulateZilToPolyTxHashIndex ¶
func (p *Proxy) PopulateZilToPolyTxHashIndex(index string) (*transaction.Transaction, error)
func (*Proxy) PopulateZilToPolyTxHashMap ¶
func (p *Proxy) PopulateZilToPolyTxHashMap(index, val string) (*transaction.Transaction, error)
func (*Proxy) Unpause ¶
func (p *Proxy) Unpause() (*transaction.Transaction, error)
func (*Proxy) UpgradeTo ¶
func (p *Proxy) UpgradeTo() (*transaction.Transaction, error)
func (*Proxy) VerifyHeaderAndExecuteTx ¶
func (p *Proxy) VerifyHeaderAndExecuteTx(proof *ProofEntity, rawHeader string, headerProof *ProofEntity, curRawHeader string, headerSig []string) (*transaction.Transaction, error)
func (*Proxy) VerifyHeaderAndExecuteTxWithNonce ¶
func (p *Proxy) VerifyHeaderAndExecuteTxWithNonce(proof *ProofEntity, rawHeader string, headerProof *ProofEntity, curRawHeader string, headerSig []string, nonce string) (*transaction.Transaction, error)
type Uint256 ¶
type Uint256 [UINT256_SIZE]byte
type ZeroCopySource ¶
type ZeroCopySource struct {
// contains filtered or unexported fields
}
func NewZeroCopySource ¶
func NewZeroCopySource(b []byte) *ZeroCopySource
NewReader returns a new ZeroCopySource reading from b.
func (*ZeroCopySource) BackUp ¶
func (self *ZeroCopySource) BackUp(n uint64)
Backs up a number of bytes, so that the next call to NextXXX() returns data again that was already returned by the last call to NextXXX().
func (*ZeroCopySource) Bytes ¶
func (self *ZeroCopySource) Bytes() []byte
func (*ZeroCopySource) Len ¶
func (self *ZeroCopySource) Len() uint64
Len returns the number of bytes of the unread portion of the slice.
func (*ZeroCopySource) NextAddress ¶
func (self *ZeroCopySource) NextAddress() (data Address, eof bool)
func (*ZeroCopySource) NextBool ¶
func (self *ZeroCopySource) NextBool() (data bool, eof bool)
func (*ZeroCopySource) NextByte ¶
func (self *ZeroCopySource) NextByte() (data byte, eof bool)
ReadByte implements the io.ByteReader interface.
func (*ZeroCopySource) NextBytes ¶
func (self *ZeroCopySource) NextBytes(n uint64) (data []byte, eof bool)
Read implements the io.ZeroCopySource interface.
func (*ZeroCopySource) NextHash ¶
func (self *ZeroCopySource) NextHash() (data Uint256, eof bool)
func (*ZeroCopySource) NextInt16 ¶
func (self *ZeroCopySource) NextInt16() (data int16, eof bool)
func (*ZeroCopySource) NextInt32 ¶
func (self *ZeroCopySource) NextInt32() (data int32, eof bool)
func (*ZeroCopySource) NextInt64 ¶
func (self *ZeroCopySource) NextInt64() (data int64, eof bool)
func (*ZeroCopySource) NextString ¶
func (self *ZeroCopySource) NextString() (data string, eof bool)
func (*ZeroCopySource) NextUint16 ¶
func (self *ZeroCopySource) NextUint16() (data uint16, eof bool)
func (*ZeroCopySource) NextUint32 ¶
func (self *ZeroCopySource) NextUint32() (data uint32, eof bool)
func (*ZeroCopySource) NextUint64 ¶
func (self *ZeroCopySource) NextUint64() (data uint64, eof bool)
func (*ZeroCopySource) NextUint8 ¶
func (self *ZeroCopySource) NextUint8() (data uint8, eof bool)
func (*ZeroCopySource) NextVarBytes ¶
func (self *ZeroCopySource) NextVarBytes() (data []byte, eof bool)
func (*ZeroCopySource) NextVarUint ¶
func (self *ZeroCopySource) NextVarUint() (data uint64, eof bool)
func (*ZeroCopySource) OffBytes ¶
func (self *ZeroCopySource) OffBytes() []byte
func (*ZeroCopySource) Pos ¶
func (self *ZeroCopySource) Pos() uint64
func (*ZeroCopySource) Size ¶
func (self *ZeroCopySource) Size() uint64
Size returns the original length of the underlying byte slice. Size is the number of bytes available for reading via ReadAt. The returned value is always the same and is not affected by calls to any other method.
func (*ZeroCopySource) Skip ¶
func (self *ZeroCopySource) Skip(n uint64) (eof bool)
Click to show internal directories.
Click to hide internal directories.