Documentation ¶
Index ¶
- func AddClaim(prophecy *x2eTy.ReceiptEthProphecy, validator string, claim string)
- func CreateOracleClaimFromEthClaim(ethClaim x2eTy.Eth2Chain33) (x2eTy.OracleClaim, error)
- func CreateOracleClaimFromOracleString(oracleClaimString string) (x2eTy.OracleClaimContent, error)
- func FindHighestClaim(prophecy *x2eTy.ReceiptEthProphecy, validators map[string]int64) (string, int64, int64)
- func GetName() string
- func Init(name string, cfg *types.Chain33Config, sub []byte)
- func InitExecType()
- func NewClaim(id string, validatorAddress string, content string) x2eTy.OracleClaim
- func NewOracleClaimContent(chain33Receiver string, amount string, claimType, decimals int64) x2eTy.OracleClaimContent
- func NewProphecy(id string) *x2eTy.ReceiptEthProphecy
- type Oracle
- func (o *Oracle) GetConsensusThreshold() int64
- func (o *Oracle) GetLastTotalPower() (int64, error)
- func (o *Oracle) GetProphecy(id string) (*x2eTy.ReceiptEthProphecy, error)
- func (o *Oracle) GetValidatorArray() (*x2eTy.ValidatorList, error)
- func (o *Oracle) ProcessAddValidator(address string, power int64) (*types.Receipt, error)
- func (o *Oracle) ProcessBurn(address, amount string, accDB *account.DB) (*types.Receipt, error)
- func (o *Oracle) ProcessClaim(claim x2eTy.Eth2Chain33) (*x2eTy.ProphecyStatus, error)
- func (o *Oracle) ProcessLock(address, to, execAddr, amount string, accDB *account.DB) (*types.Receipt, error)
- func (o *Oracle) ProcessModifyValidator(address string, power int64) (*types.Receipt, error)
- func (o *Oracle) ProcessRemoveValidator(address string) (*types.Receipt, error)
- func (o *Oracle) ProcessSetConsensusNeeded(ConsensusThreshold int64) (int64, int64, error)
- func (o *Oracle) ProcessSuccessfulClaimForBurn(claim, execAddr, tokenSymbol string, accDB *account.DB) (*types.Receipt, error)
- func (o *Oracle) ProcessSuccessfulClaimForLock(claim, execAddr string, accDB *account.DB) (*types.Receipt, error)
- func (o *Oracle) SetConsensusThreshold(ConsensusThreshold int64)
- func (o *Oracle) SetLastTotalPower() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddClaim ¶
func AddClaim(prophecy *x2eTy.ReceiptEthProphecy, validator string, claim string)
AddClaim adds a given claim to this prophecy
func CreateOracleClaimFromEthClaim ¶
func CreateOracleClaimFromEthClaim(ethClaim x2eTy.Eth2Chain33) (x2eTy.OracleClaim, error)
CreateOracleClaimFromEthClaim 通过ethchain33结构构造一个OracleClaim结构,包括生成唯一的ID
func CreateOracleClaimFromOracleString ¶
func CreateOracleClaimFromOracleString(oracleClaimString string) (x2eTy.OracleClaimContent, error)
CreateOracleClaimFromOracleString --
func FindHighestClaim ¶
func FindHighestClaim(prophecy *x2eTy.ReceiptEthProphecy, validators map[string]int64) (string, int64, int64)
FindHighestClaim 遍历该prophecy所有claim,找出获得最多票数的claim
func NewClaim ¶
func NewClaim(id string, validatorAddress string, content string) x2eTy.OracleClaim
NewClaim ...
func NewOracleClaimContent ¶
func NewOracleClaimContent(chain33Receiver string, amount string, claimType, decimals int64) x2eTy.OracleClaimContent
NewOracleClaimContent ...
Types ¶
type Oracle ¶
type Oracle struct {
// contains filtered or unexported fields
}
Oracle ...
func (*Oracle) GetConsensusThreshold ¶
GetConsensusThreshold ...
func (*Oracle) GetLastTotalPower ¶
GetLastTotalPower Load the last total validator power.
func (*Oracle) GetProphecy ¶
func (o *Oracle) GetProphecy(id string) (*x2eTy.ReceiptEthProphecy, error)
GetProphecy ...
func (*Oracle) GetValidatorArray ¶
func (o *Oracle) GetValidatorArray() (*x2eTy.ValidatorList, error)
GetValidatorArray ...
func (*Oracle) ProcessAddValidator ¶
ProcessAddValidator ... 对于相同的地址该如何处理? 现有方案是相同地址就报错
func (*Oracle) ProcessBurn ¶
ProcessBurn processes the burn of bridged coins from the given sender
func (*Oracle) ProcessClaim ¶
func (o *Oracle) ProcessClaim(claim x2eTy.Eth2Chain33) (*x2eTy.ProphecyStatus, error)
ProcessClaim 处理接收到的ethchain33请求
func (*Oracle) ProcessLock ¶
func (o *Oracle) ProcessLock(address, to, execAddr, amount string, accDB *account.DB) (*types.Receipt, error)
ProcessLock processes the lockup of cosmos coins from the given sender accDB = mavl-coins-bty-addr
func (*Oracle) ProcessModifyValidator ¶
ProcessModifyValidator 这里的power指的是修改后的power
func (*Oracle) ProcessRemoveValidator ¶
ProcessRemoveValidator ...
func (*Oracle) ProcessSetConsensusNeeded ¶
ProcessSetConsensusNeeded ...
func (*Oracle) ProcessSuccessfulClaimForBurn ¶
func (o *Oracle) ProcessSuccessfulClaimForBurn(claim, execAddr, tokenSymbol string, accDB *account.DB) (*types.Receipt, error)
ProcessSuccessfulClaimForBurn 处理经过审核的关于Burn的claim
func (*Oracle) ProcessSuccessfulClaimForLock ¶
func (o *Oracle) ProcessSuccessfulClaimForLock(claim, execAddr string, accDB *account.DB) (*types.Receipt, error)
ProcessSuccessfulClaimForLock 处理经过审核的关于Lock的claim
func (*Oracle) SetConsensusThreshold ¶
SetConsensusThreshold ...
func (*Oracle) SetLastTotalPower ¶
SetLastTotalPower Set the last total validator power.