Skip to content

Commit 385c149

Browse files
authored
Merge pull request #21 from ftsrg/fix-20-payment
2 parents d480a0a + c549ac5 commit 385c149

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

smart-contract/hyperledger-fabric/v2/java/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ tasks.withType<JavaCompile>().configureEach {
8080
else -> "rac"
8181
}
8282
options.isFork = true
83-
options.compilerArgs.addAll(listOf("-jml", "-$mode", "-timeout", "30", "--nullable-by-default", "--specs-path", "specs/"))
83+
options.compilerArgs.addAll(
84+
listOf(
85+
"-jml", "-$mode", "-timeout", "30", "--nullable-by-default", "--specs-path", "specs/"))
8486
options.forkOptions.javaHome = openJMLJavaHomeDir.asFile
8587
}
8688
}

smart-contract/hyperledger-fabric/v2/java/src/main/java/hu/bme/mit/ftsrg/chaincode/tpcc/TPCC.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ private PaymentOutput payment(final TPCCContext ctx, final PaymentInput input)
785785
.fromWarehouse(warehouse)
786786
.fromCustomer(customer)
787787
.fromDistrict(district)
788+
.fromHistory(history)
788789
.build();
789790
if (customer.getC_credit().equals("BC"))
790791
output.setC_data(customer.getC_data().substring(0, 200));

smart-contract/hyperledger-fabric/v2/java/src/main/java/hu/bme/mit/ftsrg/chaincode/tpcc/data/output/PaymentOutput.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import hu.bme.mit.ftsrg.chaincode.tpcc.TPCC;
66
import hu.bme.mit.ftsrg.chaincode.tpcc.data.entity.Customer;
77
import hu.bme.mit.ftsrg.chaincode.tpcc.data.entity.District;
8+
import hu.bme.mit.ftsrg.chaincode.tpcc.data.entity.History;
89
import hu.bme.mit.ftsrg.chaincode.tpcc.data.entity.Warehouse;
910
import hu.bme.mit.ftsrg.chaincode.tpcc.middleware.TPCCContext;
1011
import lombok.EqualsAndHashCode;
@@ -667,6 +668,12 @@ public DoPaymentOutputBuilder fromCustomer(final Customer customer) {
667668
return this;
668669
}
669670

671+
public DoPaymentOutputBuilder fromHistory(final History history) {
672+
this.h_amount = history.getH_amount();
673+
this.h_date = history.getH_date();
674+
return this;
675+
}
676+
670677
public PaymentOutput build() {
671678
return new PaymentOutput(
672679
this.w_id,

0 commit comments

Comments
 (0)