Clean up struct def in Go

This commit is contained in:
J. Ayo Akinyele 2019-09-16 12:21:00 -04:00
parent 8672fdb40b
commit 05c16f4387
2 changed files with 10 additions and 14 deletions

View File

@ -98,13 +98,9 @@ To initialize state/keys for both parties, call the ``bidirectional::init_mercha
// initialize the merchant state and initialize with balance
let (mut channel_token, mut merch_state, mut channel_state) = bidirectional::init_merchant(rng, &mut channel_state, "Bob");
// initialize the balance for merch_state
merch_state.init_balance(b0_merch);
// generate the customer state using the channel token from the merchant
let mut cust_state = bidirectional::init_customer(rng, // rng
&mut channel_state, // channel state
&mut channel_token, // channel token
b0_cust, // init customer balance
b0_merch, // init merchant balance

View File

@ -59,7 +59,7 @@ type CustState struct {
Wpk string `json:"wpk"`
Wsk string `json:"wsk"`
OldKP *KP `json:"old_kp,omitempty"`
T []uint64 `json:"t"`
T []string `json:"t"`
Wallet Wallet `json:"wallet"`
WCom Commitment `json:"w_com"`
Index int `json:"index"`
@ -77,11 +77,11 @@ type Commitment struct {
}
type Wallet struct {
Pkc []uint64 `json:"pkc"`
Wpk []uint64 `json:"wpk"`
Pkc []string `json:"pkc"`
Wpk []string `json:"wpk"`
Bc int `json:"bc"`
Bm int `json:"bm"`
Close []uint64 `json:"close"`
Close []string `json:"close"`
}
type KeyPair struct {
@ -90,8 +90,8 @@ type KeyPair struct {
}
type SecretKey struct {
X []uint64 `json:"x"`
Y [][]uint64 `json:"y"`
X []string `json:"x"`
Y [][]string `json:"y"`
}
type PublicKey struct {
@ -140,10 +140,10 @@ type Message struct {
type CommitmentProof struct {
T string `json:"T"`
Z [][]uint64 `json:"z"`
Ts [][]uint64 `json:"t"`
Z [][]string `json:"z"`
Ts [][]string `json:"t"`
Index []int `json:"index"`
Reveal [][]uint64 `json:"reveal"`
Reveal [][]string `json:"reveal"`
}
type CustClose struct {