/
types.go
45 lines (37 loc) · 1.12 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package ethtxs
import (
"math/big"
"github.com/33cn/plugin/plugin/dapp/cross2eth/ebrelayer/relayer/events"
"github.com/ethereum/go-ethereum/common"
)
//const ...
const (
EthNullAddr = "0x0000000000000000000000000000000000000000"
)
// OracleClaim : contains data required to make an OracleClaim
type OracleClaim struct {
ProphecyID *big.Int
Message [32]byte
Signature []byte
}
// ProphecyClaim : contains data required to make an ProphecyClaim
type ProphecyClaim struct {
ClaimType events.ClaimType
Chain33Sender []byte
EthereumReceiver common.Address
TokenContractAddress common.Address
Symbol string
Amount *big.Int
chain33TxHash []byte
}
type WithdrawStatus int32
const (
WDError = WithdrawStatus(1)
WDPending = WithdrawStatus(2)
WDFailed = WithdrawStatus(3)
WDSuccess = WithdrawStatus(4)
)
// 此处的名字命令不能随意改动,需要与合约event中的命名完全一致
func (d WithdrawStatus) String() string {
return [...]string{"undefined", "Error,not submitted to ethereum", "Pending", "Submitted to ethereum, but Failed", "Success"}[d]
}