Skip to content

Commit 307585d

Browse files
wenjianqiaoyacovm
authored andcommitted
[FAB-11679] Prover: RedeemRequest
- Add proto messages for redeem to prover and token transaction - Add RequestRedeem method to prover.go - Update transactor local interface - Unit tests with mocked transactor Change-Id: I1ea77d4b48af2152cc546720c21f7d61fe388fa3 Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
1 parent c49f827 commit 307585d

File tree

9 files changed

+459
-112
lines changed

9 files changed

+459
-112
lines changed

protos/token/prover.pb.go

Lines changed: 165 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/token/prover.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ message TransferRequest {
7676
repeated RecipientTransferShare shares = 3;
7777
}
7878

79+
// RedeemRequest is used to request token redemption
80+
message RedeemRequest {
81+
// Credential contains information for the party who is requesting the operation
82+
// The content of this field depends on the characteristic of token manager system
83+
bytes credential = 1;
84+
85+
// token_ids specifies the ids for the tokens that will be redeemed
86+
repeated bytes token_ids = 2;
87+
88+
// quantity refers to the number of units of a given token needs to be redeemed.
89+
uint64 quantity_to_redeem = 3;
90+
}
91+
7992
// Header is a generic replay prevention and identity message to include in a signed command
8093
message Header {
8194
// Timestamp is the local time when the message was created
@@ -105,6 +118,7 @@ message Command {
105118
ImportRequest import_request = 2;
106119
TransferRequest transfer_request = 3;
107120
ListRequest list_request = 4;
121+
RedeemRequest redeem_request = 5;
108122
}
109123
}
110124

protos/token/transaction.pb.go

Lines changed: 75 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/token/transaction.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ message PlainTokenAction {
6767
PlainImport plain_import = 1;
6868
// A plaintext token transfer transaction
6969
PlainTransfer plain_transfer = 2;
70+
// A plaintext token redeem transaction
71+
PlainTransfer plain_redeem = 3;
7072
}
7173
}
7274

token/server/mock/transactor.go

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)