fix java contract paperkey parameter in commercial paper example

Signed-off-by: HousniAbdellatife <abdellatife.housni@gmail.com>
This commit is contained in:
HousniAbdellatife 2023-01-14 13:37:51 +01:00
parent a70547dd94
commit 95f5b9a908
2 changed files with 4 additions and 4 deletions

View file

@ -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);

View file

@ -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);