From 1dfa2fd4e72ac245faf4f8a9bbd38a40c7685a97 Mon Sep 17 00:00:00 2001 From: Torres-ssf Date: Mon, 6 Jan 2025 16:53:06 -0300 Subject: [PATCH] adjusting tests and fixtures --- .../account/src/providers/provider.test.ts | 4 ---- .../transaction-summary/operations.test.ts | 1 - .../src/providers/utils/receipts.test.ts | 22 +++++++++---------- .../test/fixtures/transaction-summary.ts | 3 --- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/packages/account/src/providers/provider.test.ts b/packages/account/src/providers/provider.test.ts index 85278eb880a..49cb704f0d4 100644 --- a/packages/account/src/providers/provider.test.ts +++ b/packages/account/src/providers/provider.test.ts @@ -361,10 +361,6 @@ describe('Provider', () => { { type: ReceiptType.Log, id: ZeroBytes32, - val0: bn(202), - val1: bn(186), - val2: bn(0), - val3: bn(0), ra: bn(202), rb: bn(186), rc: bn(0), diff --git a/packages/account/src/providers/transaction-summary/operations.test.ts b/packages/account/src/providers/transaction-summary/operations.test.ts index b6d7cae9b70..60248d760dd 100644 --- a/packages/account/src/providers/transaction-summary/operations.test.ts +++ b/packages/account/src/providers/transaction-summary/operations.test.ts @@ -881,7 +881,6 @@ describe('operations', () => { const expected: TransactionResultTransferOutReceipt = { amount: bn('0x5f5e100'), assetId: '0x0000000000000000000000000000000000000000000000000000000000000000', - from: '0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1', id: '0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1', is: bn('0x4370'), pc: bn('0x57dc'), diff --git a/packages/account/src/providers/utils/receipts.test.ts b/packages/account/src/providers/utils/receipts.test.ts index a4442148e52..b6f31bc00c0 100644 --- a/packages/account/src/providers/utils/receipts.test.ts +++ b/packages/account/src/providers/utils/receipts.test.ts @@ -37,7 +37,7 @@ describe('assembleReceiptByType', () => { expect(receipt.type).toBe(ReceiptType.Call); expect(receipt.assetId).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.assetId); - expect(receipt.from).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.contractId); + expect(receipt.id).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.contractId); expect(receipt.to).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.to); expect(receipt.amount).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.amount)); expect(receipt.gas).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.gas)); @@ -113,10 +113,10 @@ describe('assembleReceiptByType', () => { expect(receipt.id).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.contractId); expect(receipt.is).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.is)); expect(receipt.pc).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.pc)); - expect(receipt.val0).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.ra)); - expect(receipt.val1).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.rb)); - expect(receipt.val2).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.rc)); - expect(receipt.val3).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.rd)); + expect(receipt.ra).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.ra)); + expect(receipt.rb).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.rb)); + expect(receipt.rc).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.rc)); + expect(receipt.rd).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.rd)); }); it('should return a ReceiptLogData receipt when GqlReceiptType.LogData is provided', () => { @@ -132,8 +132,8 @@ describe('assembleReceiptByType', () => { expect(receipt.pc).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.pc)); expect(receipt.ptr).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.ptr)); expect(receipt.len).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.len)); - expect(receipt.val0).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.ra)); - expect(receipt.val1).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.rb)); + expect(receipt.ra).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.ra)); + expect(receipt.rb).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.rb)); expect(receipt.data).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.data); }); @@ -144,7 +144,7 @@ describe('assembleReceiptByType', () => { }) as ReceiptTransfer; expect(receipt.type).toBe(ReceiptType.Transfer); - expect(receipt.from).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.contractId); + expect(receipt.id).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.contractId); expect(receipt.to).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.to); expect(receipt.assetId).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.assetId); expect(receipt.is).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.is)); @@ -159,7 +159,7 @@ describe('assembleReceiptByType', () => { }) as ReceiptTransferOut; expect(receipt.type).toBe(ReceiptType.TransferOut); - expect(receipt.from).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.contractId); + expect(receipt.id).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.contractId); expect(receipt.to).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.toAddress); expect(receipt.assetId).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.assetId); expect(receipt.is).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.is)); @@ -174,7 +174,7 @@ describe('assembleReceiptByType', () => { }) as ReceiptTransferOut; expect(receipt.type).toBe(ReceiptType.TransferOut); - expect(receipt.from).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.contractId); + expect(receipt.id).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.contractId); expect(receipt.to).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.to); expect(receipt.assetId).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT.assetId); expect(receipt.is).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT.is)); @@ -189,7 +189,7 @@ describe('assembleReceiptByType', () => { }) as ReceiptTransferOut; expect(receipt.type).toBe(ReceiptType.TransferOut); - expect(receipt.from).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.contractId); + expect(receipt.id).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.contractId); expect(receipt.to).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.toAddress); expect(receipt.assetId).toStrictEqual(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.assetId); expect(receipt.is).toStrictEqual(new BN(MOCK_GQL_RECEIPT_FRAGMENT_TO_ADDRESS.is)); diff --git a/packages/account/test/fixtures/transaction-summary.ts b/packages/account/test/fixtures/transaction-summary.ts index 9ed7e2bd689..9b3b79cbc02 100644 --- a/packages/account/test/fixtures/transaction-summary.ts +++ b/packages/account/test/fixtures/transaction-summary.ts @@ -108,7 +108,6 @@ export const MOCK_OUTPUT_CONTRACT_CREATED: OutputContractCreated = { export const MOCK_RECEIPT_CALL: TransactionResultCallReceipt = { type: ReceiptType.Call, - from: '0x0000000000000000000000000000000000000000000000000000000000000000', id: '0x0000000000000000000000000000000000000000000000000000000000000000', to: '0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1', amount: bn(100000000), @@ -131,7 +130,6 @@ export const MOCK_RECEIPT_RETURN: TransactionResultReturnReceipt = { export const MOCK_RECEIPT_TRANSFER: TransactionResultTransferReceipt = { type: ReceiptType.Transfer, id: '0x0000000000000000000000000000000000000000000000000000000000000000', - from: '0x0000000000000000000000000000000000000000000000000000000000000000', to: '0xaab4884920fa4d3a35fc2977cc442b0caddf87e001ef62321b6c02f5ab0f4115', amount: bn(988), assetId: '0x0000000000000000000000000000000000000000000000000000000000000000', @@ -142,7 +140,6 @@ export const MOCK_RECEIPT_TRANSFER: TransactionResultTransferReceipt = { export const MOCK_RECEIPT_TRANSFER_OUT: TransactionResultTransferOutReceipt = { type: ReceiptType.TransferOut, id: '0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1', - from: '0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1', to: '0x3e7ddda4d0d3f8307ae5f1aed87623992c1c4decefec684936960775181b2302', amount: bn(100000000), assetId: '0x0000000000000000000000000000000000000000000000000000000000000000',