Skip to content

Commit

Permalink
add more oracle claim type (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
unclezoro authored Dec 27, 2022
1 parent 7f0fb6a commit 56e98bd
Showing 1 changed file with 63 additions and 8 deletions.
71 changes: 63 additions & 8 deletions types/msg/msg-oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@ var protoMetrics = map[sdk.IbcChannelID]map[CrossChainPackageType]func() interfa
AckCrossChainPackageType: noneExistPackageProto,
FailAckCrossChainPackageType: noneExistPackageProto,
},
sdk.IbcChannelID(4): {
SynCrossChainPackageType: func() interface{} {
return new(MirrorSynPackage)
},
AckCrossChainPackageType: noneExistPackageProto,
FailAckCrossChainPackageType: noneExistPackageProto,
},
sdk.IbcChannelID(5): {
SynCrossChainPackageType: func() interface{} {
return new(MirrorSyncSynPackage)
},
AckCrossChainPackageType: noneExistPackageProto,
FailAckCrossChainPackageType: noneExistPackageProto,
},
sdk.IbcChannelID(8): {
SynCrossChainPackageType: noneExistPackageProto,
AckCrossChainPackageType: func() interface{} {
Expand All @@ -167,6 +181,15 @@ var protoMetrics = map[sdk.IbcChannelID]map[CrossChainPackageType]func() interfa
AckCrossChainPackageType: noneExistPackageProto,
FailAckCrossChainPackageType: noneExistPackageProto,
},
sdk.IbcChannelID(16): {
SynCrossChainPackageType: func() interface{} {
return new(CrossStakeSynPackageFromBSC)
},
AckCrossChainPackageType: func() interface{} {
return new(CrossStakeRefundPackage)
},
FailAckCrossChainPackageType: noneExistPackageProto,
},
}

type ApproveBindSynPackage struct {
Expand All @@ -177,7 +200,7 @@ type ApproveBindSynPackage struct {
type BindSynPackage struct {
PackageType uint8
Bep2TokenSymbol [32]byte
ContractAddr [20]byte
ContractAddr SmartChainAddress
TotalSupply *big.Int
PeggyAmount *big.Int
Decimals uint8
Expand All @@ -187,28 +210,48 @@ type BindSynPackage struct {
type TransferOutRefundPackage struct {
Bep2TokenSymbol [32]byte
RefundAmount *big.Int
RefundAddr []byte
RefundAddr sdk.AccAddress
RefundReason uint32
}

type TransferOutSynPackage struct {
Bep2TokenSymbol [32]byte
ContractAddress [20]byte
ContractAddress SmartChainAddress
Amount *big.Int
Recipient [20]byte
RefundAddress []byte
Recipient SmartChainAddress
RefundAddress sdk.AccAddress
ExpireTime uint64
}

type TransferInSynPackage struct {
Bep2TokenSymbol [32]byte
ContractAddress [20]byte
ContractAddress SmartChainAddress
Amounts []*big.Int
ReceiverAddresses [][]byte
RefundAddresses [][20]byte
ReceiverAddresses []sdk.AccAddress
RefundAddresses []SmartChainAddress
ExpireTime uint64
}

type MirrorSynPackage struct {
MirrorSender SmartChainAddress
ContractAddr SmartChainAddress
BEP20Name [32]byte
BEP20Symbol [32]byte
BEP20TotalSupply *big.Int
BEP20Decimals uint8
MirrorFee *big.Int
ExpireTime uint64
}

type MirrorSyncSynPackage struct {
SyncSender SmartChainAddress
ContractAddr SmartChainAddress
BEP2Symbol [32]byte
BEP20TotalSupply *big.Int
SyncFee *big.Int
ExpireTime uint64
}

type CommonAckPackage struct {
Code uint32
}
Expand Down Expand Up @@ -238,6 +281,18 @@ type SideDowntimeSlashPackage struct {
SideTimestamp uint64 `json:"side_timestamp"`
}

type CrossStakeSynPackageFromBSC struct {
EventType uint8
ParamsBytes []byte
}

type CrossStakeRefundPackage struct {
EventType uint8
Recipient SmartChainAddress
Amount *big.Int
ErrorCode uint32
}

type CrossChainPackage struct {
PackageType CrossChainPackageType
RelayFee big.Int
Expand Down

0 comments on commit 56e98bd

Please sign in to comment.