Skip to content

Commit

Permalink
adjusting tests and fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf committed Jan 6, 2025
1 parent e586a4d commit 1dfa2fd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
4 changes: 0 additions & 4 deletions packages/account/src/providers/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,6 @@ describe('operations', () => {
const expected: TransactionResultTransferOutReceipt = {
amount: bn('0x5f5e100'),
assetId: '0x0000000000000000000000000000000000000000000000000000000000000000',
from: '0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1',
id: '0x0a98320d39c03337401a4e46263972a9af6ce69ec2f35a5420b1bd35784c74b1',
is: bn('0x4370'),
pc: bn('0x57dc'),
Expand Down
22 changes: 11 additions & 11 deletions packages/account/src/providers/utils/receipts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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', () => {
Expand All @@ -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);
});

Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand Down
3 changes: 0 additions & 3 deletions packages/account/test/fixtures/transaction-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit 1dfa2fd

Please sign in to comment.