Skip to content

Commit

Permalink
feat: replace ethers with viem
Browse files Browse the repository at this point in the history
  • Loading branch information
dbcfd committed Jun 7, 2023
1 parent dd8beec commit 9afb954
Show file tree
Hide file tree
Showing 10 changed files with 817 additions and 959 deletions.
352 changes: 197 additions & 155 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"cors": "^2.8.5",
"dag-jose": "^4.0.0",
"dotenv": "^16.0.3",
"ethers": "~5.7.2",
"exponential-backoff": "^3.1.1",
"express": "^4.18.1",
"http-status-codes": "^2.2.0",
"ipfs-http-client": "^60.0.0",
Expand All @@ -84,7 +84,8 @@
"tsm": "^2.2.2",
"typed-inject": "^4.0.0",
"uint8arrays": "^4.0.3",
"uuid": "^9.0.0"
"uuid": "^9.0.0",
"viem": "^0.3.49"
},
"devDependencies": {
"@babel/core": "^7.21.0",
Expand Down
6 changes: 3 additions & 3 deletions src/models/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export class Transaction {
chain: string
txHash: string
blockNumber: number
blockTimestamp: number
blockNumber: bigint
blockTimestamp: bigint

constructor(chain: string, txHash: string, blockNumber: number, blockTimestamp: number) {
constructor(chain: string, txHash: string, blockNumber: bigint, blockTimestamp: bigint) {
this.chain = chain
this.txHash = txHash
this.blockNumber = blockNumber
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`TransactionStateMachine with mocks get block fails due to timeout 1`] = `
Transaction {
"blockNumber": 1n,
"blockTimestamp": 0n,
"chain": "test",
"txHash": "0xdeadbeef",
}
`;

exports[`TransactionStateMachine with mocks no errors encountered 1`] = `
Transaction {
"blockNumber": 1n,
"blockTimestamp": 0n,
"chain": "test",
"txHash": "0xdeadbeef",
}
`;

exports[`TransactionStateMachine with mocks simulate fails due to timeout 1`] = `
Transaction {
"blockNumber": 1n,
"blockTimestamp": 0n,
"chain": "test",
"txHash": "0xdeadbeef",
}
`;

exports[`TransactionStateMachine with mocks transaction receipt fails due to timeout 1`] = `
Transaction {
"blockNumber": 1n,
"blockTimestamp": 0n,
"chain": "test",
"txHash": "0xdeadbeef",
}
`;

exports[`TransactionStateMachine with mocks write fails due to timeout 1`] = `
Transaction {
"blockNumber": 1n,
"blockTimestamp": 0n,
"chain": "test",
"txHash": "0xdeadbeef",
}
`;
Loading

0 comments on commit 9afb954

Please sign in to comment.