Skip to content

Commit

Permalink
Move test vectors into one repo (#24)
Browse files Browse the repository at this point in the history
Co-authored-by: scdnj <[email protected]>
Co-authored-by: satokihanada <[email protected]>
  • Loading branch information
satokihanada and scdnj committed Jun 17, 2024
1 parent a501f93 commit d3f4a5b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 26 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,12 @@ jobs:
- 20
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
with:
submodules: recursive
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: ${{ matrix.node }}
- name: Cache Submodules
id: cache-submodule
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: |
test/vectors/ethereum-tests
test/vectors/ethers
test/vectors/viem
key: ${{ runner.os }}-submodules
- name: Update git submodules
if: steps.cache-submodule.outputs.cache-hit != 'true'
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
with:
submodules: recursive
- run: npm install
- run: npm run build --if-present
- run: npm test
Expand Down
12 changes: 3 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[submodule "test/vectors/ethereum-tests"]
path = test/vectors/ethereum-tests
url = https://github.com/ethereum/tests.git
[submodule "test/vectors/ethers"]
path = test/vectors/ethers
url = https://github.com/ethers-io/ethers.js.git
[submodule "test/vectors/viem"]
path = test/vectors/viem
url = https://github.com/wevm/viem.git
[submodule "test/vectors"]
path = test/vectors
url = https://github.com/paulmillr/eth-vectors.git
2 changes: 1 addition & 1 deletion benchmark/rlp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { compare, utils as butils } from 'micro-bmark';
import { RLP } from '@ethereumjs/rlp';
import { RLP as microrlp } from '../lib/esm/tx.js';
import { RLP as microrlp } from '../lib/esm/rlp.js';
import { Rlp as cubane } from '@hazae41/cubane';
import { Writable } from '@hazae41/binary';

Expand Down
2 changes: 1 addition & 1 deletion test/rlp.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { deepStrictEqual, throws } from 'node:assert';
import { describe, should } from 'micro-should';
import { hexToBytes } from '@noble/hashes/utils';
import { RLP } from '../lib/esm/tx.js';
import { RLP } from '../lib/esm/rlp.js';
import { ethHex, ethHexNoLeadingZero } from '../lib/esm/utils.js';
import { ENCODE_TESTS, DECODE_TESTS, INVALID } from './vectors/monorepo/rlp.js';
import { getEthersVectors, getViemVectors } from './util.js';
Expand Down
2 changes: 1 addition & 1 deletion test/tx.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { addr, Transaction, messenger } from '../lib/esm/index.js';
import { RawTx, RlpTx, __tests } from '../lib/esm/tx.js';
import { add0x, createDecimal, ethHex, formatters } from '../lib/esm/utils.js';
import { default as TX_VECTORS } from './vectors/transactions.json' assert { type: 'json' };
import { default as EIP155_VECTORS } from './vectors/eip155.json' assert { type: 'json' };
import { default as EIP155_VECTORS } from './vectors/eips/eip155.json' assert { type: 'json' };
import * as ethTests from './vectors/eth-tests-tx-vectors.js';
import { getEthersVectors, getViemVectors } from './util.js';

Expand Down

0 comments on commit d3f4a5b

Please sign in to comment.