Documentation ¶
Index ¶
- func NewSimpleRetriever(bc simpletrigger.BlockChain, pm simpletrigger.ProtocolManager, ...) trigger.ChainRetriever
- func QueryAnchor(config *params.ChainConfig, bc core.ChainContext, statedb *state.StateDB, ...) ([]common.Address, int)
- type Anchor
- type AnchorSet
- type ChainInvoke
- func (c ChainInvoke) CurrentBlockNumber() uint64
- func (c ChainInvoke) GetConfirmedTransactionNumberOnChain(tx trigger.Transaction) uint64
- func (c ChainInvoke) GetTransactionNumberOnChain(tx trigger.Transaction) uint64
- func (c ChainInvoke) GetTransactionTimeOnChain(tx trigger.Transaction) uint64
- func (c ChainInvoke) IsTransactionExpired(tx trigger.Transaction, expiredHeight uint64) bool
- type EvmInvoke
- type SimpleRetriever
- type SimpleValidator
- func (v *SimpleValidator) ExpireNumber() int
- func (v *SimpleValidator) IsLocalCtx(ctx trigger.Transaction) bool
- func (v *SimpleValidator) IsRemoteCtx(ctx trigger.Transaction) bool
- func (v *SimpleValidator) RequireSignatures() int
- func (v *SimpleValidator) UpdateAnchors(info *cc.RemoteChainInfo) error
- func (v *SimpleValidator) VerifyContract(cws trigger.Transaction) error
- func (v *SimpleValidator) VerifyExpire(ctx *cc.CrossTransaction) error
- func (v *SimpleValidator) VerifySigner(ctx *cc.CrossTransaction, signChain, validChain *big.Int) (common.Address, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSimpleRetriever ¶
func NewSimpleRetriever(bc simpletrigger.BlockChain, pm simpletrigger.ProtocolManager, contract common.Address, config *cross.Config, chainConfig *params.ChainConfig) trigger.ChainRetriever
Types ¶
type AnchorSet ¶
type AnchorSet map[Anchor]struct{}
func NewAnchorSet ¶
func (*AnchorSet) IsAnchorSignedCtx ¶
type ChainInvoke ¶
type ChainInvoke struct {
// contains filtered or unexported fields
}
ChainInvoke invoke blockchain interfaces to get block and transaction states
func NewChainInvoke ¶
func NewChainInvoke(chain simpletrigger.BlockChain) *ChainInvoke
func (ChainInvoke) CurrentBlockNumber ¶
func (c ChainInvoke) CurrentBlockNumber() uint64
func (ChainInvoke) GetConfirmedTransactionNumberOnChain ¶
func (c ChainInvoke) GetConfirmedTransactionNumberOnChain(tx trigger.Transaction) uint64
func (ChainInvoke) GetTransactionNumberOnChain ¶
func (c ChainInvoke) GetTransactionNumberOnChain(tx trigger.Transaction) uint64
func (ChainInvoke) GetTransactionTimeOnChain ¶
func (c ChainInvoke) GetTransactionTimeOnChain(tx trigger.Transaction) uint64
func (ChainInvoke) IsTransactionExpired ¶
func (c ChainInvoke) IsTransactionExpired(tx trigger.Transaction, expiredHeight uint64) bool
type EvmInvoke ¶
type EvmInvoke struct {
// contains filtered or unexported fields
}
EvmInvoke invoke evm interfaces to call contract function
func NewEvmInvoke ¶
type SimpleRetriever ¶
type SimpleRetriever struct { *ChainInvoke *SimpleValidator // contains filtered or unexported fields }
func (*SimpleRetriever) CanAcceptTxs ¶
func (s *SimpleRetriever) CanAcceptTxs() bool
func (*SimpleRetriever) ConfirmedDepth ¶
func (s *SimpleRetriever) ConfirmedDepth() uint64
type SimpleValidator ¶
type SimpleValidator struct { *SimpleRetriever // contains filtered or unexported fields }
func NewSimpleValidator ¶
func NewSimpleValidator(contract common.Address, chain simpletrigger.BlockChain, config *cross.Config, chainConfig *params.ChainConfig) *SimpleValidator
func (*SimpleValidator) ExpireNumber ¶
func (v *SimpleValidator) ExpireNumber() int
func (*SimpleValidator) IsLocalCtx ¶
func (v *SimpleValidator) IsLocalCtx(ctx trigger.Transaction) bool
func (*SimpleValidator) IsRemoteCtx ¶
func (v *SimpleValidator) IsRemoteCtx(ctx trigger.Transaction) bool
func (*SimpleValidator) RequireSignatures ¶
func (v *SimpleValidator) RequireSignatures() int
func (*SimpleValidator) UpdateAnchors ¶
func (v *SimpleValidator) UpdateAnchors(info *cc.RemoteChainInfo) error
func (*SimpleValidator) VerifyContract ¶
func (v *SimpleValidator) VerifyContract(cws trigger.Transaction) error
send message to verify ctx in the cross contract (must exist makerTx in source-chain, do not took by others in destination-chain)
func (*SimpleValidator) VerifyExpire ¶
func (v *SimpleValidator) VerifyExpire(ctx *cc.CrossTransaction) error
func (*SimpleValidator) VerifySigner ¶
func (v *SimpleValidator) VerifySigner(ctx *cc.CrossTransaction, signChain, validChain *big.Int) (common.Address, error)
* validate ctx signed by anchor
- signChain: 交易签名的链ID
- validChain: 验证链ID,即本链跨链合约保存的其他链ID,需要验证签名的anchor是否与这条链需要的anchor相同
Click to show internal directories.
Click to hide internal directories.