mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 07:25:10 +00:00
fix java contract paperkey parameter in commercial paper example (#905)
Signed-off-by: HousniAbdellatife <abdellatife.housni@gmail.com>
This commit is contained in:
parent
9b1de5e0b1
commit
406d7e9d36
2 changed files with 4 additions and 4 deletions
|
|
@ -107,7 +107,7 @@ public class CommercialPaperContract implements ContractInterface {
|
|||
String newOwner, int price, String purchaseDateTime) {
|
||||
|
||||
// Retrieve the current paper using key fields provided
|
||||
String paperKey = State.makeKey(new String[] { paperNumber });
|
||||
String paperKey = State.makeKey(new String[] { issuer, paperNumber });
|
||||
CommercialPaper paper = ctx.paperList.getPaper(paperKey);
|
||||
|
||||
// Validate current owner
|
||||
|
|
@ -146,7 +146,7 @@ public class CommercialPaperContract implements ContractInterface {
|
|||
public CommercialPaper redeem(CommercialPaperContext ctx, String issuer, String paperNumber, String redeemingOwner,
|
||||
String redeemDateTime) {
|
||||
|
||||
String paperKey = CommercialPaper.makeKey(new String[] { paperNumber });
|
||||
String paperKey = CommercialPaper.makeKey(new String[] { issuer, paperNumber });
|
||||
|
||||
CommercialPaper paper = ctx.paperList.getPaper(paperKey);
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public class CommercialPaperContract implements ContractInterface {
|
|||
String newOwner, int price, String purchaseDateTime) {
|
||||
|
||||
// Retrieve the current paper using key fields provided
|
||||
String paperKey = State.makeKey(new String[] { paperNumber });
|
||||
String paperKey = State.makeKey(new String[] { issuer, paperNumber });
|
||||
CommercialPaper paper = ctx.paperList.getPaper(paperKey);
|
||||
|
||||
// Validate current owner
|
||||
|
|
@ -146,7 +146,7 @@ public class CommercialPaperContract implements ContractInterface {
|
|||
public CommercialPaper redeem(CommercialPaperContext ctx, String issuer, String paperNumber, String redeemingOwner,
|
||||
String redeemDateTime) {
|
||||
|
||||
String paperKey = CommercialPaper.makeKey(new String[] { paperNumber });
|
||||
String paperKey = CommercialPaper.makeKey(new String[] {issuer, paperNumber });
|
||||
|
||||
CommercialPaper paper = ctx.paperList.getPaper(paperKey);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue