side_chain_manager

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: LGPL-3.0 Imports: 15 Imported by: 0

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/>.

Index

Constants

View Source
const (
	//function name
	REGISTER_SIDE_CHAIN         = "registerSideChain"
	APPROVE_REGISTER_SIDE_CHAIN = "approveRegisterSideChain"
	UPDATE_SIDE_CHAIN           = "updateSideChain"
	APPROVE_UPDATE_SIDE_CHAIN   = "approveUpdateSideChain"
	QUIT_SIDE_CHAIN             = "quitSideChain"
	APPROVE_QUIT_SIDE_CHAIN     = "approveQuitSideChain"
	REGISTER_REDEEM             = "registerRedeem"
	SET_BTC_TX_PARAM            = "setBtcTxParam"

	//key prefix
	SIDE_CHAIN_APPLY          = "sideChainApply"
	UPDATE_SIDE_CHAIN_REQUEST = "updateSideChainRequest"
	QUIT_SIDE_CHAIN_REQUEST   = "quitSideChainRequest"
	SIDE_CHAIN                = "sideChain"
	REDEEM_BIND               = "redeemBind"
	BIND_SIGN_INFO            = "bindSignInfo"
	BTC_TX_PARAM              = "btcTxParam"
	REDEEM_SCRIPT             = "redeemScript"
)

Variables

This section is empty.

Functions

func ApproveQuitSideChain

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

func ApproveRegisterSideChain

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

func ApproveUpdateSideChain

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

func GetBtcRedeemScriptBytes

func GetBtcRedeemScriptBytes(native *native.NativeService, redeemScriptKey string, redeemChainId uint64) ([]byte, error)

func PutSideChain

func PutSideChain(native *native.NativeService, sideChain *SideChain) error

func QuitSideChain

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

func RegisterRedeem

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

func RegisterSideChain

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

func RegisterSideChainManagerContract

func RegisterSideChainManagerContract(native *native.NativeService)

Register methods of node_manager contract

func SetBtcTxParam

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

func UpdateSideChain

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

Types

type BindSignInfo

type BindSignInfo struct {
	BindSignInfo map[string][]byte
}

func (*BindSignInfo) Deserialization

func (this *BindSignInfo) Deserialization(source *common.ZeroCopySource) error

func (*BindSignInfo) Serialization

func (this *BindSignInfo) Serialization(sink *common.ZeroCopySink)

type BtcTxParam

type BtcTxParam struct {
	Redeem        []byte
	RedeemChainId uint64
	Sigs          [][]byte
	Detial        *BtcTxParamDetial
}

func (*BtcTxParam) Deserialization

func (this *BtcTxParam) Deserialization(source *common.ZeroCopySource) error

func (*BtcTxParam) Serialization

func (this *BtcTxParam) Serialization(sink *common.ZeroCopySink)

type BtcTxParamDetial

type BtcTxParamDetial struct {
	PVersion  uint64
	FeeRate   uint64
	MinChange uint64
}

func GetBtcTxParam

func GetBtcTxParam(native *native.NativeService, redeemKey []byte, redeemChainId uint64) (*BtcTxParamDetial, error)

func (*BtcTxParamDetial) Deserialization

func (this *BtcTxParamDetial) Deserialization(source *common.ZeroCopySource) error

func (*BtcTxParamDetial) Serialization

func (this *BtcTxParamDetial) Serialization(sink *common.ZeroCopySink)

type ChainidParam

type ChainidParam struct {
	Chainid uint64
	Address common.Address
}

func (*ChainidParam) Deserialization

func (this *ChainidParam) Deserialization(source *common.ZeroCopySource) error

func (*ChainidParam) Serialization

func (this *ChainidParam) Serialization(sink *common.ZeroCopySink)

type ContractBinded

type ContractBinded struct {
	Contract []byte
	Ver      uint64
}

func GetContractBind

func GetContractBind(native *native.NativeService, redeemChainID, contractChainID uint64,
	redeemKey []byte) (*ContractBinded, error)

func (*ContractBinded) Deserialization

func (this *ContractBinded) Deserialization(source *common.ZeroCopySource) error

func (*ContractBinded) Serialization

func (this *ContractBinded) Serialization(sink *common.ZeroCopySink)

type RegisterRedeemParam

type RegisterRedeemParam struct {
	RedeemChainID   uint64
	ContractChainID uint64
	Redeem          []byte
	CVersion        uint64
	ContractAddress []byte
	Signs           [][]byte
}

func (*RegisterRedeemParam) Deserialization

func (this *RegisterRedeemParam) Deserialization(source *common.ZeroCopySource) error

func (*RegisterRedeemParam) Serialization

func (this *RegisterRedeemParam) Serialization(sink *common.ZeroCopySink)

type RegisterSideChainParam

type RegisterSideChainParam struct {
	Address      common.Address
	ChainId      uint64
	Router       uint64
	Name         string
	BlocksToWait uint64
	CCMCAddress  []byte
	ExtraInfo    []byte
}

func (*RegisterSideChainParam) Deserialization

func (this *RegisterSideChainParam) Deserialization(source *common.ZeroCopySource) error

func (*RegisterSideChainParam) Serialization

func (this *RegisterSideChainParam) Serialization(sink *common.ZeroCopySink) error

type SideChain

type SideChain struct {
	Address      common.Address
	ChainId      uint64
	Router       uint64
	Name         string
	BlocksToWait uint64
	CCMCAddress  []byte
	ExtraInfo    []byte
}

func GetSideChain

func GetSideChain(native *native.NativeService, chainID uint64) (*SideChain, error)

func (*SideChain) Deserialization

func (this *SideChain) Deserialization(source *common.ZeroCopySource) error

func (*SideChain) Serialization

func (this *SideChain) Serialization(sink *common.ZeroCopySink) error

Jump to

Keyboard shortcuts

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