-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd.go
89 lines (72 loc) · 1.87 KB
/
cmd.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package pact
type Scheme string
const (
ED25519 Scheme = "ED25519"
ETH Scheme = "ETH"
)
type Meta struct {
ChainId string `json:"chainId"`
Sender string `json:"sender"`
GasLimit uint64 `json:"gasLimit"`
GasPrice float64 `json:"gasPrice"`
Ttl float64 `json:"ttl"`
CreationTime uint64 `json:"creationTime"`
}
type Signer struct {
Scheme Scheme `json:"scheme"`
PubKey string `json:"pubKey"`
Addr string `json:"addr"`
Caps string `json:"caps"`
}
type Exec struct {
Code string `json:"code"`
Data *interface{} `json:"data"`
}
func (Exec) PayloadType() {}
type Cont struct {
PactId string `json:"pactId"`
Rollback bool `json:"rollback"`
Step uint64 `json:"step"`
Data interface{} `json:"data"`
Proof string `json:"proof"`
}
func (Cont) PayloadType() {}
type PayloadType interface {
PayloadType()
}
type Payload struct {
Exec *Exec `json:"exec,omitempty"`
Cont *Cont `json:"cont,omitempty"`
}
type CommandField struct {
Nonce string `json:"nonce"`
Meta *Meta `json:"meta"`
Signers []Signer `json:"signers"`
Payload Payload `json:"payload"`
NetworkId string `json:"networkId,omitempty"`
}
type Sig struct {
Sig string `json:"sig,omitempty"`
}
type Command struct {
Cmd string `json:"cmd"`
Hash string `json:"hash"`
Sigs []Sig `json:"sigs"`
}
type SendCommand struct {
Cmds []Command `json:"cmds,omitempty"`
}
type SPVCommand struct {
RequestKey string `json:"requestKey"`
TargetChainId string `json:"targetChainId"`
}
type PactEvents struct {
Name string `json:"name,omitempty"`
Params interface{} `json:"params,omitempty"`
Module string `json:"module,omitempty"`
ModuleHash string `json:"moduleHash,omitempty"`
}
type Result struct {
Status string `json:"status,omitempty"`
Data interface{} `json:"data,omitempty"`
}