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/>.
Index ¶
- Constants
- Variables
- func GetSpanKey(id uint64) []byte
- type BridgeTransaction
- type BridgeTransactionAndHash
- type CrossTransfer
- type EthSender
- type EthTxInfo
- type EthereumManager
- type PolyManager
- type SpanStartEnd
- type StartEnd
- type TendermintClient
- func (this *TendermintClient) GetCosmosHdr(h int64) (*types.CosmosHeader, error)
- func (this *TendermintClient) GetLatestHeight() (int64, error)
- func (this *TendermintClient) GetLatestSpan(block int64) (*hmTypes.Span, error)
- func (this *TendermintClient) GetSpanIdByBor(bor uint64) (uint64, error)
- func (this *TendermintClient) GetSpanRes(id uint64, heimHeight int64) (*abcitypes.ResponseQuery, *hmTypes.Span, error)
- func (this *TendermintClient) MonitorSpanHisRoutine(start uint64)
- func (this *TendermintClient) MonitorSpanLatestRoutine(seconds uint64)
Constants ¶
const ( FEE_NOCHECK = iota FEE_HASPAY FEE_NOTPAY )
const (
ChanLen = 0
)
Variables ¶
var SpanIdCacheSynced uint64 = 0
var SpanMu sync.Mutex
var SpanPrefixKey = []byte{0x36} // prefix key to store span
var Sprint uint64 = 64
var StartFirst = true
var StartSpan uint64 = 0
Functions ¶
Types ¶
type BridgeTransaction ¶
type BridgeTransaction struct {
// contains filtered or unexported fields
}
func (*BridgeTransaction) Deserialization ¶
func (this *BridgeTransaction) Deserialization(source *common.ZeroCopySource) error
func (*BridgeTransaction) Serialization ¶
func (this *BridgeTransaction) Serialization(sink *common.ZeroCopySink)
type BridgeTransactionAndHash ¶
type BridgeTransactionAndHash struct { BridgeTransaction *BridgeTransaction Hash string }
type CrossTransfer ¶
type CrossTransfer struct {
// contains filtered or unexported fields
}
func (*CrossTransfer) Deserialization ¶
func (this *CrossTransfer) Deserialization(source *common.ZeroCopySource) error
func (*CrossTransfer) Serialization ¶
func (this *CrossTransfer) Serialization(sink *common.ZeroCopySink)
type EthereumManager ¶
type EthereumManager struct { TendermintClient *TendermintClient LastSpanId uint64 LastSpanId2 uint64 // contains filtered or unexported fields }
func NewEthereumManager ¶
func (*EthereumManager) CheckDeposit ¶
func (this *EthereumManager) CheckDeposit()
func (*EthereumManager) MonitorChain ¶
func (this *EthereumManager) MonitorChain()
func (*EthereumManager) MonitorDeposit ¶
func (this *EthereumManager) MonitorDeposit()
func (*EthereumManager) SyncEventToPoly ¶
func (this *EthereumManager) SyncEventToPoly() error
func (*EthereumManager) SyncHeaderToPoly ¶
func (this *EthereumManager) SyncHeaderToPoly() error
type PolyManager ¶
type PolyManager struct {
// contains filtered or unexported fields
}
func NewPolyManager ¶
func (*PolyManager) MonitorChain ¶
func (this *PolyManager) MonitorChain()
func (*PolyManager) MonitorDeposit ¶
func (this *PolyManager) MonitorDeposit()
func (*PolyManager) Stop ¶
func (this *PolyManager) Stop()
type SpanStartEnd ¶
type TendermintClient ¶
type TendermintClient struct { RPCHttp *rpcclient.HTTP Codec *codec.Codec // contains filtered or unexported fields }
func NewTendermintClient ¶
func (*TendermintClient) GetCosmosHdr ¶
func (this *TendermintClient) GetCosmosHdr(h int64) (*types.CosmosHeader, error)
func (*TendermintClient) GetLatestHeight ¶
func (this *TendermintClient) GetLatestHeight() (int64, error)
func (*TendermintClient) GetLatestSpan ¶
func (this *TendermintClient) GetLatestSpan(block int64) (*hmTypes.Span, error)
func (*TendermintClient) GetSpanIdByBor ¶
func (this *TendermintClient) GetSpanIdByBor(bor uint64) (uint64, error)
func (*TendermintClient) GetSpanRes ¶
func (this *TendermintClient) GetSpanRes(id uint64, heimHeight int64) (*abcitypes.ResponseQuery, *hmTypes.Span, error)
block: 0 = latest
func (*TendermintClient) MonitorSpanHisRoutine ¶
func (this *TendermintClient) MonitorSpanHisRoutine(start uint64)
func (*TendermintClient) MonitorSpanLatestRoutine ¶
func (this *TendermintClient) MonitorSpanLatestRoutine(seconds uint64)