Skip to content

Commit

Permalink
[feat] Block OP stack System type (0x7E) transactions/receipts (#8)
Browse files Browse the repository at this point in the history
* Block OP stack system transactions

* Add tests

* Update workflow

* Remove goerli: no longer supported

* Increase timeouts
  • Loading branch information
ytham authored Apr 16, 2024
1 parent b64f4be commit a2d8e7f
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 290 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
- name: Test with Jest
run: |
export PROVIDER_URI=${{ secrets.PROVIDER_URI }}
export PROVIDER_URI_GOERLI=${{ secrets.PROVIDER_URI_GOERLI }}
export PROVIDER_URI_SEPOLIA=${{ secrets.PROVIDER_URI_SEPOLIA }}
export PROVIDER_URI_10=${{ secrets.PROVIDER_URI_10 }}
export PROVIDER_URI_8453=${{ secrets.PROVIDER_URI_8453 }}
export PINATA_JWT=${{ secrets.PINATA_JWT }}
export QUICKNODE_API_KEY=${{ secrets.QUICKNODE_API_KEY }}
export QUICKNODE_IPFS_URL=${{ secrets.QUICKNODE_IPFS_URL }}
Expand Down
9 changes: 5 additions & 4 deletions src/codec/v2/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ export enum ReceiptField {
}

export enum TxType {
Legacy,
Eip2930,
Eip1559,
Eip4844,
Legacy = 0,
Eip2930 = 1,
Eip1559 = 2,
Eip4844 = 3,
OpSystem = 126, // 0x7E
}
6 changes: 6 additions & 0 deletions src/rpc/subqueryField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ export async function getTxFieldValue(
if (type === TxType.Eip4844) {
logger.error(`EIP-4844 transactions are not yet supported`);
return null;
} else if (type === TxType.OpSystem) {
logger.error(`OP stack System transactions are not yet supported`);
return null;
}
const value = getValue(tx, type);

Expand Down Expand Up @@ -487,6 +490,9 @@ export async function getReceiptFieldValue(
if (Number(receipt?.type) === TxType.Eip4844) {
logger.error(`EIP-4844 transaction receipts are not yet supported`);
return null;
} else if (Number(receipt?.type) === TxType.OpSystem) {
logger.error(`OP stack System transaction receipts are not yet supported`);
return null;
}

const value = getValue(receipt);
Expand Down
6 changes: 3 additions & 3 deletions test/ipfs/scenarios.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe("Additional IPFS scenarios to test", () => {
};
}
}
}, 30000);
}, 50000);

test(`Read all pinned data`, async () => {
for await (const client of ipfsClients) {
Expand All @@ -64,7 +64,7 @@ describe("Additional IPFS scenarios to test", () => {
}
}
}
}, 30000);
}, 50000);

test(`Unpin all data`, async () => {
for await (const client of ipfsClients) {
Expand All @@ -73,5 +73,5 @@ describe("Additional IPFS scenarios to test", () => {
expect(unpin.value as boolean).toEqual(true);
}
}
}, 30000);
}, 50000);
});
282 changes: 0 additions & 282 deletions test/rpc/chainDataGoerli.test.ts

This file was deleted.

Loading

0 comments on commit a2d8e7f

Please sign in to comment.