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
Rename token to assetHash for spot assets #263
Conversation
if (value.startsWith('0x')) { | ||
value = value.slice(2) |
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'm not sure if this is a better approach. We are slicing the 0x
prefix if it's there and then we are adding it anyway.
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.
This is done to pad the length to 64. So that 0x000ab and 0xab end up being equal.
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.
Ok, makes sense then
@Wendrowiec13 good spot, fixed. |
Resolves L2B-824
Up until now we have used the name
token
and assumed it's aPedersenHash
when dealing with spot assets (for example inVaultLeaf
andvaults
table). After recent refactoring we have a properAssetHash
type for spot assets. We also know it's not a Pedersen hash but a sliced Keccak.This PR renames
token
toassetHash
and the type fromPedersenHash
toAssetHash
. The nametoken
is preserved only in zed parsing code as this is the name that comes from DAC.