Skip to content

Commit

Permalink
dtl: overflow protection
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes committed Jun 3, 2021
1 parent cf76004 commit 2698fba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ const maybeDecodeSequencerBatchTransaction = (
const decodedTx = ethers.utils.parseTransaction(transaction)

return {
nonce: BigNumber.from(decodedTx.nonce).toNumber(),
gasPrice: BigNumber.from(decodedTx.gasPrice).toNumber(),
nonce: BigNumber.from(decodedTx.nonce).toString(),
gasPrice: BigNumber.from(decodedTx.gasPrice).toString(),
gasLimit: BigNumber.from(decodedTx.gasLimit).toString(),
value: toRpcHexString(decodedTx.value),
target: toHexString(decodedTx.to), // Maybe null this out for creations?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export const handleSequencerBlock = {
},
value: transaction.value,
gasLimit: BigNumber.from(transaction.gas).toString(),
gasPrice: BigNumber.from(transaction.gasPrice).toNumber(), // ?
nonce: BigNumber.from(transaction.nonce).toNumber(),
gasPrice: BigNumber.from(transaction.gasPrice).toString(),
nonce: BigNumber.from(transaction.nonce).toString(),
target: transaction.to,
data: transaction.input,
}
Expand Down
4 changes: 2 additions & 2 deletions packages/data-transport-layer/src/types/database-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export interface DecodedSequencerBatchTransaction {
}
value: string
gasLimit: string
gasPrice: number
nonce: number
gasPrice: string
nonce: string
target: string
data: string
}
Expand Down

0 comments on commit 2698fba

Please sign in to comment.