Skip to content

Commit

Permalink
Upgrade to Appkit 4.0.8-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
bsc committed Feb 15, 2022
1 parent 5e4145c commit 7b61f14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repositories {

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.ergoplatform:ergo-appkit_2.11:4.0.6'
implementation 'org.ergoplatform:ergo-appkit_2.11:develop-71491aed-SNAPSHOT'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ private ReducedTransaction getReducedSendTx(boolean isMainNet, long amountToSend
RestApiErgoClient.getDefaultExplorerUrl(networkType)
).execute(ctx -> {
ErgoTreeContract contract = new ErgoTreeContract(recipient.getErgoAddress().script());
UnsignedTransaction unsignedTransaction = BoxOperations.putToContractTxUnsigned(ctx,
Collections.singletonList(sender),
contract, amountToSend, Collections.emptyList());
UnsignedTransaction unsignedTransaction = BoxOperations.createForSender(sender)
.withAmountToSpend(amountToSend)
.putToContractTxUnsigned(ctx, contract);
return ctx.newProverBuilder().build().reduce(unsignedTransaction, 0);
});
}
Expand All @@ -228,8 +228,10 @@ private ReducedTransaction getReducedTx(boolean isMainNet, long amountToSpend, L
RestApiErgoClient.getDefaultExplorerUrl(networkType)
).execute(ctx -> {

List<InputBox> boxesToSpend = BoxOperations.loadTop(ctx, Collections.singletonList(sender),
amountToSpend + MinFee, tokensToSpend);
List<InputBox> boxesToSpend = BoxOperations.createForSender(sender)
.withAmountToSpend(amountToSpend)
.withTokensToSpend(tokensToSpend)
.loadTop(ctx);

P2PKAddress changeAddress = sender.asP2PK();
UnsignedTransactionBuilder txB = ctx.newTxBuilder();
Expand Down

0 comments on commit 7b61f14

Please sign in to comment.