@@ -56,22 +56,22 @@ var _ = Describe("Token EndToEnd", func() {
56
56
57
57
// expected token transaction returned by prover peer
58
58
expectedTokenTransaction = & token.TokenTransaction {
59
- Action : & token.TokenTransaction_PlainAction {
60
- PlainAction : & token.PlainTokenAction {
61
- Data : & token.PlainTokenAction_PlainImport {
62
- PlainImport : & token.PlainImport {
63
- Outputs : []* token.PlainOutput {{
59
+ Action : & token.TokenTransaction_TokenAction {
60
+ TokenAction : & token.TokenAction {
61
+ Data : & token.TokenAction_Issue {
62
+ Issue : & token.Issue {
63
+ Outputs : []* token.Token {{
64
64
Owner : & token.TokenOwner {Raw : []byte ("test-owner" )},
65
65
Type : "ABC123" ,
66
66
Quantity : 119 ,
67
67
}}}}}}}
68
68
expectedTransferTransaction = & token.TokenTransaction {
69
- Action : & token.TokenTransaction_PlainAction {
70
- PlainAction : & token.PlainTokenAction {
71
- Data : & token.PlainTokenAction_PlainTransfer {
72
- PlainTransfer : & token.PlainTransfer {
69
+ Action : & token.TokenTransaction_TokenAction {
70
+ TokenAction : & token.TokenAction {
71
+ Data : & token.TokenAction_Transfer {
72
+ Transfer : & token.Transfer {
73
73
Inputs : nil ,
74
- Outputs : []* token.PlainOutput {{
74
+ Outputs : []* token.Token {{
75
75
Owner : nil ,
76
76
Type : "ABC123" ,
77
77
Quantity : 119 ,
@@ -82,12 +82,12 @@ var _ = Describe("Token EndToEnd", func() {
82
82
},
83
83
}
84
84
expectedRedeemTransaction = & token.TokenTransaction {
85
- Action : & token.TokenTransaction_PlainAction {
86
- PlainAction : & token.PlainTokenAction {
87
- Data : & token.PlainTokenAction_PlainRedeem {
88
- PlainRedeem : & token.PlainTransfer {
85
+ Action : & token.TokenTransaction_TokenAction {
86
+ TokenAction : & token.TokenAction {
87
+ Data : & token.TokenAction_Redeem {
88
+ Redeem : & token.Transfer {
89
89
Inputs : nil ,
90
- Outputs : []* token.PlainOutput {
90
+ Outputs : []* token.Token {
91
91
{
92
92
Owner : nil ,
93
93
Type : "ABC123" ,
@@ -155,12 +155,12 @@ var _ = Describe("Token EndToEnd", func() {
155
155
Expect (err ).NotTo (HaveOccurred ())
156
156
recipientUser2 = & token.TokenOwner {Raw : recipientUser2Bytes }
157
157
tokensToIssue [0 ].Recipient = recipientUser2
158
- expectedTokenTransaction .GetPlainAction ().GetPlainImport ().Outputs [0 ].Owner = recipientUser2
158
+ expectedTokenTransaction .GetTokenAction ().GetIssue ().Outputs [0 ].Owner = recipientUser2
159
159
recipientUser1Bytes , err := getIdentity (network , peer , "User1" , "Org1MSP" )
160
160
Expect (err ).NotTo (HaveOccurred ())
161
161
recipientUser1 = & token.TokenOwner {Raw : recipientUser1Bytes }
162
- expectedTransferTransaction .GetPlainAction ().GetPlainTransfer ().Outputs [0 ].Owner = recipientUser1
163
- expectedRedeemTransaction .GetPlainAction ().GetPlainRedeem ().Outputs [1 ].Owner = recipientUser1
162
+ expectedTransferTransaction .GetTokenAction ().GetTransfer ().Outputs [0 ].Owner = recipientUser1
163
+ expectedRedeemTransaction .GetTokenAction ().GetRedeem ().Outputs [1 ].Owner = recipientUser1
164
164
165
165
networkRunner := network .NetworkGroupRunner ()
166
166
process = ifrit .Invoke (networkRunner )
@@ -199,7 +199,7 @@ var _ = Describe("Token EndToEnd", func() {
199
199
200
200
By ("transferring tokens to user1" )
201
201
tokenIDs := []* token.TokenId {{TxId : txID , Index : 0 }}
202
- expectedTransferTransaction .GetPlainAction ().GetPlainTransfer ().Inputs = tokenIDs
202
+ expectedTransferTransaction .GetTokenAction ().GetTransfer ().Inputs = tokenIDs
203
203
txID = RunTransferRequest (tClient , issuedTokens , recipientUser1 , expectedTransferTransaction )
204
204
205
205
By ("list tokens user 2" )
@@ -218,7 +218,7 @@ var _ = Describe("Token EndToEnd", func() {
218
218
219
219
By ("redeeming tokens user1" )
220
220
tokenIDs = []* token.TokenId {{TxId : txID , Index : 0 }}
221
- expectedRedeemTransaction .GetPlainAction ().GetPlainRedeem ().Inputs = tokenIDs
221
+ expectedRedeemTransaction .GetTokenAction ().GetRedeem ().Inputs = tokenIDs
222
222
quantityToRedeem := 50 // redeem 50 out of 119
223
223
RunRedeemRequest (tClient , issuedTokens , uint64 (quantityToRedeem ), expectedRedeemTransaction )
224
224
@@ -264,11 +264,11 @@ var _ = Describe("Token EndToEnd", func() {
264
264
Expect (err ).NotTo (HaveOccurred ())
265
265
recipientUser2 = & token.TokenOwner {Raw : recipientUser2Bytes }
266
266
tokensToIssue [0 ].Recipient = & token.TokenOwner {Raw : recipientUser2Bytes }
267
- expectedTokenTransaction .GetPlainAction ().GetPlainImport ().Outputs [0 ].Owner = recipientUser2
267
+ expectedTokenTransaction .GetTokenAction ().GetIssue ().Outputs [0 ].Owner = recipientUser2
268
268
recipientUser1Bytes , err := getIdentity (network , peer , "User1" , "Org1MSP" )
269
269
Expect (err ).NotTo (HaveOccurred ())
270
270
recipientUser1 = & token.TokenOwner {Raw : recipientUser1Bytes }
271
- expectedTransferTransaction .GetPlainAction ().GetPlainTransfer ().Outputs [0 ].Owner = & token.TokenOwner {Raw : recipientUser1Bytes }
271
+ expectedTransferTransaction .GetTokenAction ().GetTransfer ().Outputs [0 ].Owner = & token.TokenOwner {Raw : recipientUser1Bytes }
272
272
273
273
networkRunner := network .NetworkGroupRunner ()
274
274
process = ifrit .Invoke (networkRunner )
@@ -294,7 +294,7 @@ var _ = Describe("Token EndToEnd", func() {
294
294
295
295
By ("User2 transfers his token to User1" )
296
296
inputIDs := []* token.TokenId {{TxId : txID , Index : 0 }}
297
- expectedTransferTransaction .GetPlainAction ().GetPlainTransfer ().Inputs = inputIDs
297
+ expectedTransferTransaction .GetTokenAction ().GetTransfer ().Inputs = inputIDs
298
298
RunTransferRequest (tClient , issuedTokens , recipientUser1 , expectedTransferTransaction )
299
299
300
300
By ("User2 try to transfer again the same token already transferred before" )
@@ -326,12 +326,12 @@ var _ = Describe("Token EndToEnd", func() {
326
326
327
327
By ("User1 attempts to spend User2's tokens by submitting a token transaction directly" )
328
328
expectedTokenTransaction = & token.TokenTransaction {
329
- Action : & token.TokenTransaction_PlainAction {
330
- PlainAction : & token.PlainTokenAction {
331
- Data : & token.PlainTokenAction_PlainTransfer {
332
- PlainTransfer : & token.PlainTransfer {
329
+ Action : & token.TokenTransaction_TokenAction {
330
+ TokenAction : & token.TokenAction {
331
+ Data : & token.TokenAction_Transfer {
332
+ Transfer : & token.Transfer {
333
333
Inputs : []* token.TokenId {{TxId : txID , Index : 0 }},
334
- Outputs : []* token.PlainOutput {{
334
+ Outputs : []* token.Token {{
335
335
Owner : & token.TokenOwner {Raw : []byte ("test-owner" )},
336
336
Type : "ABC123" ,
337
337
Quantity : 119 ,
@@ -421,9 +421,9 @@ func RunTransferRequest(c *tokenclient.Client, inputTokens []*token.TokenOutput,
421
421
Expect (tokenTxid ).To (Equal (txid ))
422
422
423
423
// Verify the result
424
- Expect (tokenTx .GetPlainAction ().GetPlainTransfer ().GetInputs ()).ToNot (BeNil ())
425
- Expect (len (tokenTx .GetPlainAction ().GetPlainTransfer ().GetInputs ())).To (Equal (1 ))
426
- Expect (tokenTx .GetPlainAction ().GetPlainTransfer ().GetOutputs ()).ToNot (BeNil ())
424
+ Expect (tokenTx .GetTokenAction ().GetTransfer ().GetInputs ()).ToNot (BeNil ())
425
+ Expect (len (tokenTx .GetTokenAction ().GetTransfer ().GetInputs ())).To (Equal (1 ))
426
+ Expect (tokenTx .GetTokenAction ().GetTransfer ().GetOutputs ()).ToNot (BeNil ())
427
427
428
428
return txid
429
429
}
0 commit comments