-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
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.
I don't like how the getAddressType
is implemented - that would be not nice even to test/present as it is inconsistent. See the comment. Could we figure out something better for the time being?
lib/chain.ts
Outdated
export function getAddressType(_address: string) { | ||
if (Math.random() < 0.5) { | ||
return "account"; | ||
} | ||
|
||
return Math.random() < 0.5 ? "contract" : "validator"; | ||
} |
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.
Could we mock it in a different way? That would be consistent between renders. Even a file with the list of contract addresses and validator addresses to hardcode/configure those temporarily would be better for testing and presentation purposes.
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.
Good point, maybe checking if the address contains some characters? That way it'd work for any address instead of those on a list
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.
I was thinking this way too. Anything predictable would work, I think.
d7be3ce
to
63e62d3
Compare
7df2983
to
797d173
Compare
63e62d3
to
0fa660c
Compare
797d173
to
357a589
Compare
Closes #2.
Adds a mock function that randomly tells you if an address is an account, a contract, or a validator. The diagram renders differently depending on that type of address.
An account sends to a contract:

A validator sends to an account:
