-
Notifications
You must be signed in to change notification settings - Fork 1
/
orders.go
executable file
·80 lines (59 loc) · 2.08 KB
/
orders.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
package types
import (
"github.com/commitHub/commitBlockchain/types"
"github.com/commitHub/commitBlockchain/modules/negotiation"
)
type Order interface {
GetNegotiationID() negotiation.NegotiationID
SetNegotiationID(negotiation.NegotiationID)
GetAssetPegWallet() types.AssetPegWallet
SetAssetPegWallet(types.AssetPegWallet)
GetFiatPegWallet() types.FiatPegWallet
SetFiatPegWallet(types.FiatPegWallet)
GetFiatProofHash() string
SetFiatProofHash(string)
GetAWBProofHash() string
SetAWBProofHash(string)
}
type BaseOrder struct {
NegotiationID negotiation.NegotiationID `json:"negotiation_id"`
FiatPegWallet types.FiatPegWallet `json:"fiat_peg_wallet"`
AssetPegWallet types.AssetPegWallet `json:"asset_peg_wallet"`
FiatProofHash string `json:"fiat_proof_hash"`
AWBProofHash string `json:"awb_proof_hash"`
}
var _ Order = (*BaseOrder)(nil)
func ProtoBaseOrder() Order {
return &BaseOrder{}
}
func (baseOrder BaseOrder) GetNegotiationID() negotiation.NegotiationID {
return baseOrder.NegotiationID
}
func (baseOrder *BaseOrder) SetNegotiationID(negotiationID negotiation.NegotiationID) {
baseOrder.NegotiationID = negotiationID
}
func (baseOrder BaseOrder) GetAssetPegWallet() types.AssetPegWallet {
return baseOrder.AssetPegWallet
}
func (baseOrder *BaseOrder) SetAssetPegWallet(assetPegWallet types.AssetPegWallet) {
baseOrder.AssetPegWallet = assetPegWallet
}
func (baseOrder BaseOrder) GetFiatPegWallet() types.FiatPegWallet {
return baseOrder.FiatPegWallet
}
func (baseOrder *BaseOrder) SetFiatPegWallet(fiatPegWallet types.FiatPegWallet) {
baseOrder.FiatPegWallet = fiatPegWallet
}
func (baseOrder BaseOrder) GetFiatProofHash() string {
return baseOrder.FiatProofHash
}
func (baseOrder *BaseOrder) SetFiatProofHash(fiatProofHash string) {
baseOrder.FiatProofHash = fiatProofHash
}
func (baseOrder BaseOrder) GetAWBProofHash() string {
return baseOrder.AWBProofHash
}
func (baseOrder *BaseOrder) SetAWBProofHash(awbProofHash string) {
baseOrder.AWBProofHash = awbProofHash
}
type OrderDecoder func(orderBytes []byte) (Order, error)