utils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BYTE_FALSE = []byte{0}
	BYTE_TRUE  = []byte{1}

	HeaderSyncContractAddress, _        = common.AddressParseFromBytes([]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02})
	CrossChainManagerContractAddress, _ = common.AddressParseFromBytes([]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03})
	SideChainManagerContractAddress, _  = common.AddressParseFromBytes([]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04})
	NodeManagerContractAddress, _       = common.AddressParseFromBytes([]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05})
	RelayerManagerContractAddress, _    = common.AddressParseFromBytes([]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06})

	BTC_ROUTER     = uint64(1)
	ETH_ROUTER     = uint64(2)
	ONT_ROUTER     = uint64(3)
	NEO_ROUTER     = uint64(4)
	COSMOS_ROUTER  = uint64(5)
	BSC_ROUTER     = uint64(6)
	HECO_ROUTER    = uint64(7)
	QUORUM_ROUTER  = uint64(8)
	ZILLIQA_ROUTER = uint64(9)
	MSC_ROUTER     = uint64(10)
)

Functions

func ConcatKey

func ConcatKey(contract common.Address, args ...[]byte) []byte

func GenUInt32StorageItem

func GenUInt32StorageItem(value uint32) *cstates.StorageItem

func GenUInt64StorageItem

func GenUInt64StorageItem(value uint64) *cstates.StorageItem

func GenVarBytesStorageItem

func GenVarBytesStorageItem(value []byte) *cstates.StorageItem

func GetBytesUint32

func GetBytesUint32(b []byte) uint32

func GetBytesUint64

func GetBytesUint64(b []byte) uint64

func GetStorageItem

func GetStorageItem(native *native.NativeService, key []byte) (*cstates.StorageItem, error)

func GetStorageUInt32

func GetStorageUInt32(native *native.NativeService, key []byte) (uint32, error)

func GetStorageUInt64

func GetStorageUInt64(native *native.NativeService, key []byte) (uint64, error)

func GetStorageVarBytes

func GetStorageVarBytes(native *native.NativeService, key []byte) ([]byte, error)

func GetUint32Bytes

func GetUint32Bytes(num uint32) []byte

func GetUint64Bytes

func GetUint64Bytes(num uint64) []byte

func PutBytes

func PutBytes(native *native.NativeService, key []byte, value []byte)

func ValidateOwner

func ValidateOwner(native *native.NativeService, address common.Address) error

func ValidatePeerPubKeyFormat

func ValidatePeerPubKeyFormat(pubkey string) error

Types

type BtcNetType

type BtcNetType int
const (
	TyTestnet3 BtcNetType = iota
	TyRegtest
	TySimnet
	TyMainnet
)

Jump to

Keyboard shortcuts

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