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

fix: Repair send transaction fields and add call and decoder #146

Merged
merged 8 commits into from
Apr 3, 2024

Conversation

richtera
Copy link
Contributor

@richtera richtera commented Mar 29, 2024

Clickup

https://app.clickup.com/t/2645698/DEV-10497

Task

Repair SendTransaction panel

Add call button and call decoder.

Properly encoding bytes32 as a LSP data key if checkbox is on

image

Properly working with bytes and bytes32 arrays.

Allowing Call and allowing data conversion (here bytes) and LSP decoding (here LSP3Profile)

image

@frozeman
Copy link
Member

Copy link

github-actions bot commented Mar 29, 2024

@richtera richtera force-pushed the fix/repair-send-add-call branch from 5c199c8 to 358919f Compare April 2, 2024 13:37
import LSP4DigitalAsset from '@erc725/erc725.js/schemas/LSP4DigitalAsset.json'
import LSP9Vault from '@erc725/erc725.js/schemas/LSP9Vault.json'

const schemas = LSP3ProfileMetadata.concat(LSP4DigitalAsset, LSP9Vault)
Copy link
Member

Choose a reason for hiding this comment

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

Would suggest writing it as follow for readability (easier to see the schemas in there when they are written line by line. But not a big deal.

const schemas = [
    ...LSP3ProfileMetadata,
    ...LSP4DigitalAsset, 
    ...LSP9Vault
]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing

value = numberToHex(value)
}
const value =
typeof _value === 'string' && /^0x/.test(_value)
Copy link
Member

Choose a reason for hiding this comment

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

is it to test if it starts with?
Maybe it can be re-written like this?

Suggested change
typeof _value === 'string' && /^0x/.test(_value)
typeof _value === 'string' && _value.startsWith("0x")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, yes.

Copy link
Member

@JeneaVranceanu JeneaVranceanu left a comment

Choose a reason for hiding this comment

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

LGTM, though haven't tested manually yet.

@richtera richtera merged commit 78facaf into main Apr 3, 2024
1 check passed
@richtera richtera deleted the fix/repair-send-add-call branch April 3, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants