fix java contract paperkey parameter in commercial paper example (#905)

Signed-off-by: HousniAbdellatife <abdellatife.housni@gmail.com>
This commit is contained in:
HousniAbdellatife 2023-01-25 14:48:10 +01:00 committed by GitHub
parent 9b1de5e0b1
commit 406d7e9d36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);