Skip to content

Commit

Permalink
Fix failed TON test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
10gic committed Aug 21, 2024
1 parent 0e1ceb1 commit e9f099d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class TestTheOpenNetworkSigner {
val privateKey = PrivateKey("c38f49de2fb13223a9e7d37d5d0ffbdd89a5eb7c8b0ee4d1c299f2cefe7dc4a0".toHexByteArray())

val transfer = TheOpenNetwork.Transfer.newBuilder()
.setWalletVersion(TheOpenNetwork.WalletVersion.WALLET_V4_R2)
.setDest("EQBm--PFwDv1yCeS-QTJ-L8oiUpqo9IT1BwgVptlSq3ts90Q")
.setAmount(10)
.setMode(TheOpenNetwork.SendMode.PAY_FEES_SEPARATELY_VALUE or TheOpenNetwork.SendMode.IGNORE_ACTION_PHASE_ERRORS_VALUE)
Expand All @@ -37,6 +36,7 @@ class TestTheOpenNetworkSigner {
.addMessages(transfer)
.setSequenceNumber(6)
.setExpireAt(1671132440)
.setWalletVersion(TheOpenNetwork.WalletVersion.WALLET_V4_R2)
.build()

val output = AnySigner.sign(input, CoinType.TON, SigningOutput.parser())
Expand All @@ -59,7 +59,6 @@ class TestTheOpenNetworkSigner {
.build()

val transfer = TheOpenNetwork.Transfer.newBuilder()
.setWalletVersion(TheOpenNetwork.WalletVersion.WALLET_V4_R2)
.setDest("EQBiaD8PO1NwfbxSkwbcNT9rXDjqhiIvXWymNO-edV0H5lja")
.setAmount(100 * 1000 * 1000)
.setMode(TheOpenNetwork.SendMode.PAY_FEES_SEPARATELY_VALUE or TheOpenNetwork.SendMode.IGNORE_ACTION_PHASE_ERRORS_VALUE)
Expand All @@ -72,6 +71,7 @@ class TestTheOpenNetworkSigner {
.addMessages(transfer)
.setSequenceNumber(1)
.setExpireAt(1787693046)
.setWalletVersion(TheOpenNetwork.WalletVersion.WALLET_V4_R2)
.build()

val output = AnySigner.sign(input, CoinType.TON, SigningOutput.parser())
Expand Down Expand Up @@ -103,7 +103,6 @@ class TestTheOpenNetworkSigner {
.build()

val transfer = TheOpenNetwork.Transfer.newBuilder()
.setWalletVersion(TheOpenNetwork.WalletVersion.WALLET_V4_R2)
.setDest(dogeChatbotDeployingAddress)
// 0.069 TON
.setAmount(69_000_000)
Expand All @@ -116,6 +115,7 @@ class TestTheOpenNetworkSigner {
.addMessages(transfer)
.setSequenceNumber(4)
.setExpireAt(1721939714)
.setWalletVersion(TheOpenNetwork.WalletVersion.WALLET_V4_R2)
.build()

val output = AnySigner.sign(input, CoinType.TON, SigningOutput.parser())
Expand Down
6 changes: 3 additions & 3 deletions swift/Tests/Blockchains/TheOpenNetworkTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class TheOpenNetworkTests: XCTestCase {
let privateKeyData = Data(hexString: "c38f49de2fb13223a9e7d37d5d0ffbdd89a5eb7c8b0ee4d1c299f2cefe7dc4a0")!

let transfer = TheOpenNetworkTransfer.with {
$0.walletVersion = TheOpenNetworkWalletVersion.walletV4R2
$0.dest = "EQBm--PFwDv1yCeS-QTJ-L8oiUpqo9IT1BwgVptlSq3ts90Q"
$0.amount = 10
$0.mode = UInt32(TheOpenNetworkSendMode.payFeesSeparately.rawValue | TheOpenNetworkSendMode.ignoreActionPhaseErrors.rawValue)
Expand All @@ -94,6 +93,7 @@ class TheOpenNetworkTests: XCTestCase {
$0.privateKey = privateKeyData
$0.sequenceNumber = 6
$0.expireAt = 1671132440
$0.walletVersion = TheOpenNetworkWalletVersion.walletV4R2
}

let output: TheOpenNetworkSigningOutput = AnySigner.sign(input: input, coin: .ton)
Expand All @@ -115,7 +115,6 @@ class TheOpenNetworkTests: XCTestCase {
}

let transfer = TheOpenNetworkTransfer.with {
$0.walletVersion = TheOpenNetworkWalletVersion.walletV4R2
$0.dest = "EQBiaD8PO1NwfbxSkwbcNT9rXDjqhiIvXWymNO-edV0H5lja"
$0.amount = 100 * 1000 * 1000
$0.mode = UInt32(TheOpenNetworkSendMode.payFeesSeparately.rawValue | TheOpenNetworkSendMode.ignoreActionPhaseErrors.rawValue)
Expand All @@ -129,6 +128,7 @@ class TheOpenNetworkTests: XCTestCase {
$0.privateKey = privateKeyData
$0.sequenceNumber = 1
$0.expireAt = 1787693046
$0.walletVersion = TheOpenNetworkWalletVersion.walletV4R2
}

let output: TheOpenNetworkSigningOutput = AnySigner.sign(input: input, coin: .ton)
Expand Down Expand Up @@ -159,7 +159,6 @@ class TheOpenNetworkTests: XCTestCase {
}

let transfer = TheOpenNetworkTransfer.with {
$0.walletVersion = TheOpenNetworkWalletVersion.walletV4R2
$0.dest = dogeChatbotDeployingAddress
// 0.069 TON
$0.amount = 69_000_000
Expand All @@ -173,6 +172,7 @@ class TheOpenNetworkTests: XCTestCase {
$0.privateKey = privateKeyData
$0.sequenceNumber = 4
$0.expireAt = 1721939714
$0.walletVersion = TheOpenNetworkWalletVersion.walletV4R2
}

let output: TheOpenNetworkSigningOutput = AnySigner.sign(input: input, coin: .ton)
Expand Down
8 changes: 4 additions & 4 deletions tests/chains/TheOpenNetwork/TWAnySignerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ namespace TW::TheOpenNetwork::tests {
TEST(TWAnySignerTheOpenNetwork, SingMessageToTransferAndDeployWalletV4R2) {
Proto::SigningInput input;

input.set_wallet_version(Proto::WALLET_V4_R2);

auto& transfer = *input.add_messages();
transfer.set_dest("EQDYW_1eScJVxtitoBRksvoV9cCYo4uKGWLVNIHB1JqRR3n0");
transfer.set_amount(10);
Expand All @@ -28,6 +26,8 @@ TEST(TWAnySignerTheOpenNetwork, SingMessageToTransferAndDeployWalletV4R2) {

input.set_expire_at(1671135440);

input.set_wallet_version(Proto::WALLET_V4_R2);

Proto::SigningOutput output;
ANY_SIGN(input, TWCoinTypeTON);

Expand All @@ -40,8 +40,6 @@ TEST(TWAnySignerTheOpenNetwork, SingMessageToTransferAndDeployWalletV4R2) {
TEST(TWAnySignerTheOpenNetwork, SingMessageToTransferAndDeployWalletV5R1) {
Proto::SigningInput input;

input.set_wallet_version(Proto::WALLET_V5_R1);

auto& transfer = *input.add_messages();
transfer.set_dest("EQBe6DtCpJZe8M4t-crMXe93JlEYgSl30S5OUuMSLOfeQfBu");
transfer.set_amount(10);
Expand All @@ -53,6 +51,8 @@ TEST(TWAnySignerTheOpenNetwork, SingMessageToTransferAndDeployWalletV5R1) {

input.set_expire_at(0xffffffff);

input.set_wallet_version(Proto::WALLET_V5_R1);

Proto::SigningOutput output;
ANY_SIGN(input, TWCoinTypeTON);

Expand Down
4 changes: 2 additions & 2 deletions wasm/tests/Blockchain/TheOpenNetwork.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ describe("TheOpenNetwork", () => {
let privateKeyData = HexCoding.decode("c38f49de2fb13223a9e7d37d5d0ffbdd89a5eb7c8b0ee4d1c299f2cefe7dc4a0");

let transfer = TW.TheOpenNetwork.Proto.Transfer.create({
walletVersion: TW.TheOpenNetwork.Proto.WalletVersion.WALLET_V4_R2,
dest: "EQBm--PFwDv1yCeS-QTJ-L8oiUpqo9IT1BwgVptlSq3ts90Q",
amount: new Long(10),
mode: (TW.TheOpenNetwork.Proto.SendMode.PAY_FEES_SEPARATELY | TW.TheOpenNetwork.Proto.SendMode.IGNORE_ACTION_PHASE_ERRORS),
Expand All @@ -83,6 +82,7 @@ describe("TheOpenNetwork", () => {
privateKey: PrivateKey.createWithData(privateKeyData).data(),
sequenceNumber: 6,
expireAt: 1671132440,
walletVersion: TW.TheOpenNetwork.Proto.WalletVersion.WALLET_V4_R2,
});

const encoded = TW.TheOpenNetwork.Proto.SigningInput.encode(input).finish();
Expand All @@ -108,7 +108,6 @@ describe("TheOpenNetwork", () => {
});

let transfer = TW.TheOpenNetwork.Proto.Transfer.create({
walletVersion: TW.TheOpenNetwork.Proto.WalletVersion.WALLET_V4_R2,
dest: "EQBiaD8PO1NwfbxSkwbcNT9rXDjqhiIvXWymNO-edV0H5lja",
amount: new Long(100 * 1000 * 1000),
mode: (TW.TheOpenNetwork.Proto.SendMode.PAY_FEES_SEPARATELY | TW.TheOpenNetwork.Proto.SendMode.IGNORE_ACTION_PHASE_ERRORS),
Expand All @@ -122,6 +121,7 @@ describe("TheOpenNetwork", () => {
privateKey: PrivateKey.createWithData(privateKeyData).data(),
sequenceNumber: 1,
expireAt: 1787693046,
walletVersion: TW.TheOpenNetwork.Proto.WalletVersion.WALLET_V4_R2,
});

const encoded = TW.TheOpenNetwork.Proto.SigningInput.encode(input).finish();
Expand Down

0 comments on commit e9f099d

Please sign in to comment.