service

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERIFY_AND_EXECUTE_TX = "verifyAndExecuteTx"
	CHANGE_BOOK_KEEPER    = "changeBookKeeper"
	GET_BOOK_KEEPERS      = "getBookKeepers"
)
View Source
const PolyPublicKeyLength int = 67

Variables

View Source
var Log = log.Log

Functions

func DeserializeArgs

func DeserializeArgs(source []byte) ([]byte, []byte, *big.Int, error)

func HashChildren

func HashChildren(v, hash []byte) []byte

func HashLeaf

func HashLeaf(value []byte) []byte

func MerkleProve

func MerkleProve(path, root []byte) ([]byte, error)

func ReadBytes

func ReadBytes(buffer []byte, offset int, count int) ([]byte, int, error)

func ReadUInt255

func ReadUInt255(buffer []byte, offset int) (*big.Int, int, error)

func ReadVarBytes

func ReadVarBytes(buffer []byte, offset int) ([]byte, int, error)

func ReadVarUInt

func ReadVarUInt(buffer []byte, offset int) (uint64, int, error)

func ReadVarUInt16

func ReadVarUInt16(buffer []byte, offset int) (uint64, int, error)

func ReadVarUInt32

func ReadVarUInt32(buffer []byte, offset int) (uint64, int, error)

func ReadVarUInt64

func ReadVarUInt64(buffer []byte, offset int) (uint64, int, error)

func ReadVarUInt8

func ReadVarUInt8(buffer []byte, offset int) (uint64, int, error)

Types

type CrossChainTxParameter

type CrossChainTxParameter struct {
	TxHash       []byte // source chain tx hash, when FromChainID = 2 (eth), it's a key
	CrossChainID []byte
	FromContract []byte

	ToChainID  uint64
	ToContract []byte
	Method     []byte
	Args       []byte
}

func DeserializeCrossChainTxParameter

func DeserializeCrossChainTxParameter(source []byte, offset int) (*CrossChainTxParameter, error)

type SyncService

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

SyncService ...

func NewSyncService

func NewSyncService(acct *rsdk.Account, relaySdk *rsdk.PolySdk, neoAccount *wallet.WalletHelper, client *rpc.RpcClient) *SyncService

NewSyncService ...

func (*SyncService) GetCurrentNeoChainSyncHeight

func (this *SyncService) GetCurrentNeoChainSyncHeight() (uint64, error)

GetCurrentNeoChainSyncHeight

func (*SyncService) GetCurrentRelayChainSyncHeight

func (this *SyncService) GetCurrentRelayChainSyncHeight(neoChainID uint64) (uint32, error)

GetCurrentRelayChainSyncHeight :get the synced NEO blockHeight from Relay Chain

func (*SyncService) GetStateRootMsg

func (this *SyncService) GetStateRootMsg(sr mpt.StateRoot) []byte

func (*SyncService) NeoToRelay

func (this *SyncService) NeoToRelay()

NeoToRelay ...

func (*SyncService) NeoToRelayCheckAndRetry

func (this *SyncService) NeoToRelayCheckAndRetry()

func (*SyncService) RelayToNeo

func (this *SyncService) RelayToNeo()

RelayToNeo sync headers from relay chain to neo

func (*SyncService) RelayToNeoCheckAndRetry added in v1.0.0

func (this *SyncService) RelayToNeoCheckAndRetry()

func (*SyncService) Run

func (this *SyncService) Run()

Run ...

type ToMerkleValue

type ToMerkleValue struct {
	TxHash      []byte // poly chain tx hash
	FromChainID uint64
	TxParam     *CrossChainTxParameter
}

func DeserializeMerkleValue

func DeserializeMerkleValue(source []byte) (*ToMerkleValue, error)

Jump to

Keyboard shortcuts

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