Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace ethers with viem #1037

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind if I ask you what happened to the timestamp?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not part of the transaction receipt from viem. Still need to figure out if there's a way for me to get that. Possibly by grabbing the block.

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