Skip to content

Commit 9afb954

Browse files
committed
feat: replace ethers with viem
1 parent dd8beec commit 9afb954

10 files changed

+817
-959
lines changed

package-lock.json

Lines changed: 197 additions & 155 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"cors": "^2.8.5",
6767
"dag-jose": "^4.0.0",
6868
"dotenv": "^16.0.3",
69-
"ethers": "~5.7.2",
69+
"exponential-backoff": "^3.1.1",
7070
"express": "^4.18.1",
7171
"http-status-codes": "^2.2.0",
7272
"ipfs-http-client": "^60.0.0",
@@ -84,7 +84,8 @@
8484
"tsm": "^2.2.2",
8585
"typed-inject": "^4.0.0",
8686
"uint8arrays": "^4.0.3",
87-
"uuid": "^9.0.0"
87+
"uuid": "^9.0.0",
88+
"viem": "^0.3.49"
8889
},
8990
"devDependencies": {
9091
"@babel/core": "^7.21.0",

src/models/transaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export class Transaction {
22
chain: string
33
txHash: string
4-
blockNumber: number
5-
blockTimestamp: number
4+
blockNumber: bigint
5+
blockTimestamp: bigint
66

7-
constructor(chain: string, txHash: string, blockNumber: number, blockTimestamp: number) {
7+
constructor(chain: string, txHash: string, blockNumber: bigint, blockTimestamp: bigint) {
88
this.chain = chain
99
this.txHash = txHash
1010
this.blockNumber = blockNumber
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`TransactionStateMachine with mocks get block fails due to timeout 1`] = `
4+
Transaction {
5+
"blockNumber": 1n,
6+
"blockTimestamp": 0n,
7+
"chain": "test",
8+
"txHash": "0xdeadbeef",
9+
}
10+
`;
11+
12+
exports[`TransactionStateMachine with mocks no errors encountered 1`] = `
13+
Transaction {
14+
"blockNumber": 1n,
15+
"blockTimestamp": 0n,
16+
"chain": "test",
17+
"txHash": "0xdeadbeef",
18+
}
19+
`;
20+
21+
exports[`TransactionStateMachine with mocks simulate fails due to timeout 1`] = `
22+
Transaction {
23+
"blockNumber": 1n,
24+
"blockTimestamp": 0n,
25+
"chain": "test",
26+
"txHash": "0xdeadbeef",
27+
}
28+
`;
29+
30+
exports[`TransactionStateMachine with mocks transaction receipt fails due to timeout 1`] = `
31+
Transaction {
32+
"blockNumber": 1n,
33+
"blockTimestamp": 0n,
34+
"chain": "test",
35+
"txHash": "0xdeadbeef",
36+
}
37+
`;
38+
39+
exports[`TransactionStateMachine with mocks write fails due to timeout 1`] = `
40+
Transaction {
41+
"blockNumber": 1n,
42+
"blockTimestamp": 0n,
43+
"chain": "test",
44+
"txHash": "0xdeadbeef",
45+
}
46+
`;

0 commit comments

Comments
 (0)