-
Notifications
You must be signed in to change notification settings - Fork 131
Conversation
Otherways alert when define object with key = null for the test https://web3js.readthedocs.io/en/1.0/web3-eth.html?highlight=block#id50
@@ -58,7 +58,7 @@ export interface ITransaction { | |||
blockHash: string | null, | |||
blockNumber: number, | |||
from: string, | |||
gas: string, | |||
gas: number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this changes return value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial gas
type was defined wrong. It does not return value, it used as an interface.
const from = String(transaction.from).toLowerCase(); | ||
const to = String(transaction.to).toLowerCase(); | ||
const to: string = transaction.to === null ? "" : String(transaction.to).toLowerCase(); | ||
const addresses: string[] = to ? [from, to] : [from]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if to
== null, then contract
should exist and you need to save contract
address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at this point, later in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do it now, that's the whole point of this change
const from = String(transaction.from).toLowerCase(); | ||
const to = String(transaction.to).toLowerCase(); | ||
const to: string = transaction.to === null ? "" : String(transaction.to).toLowerCase(); | ||
const addresses: string[] = to ? [from, to] : [from]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you do flatMap instead? [from, to].flatMap()
- it will remove null
No description provided.