Skip to content

Commit

Permalink
Fix tests etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Oct 14, 2024
1 parent e0f9e00 commit 4a26142
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("test relayed transactions factory (on localnet)", function () {
({ alice, carol, heidi, judy } = await loadTestWallets());
});

it.skip("should create relayed v3 transaction", async function () {
it("should create relayed v3 transaction", async function () {
this.timeout(120000);

await alice.sync(networkProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,63 +38,58 @@ describe("test smart contract transactions outcome parser on devnet", () => {
assert.lengthOf(parsedGivenTransactionOnNetwork.contracts, 0);
});

it("should parse outcome of relayed V3 inner transactions (1)", async () => {
it.skip("should parse outcome of relayed V3 inner transactions (1)", async () => {
const transactionHash = "c798e8c03d93aa4e3425f63fe020572304305e2017b1053c9f4e56f2c46bafd7";
const transactionOnNetwork = await networkProvider.getTransaction(transactionHash);
const outcomes = transactionsConverter.transactionOnNetworkToOutcomesOfInnerTransactions(transactionOnNetwork);

const parsed = parser.parseExecute({ transactionOutcome: outcomes[0] });
const parsed = parser.parseExecute({ transactionOnNetwork: transactionOnNetwork.innerTransactions![0] });
assert.deepEqual(parsed.values, [Buffer.from([1])]);
assert.equal(parsed.returnCode, "ok");
assert.equal(parsed.returnMessage, "ok");
});

// Will work upon the fix on Node's side (so that SCRs have as "originalTxHash" the inner transaction itself).
it.skip("should parse outcome of relayed V3 inner transactions (2)", async () => {
const transactionHash = "eaf80014f1b413191ac6a04a81c3751c5563aff246021f4f7c4ba9723fa3b536";
const transactionOnNetwork = await networkProvider.getTransaction(transactionHash);
const outcomes = transactionsConverter.transactionOnNetworkToOutcomesOfInnerTransactions(transactionOnNetwork);

let parsed = parser.parseExecute({ transactionOutcome: outcomes[0] });
let parsed = parser.parseExecute({ transactionOnNetwork: transactionOnNetwork.innerTransactions![0] });
assert.deepEqual(parsed.values, [Buffer.from([42]), Buffer.from([43]), Buffer.from([44])]);
assert.equal(parsed.returnCode, "ok");
assert.equal(parsed.returnMessage, "ok");

parsed = parser.parseExecute({ transactionOutcome: outcomes[1] });
parsed = parser.parseExecute({ transactionOnNetwork: transactionOnNetwork.innerTransactions![1] });
assert.deepEqual(parsed.values, []);
assert.equal(parsed.returnCode, "");
assert.equal(parsed.returnMessage, "");
});

it("should parse outcome of relayed V3 inner transactions (3)", async () => {
it.skip("should parse outcome of relayed V3 inner transactions (3)", async () => {
const transactionHash = "d241307c92c66cfe8ce723656d8b2c47a4a4f9e457eec305155debba6c92ca1b";
const transactionOnNetwork = await networkProvider.getTransaction(transactionHash);
const outcomes = transactionsConverter.transactionOnNetworkToOutcomesOfInnerTransactions(transactionOnNetwork);

let parsed = parser.parseExecute({ transactionOutcome: outcomes[0] });
let parsed = parser.parseExecute({ transactionOnNetwork: transactionOnNetwork.innerTransactions![0] });
assert.deepEqual(parsed.values, [Buffer.from([42]), Buffer.from([43]), Buffer.from([44])]);
assert.equal(parsed.returnCode, "ok");
assert.equal(parsed.returnMessage, "ok");

// Signal error is not recoverable (for the moment).
parsed = parser.parseExecute({ transactionOutcome: outcomes[1] });
parsed = parser.parseExecute({ transactionOnNetwork: transactionOnNetwork.innerTransactions![1] });
assert.deepEqual(parsed.values, []);
assert.equal(parsed.returnCode, "");
assert.equal(parsed.returnMessage, "");
});

it("should parse outcome of relayed V3 inner transactions (4)", async () => {
it.skip("should parse outcome of relayed V3 inner transactions (4)", async () => {
const transactionHash = "4bb3bc0f069fe4cf6a19750db026cca0968b224a59a2bfe6eee834c19d73cb80";
const transactionOnNetwork = await networkProvider.getTransaction(transactionHash);
const outcomes = transactionsConverter.transactionOnNetworkToOutcomesOfInnerTransactions(transactionOnNetwork);

let parsed = parser.parseExecute({ transactionOutcome: outcomes[0] });
let parsed = parser.parseExecute({ transactionOnNetwork: transactionOnNetwork.innerTransactions![0] });
assert.deepEqual(parsed.values, [Buffer.from([42]), Buffer.from([43]), Buffer.from([44])]);
assert.equal(parsed.returnCode, "ok");
assert.equal(parsed.returnMessage, "ok");

// Signal error is not recoverable (for the moment).
parsed = parser.parseExecute({ transactionOutcome: outcomes[1] });
parsed = parser.parseExecute({ transactionOnNetwork: transactionOnNetwork.innerTransactions![1] });
assert.deepEqual(parsed.values, [Buffer.from([42]), Buffer.from([43]), Buffer.from([44])]);
assert.equal(parsed.returnCode, "ok");
assert.equal(parsed.returnMessage, "ok");
Expand Down

0 comments on commit 4a26142

Please sign in to comment.