From e65bf2431130fe05a6cfb008fb0b32395af5560c Mon Sep 17 00:00:00 2001 From: neodiX Date: Tue, 3 Sep 2024 13:33:39 +0400 Subject: [PATCH] minor cleanup --- .../java/smartcontract/wallet/v5/WalletV5.java | 15 +++++---------- ...tWalletV5Extensions.java => TestWalletV5.java} | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) rename smartcontract/src/test/java/org/ton/java/smartcontract/integrationtests/{TestWalletV5Extensions.java => TestWalletV5.java} (99%) diff --git a/smartcontract/src/main/java/org/ton/java/smartcontract/wallet/v5/WalletV5.java b/smartcontract/src/main/java/org/ton/java/smartcontract/wallet/v5/WalletV5.java index be84549d..decf3318 100644 --- a/smartcontract/src/main/java/org/ton/java/smartcontract/wallet/v5/WalletV5.java +++ b/smartcontract/src/main/java/org/ton/java/smartcontract/wallet/v5/WalletV5.java @@ -114,11 +114,10 @@ public Message prepareDeployMsg(WalletV5Config conf) { .dstAddr(getAddressIntStd()) .build()) .init(getStateInit()) -// .body(CellBuilder.beginCell() -// .storeBytes(Utils.signData(keyPair.getPublicKey(), keyPair.getSecretKey(), body.hash())) -// .storeCell(body) -// .endCell()) - .body(body) + .body(CellBuilder.beginCell() + .storeCell(body) + .storeBytes(Utils.signData(keyPair.getPublicKey(), keyPair.getSecretKey(), body.hash())) + .endCell()) .build(); } @@ -132,7 +131,7 @@ public Message prepareExternalMsg(WalletV5Config config) { } public Cell createTransferBody(WalletV5Config config) { - Cell body = CellBuilder.beginCell() + return CellBuilder.beginCell() .storeUint(0x7369676e, 32) .storeUint(config.getWalletId(), SIZE_WALLET_ID) .storeUint((config.getValidUntil() == 0) ? Instant.now().getEpochSecond() + 60 : config.getValidUntil(), SIZE_VALID_UNTIL) @@ -140,10 +139,6 @@ public Cell createTransferBody(WalletV5Config config) { // .storeCell(storeWalletActions(config.getExtensions())) // innerRequest .storeBit(false) // for now empty .endCell(); - - return CellBuilder.beginCell() - .storeCell(body) - .storeBytes(Utils.signData(keyPair.getPublicKey(), keyPair.getSecretKey(), body.hash())).endCell(); } private Cell storeWalletActions(WalletActions walletActions) { diff --git a/smartcontract/src/test/java/org/ton/java/smartcontract/integrationtests/TestWalletV5Extensions.java b/smartcontract/src/test/java/org/ton/java/smartcontract/integrationtests/TestWalletV5.java similarity index 99% rename from smartcontract/src/test/java/org/ton/java/smartcontract/integrationtests/TestWalletV5Extensions.java rename to smartcontract/src/test/java/org/ton/java/smartcontract/integrationtests/TestWalletV5.java index 8fa9a70a..2eb493a2 100644 --- a/smartcontract/src/test/java/org/ton/java/smartcontract/integrationtests/TestWalletV5Extensions.java +++ b/smartcontract/src/test/java/org/ton/java/smartcontract/integrationtests/TestWalletV5.java @@ -24,7 +24,7 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat; @Slf4j -public class TestWalletV5Extensions extends CommonTest { +public class TestWalletV5 extends CommonTest { // TonHashMapE x = new TonHashMapE(10); // Address addr1 = Address.of("0:2cf55953e92efbeadab7ba725c3f93a0b23f842cbba72d7b8e6f510a70e422e3"); // Address addr2 = Address.of("0:0000000000000000000000000000000000000000000000000000000000000000");