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

Display decoded transaction data #102

Merged
merged 2 commits into from
Jan 7, 2021
Merged

Conversation

luckysori
Copy link
Collaborator

@luckysori luckysori commented Jan 6, 2021

I decided not to integrate with nigiri-chopsticks' or esplora's registry for the purpose of identifying the assets in the transaction because I was struggling to make it work (esplora's returns multiple pages, nigiri-chopsticks' has a different format (without precision), talking to nigiri-chopsticks from the frontend was not working). I'm almost certain it is not worth integrating with nigiri-chopsticks, but we may want to detect when we're in production and figure out how to consume esplora's registry instead of depending on the local registry.

My React is very rusty, so there's probably much nicer ways of doing the same thing.

I am not too happy with the number of things that are being done by the frontend, so I would consider moving almost all the logic into the wallet and changing the API to be something very specific to what we need.

Resolves #95

@luckysori luckysori self-assigned this Jan 6, 2021
Copy link
Member

@bonomat bonomat left a comment

Choose a reason for hiding this comment

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

I don't really like the approach of negative amounts and then re-negating it again in the frontend. I'm afraid that this complexity will bite us in the future. At the very least it should be documented on the function decompose_transaction so that a caller knows what to expect.

What was the particular reason you opted for removing TransactionElements and using negative amounts?

waves-scripts Outdated Show resolved Hide resolved
Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

ACK for using constants for the two assets we care about.

Made some suggestions for how to optimize the TS code.

waves-scripts Outdated Show resolved Hide resolved
waves/src/ConfirmSwapDrawer.tsx Outdated Show resolved Hide resolved
waves/src/ConfirmSwapDrawer.tsx Outdated Show resolved Hide resolved
waves/wallet/src/registry.rs Outdated Show resolved Hide resolved
@luckysori luckysori force-pushed the display-decoded-transaction-data branch from 312cbbb to 8bc6b8c Compare January 7, 2021 06:59
@luckysori luckysori requested a review from bonomat January 7, 2021 07:03
Copy link
Member

@bonomat bonomat left a comment

Choose a reason for hiding this comment

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

LGTM

@luckysori luckysori force-pushed the display-decoded-transaction-data branch from 8bc6b8c to 00d076a Compare January 7, 2021 23:18
@luckysori luckysori force-pushed the display-decoded-transaction-data branch from 00d076a to 02f89a8 Compare January 7, 2021 23:30
@luckysori luckysori merged commit 149992c into master Jan 7, 2021
@luckysori luckysori deleted the display-decoded-transaction-data branch January 7, 2021 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show swap data based on decomposed transaction
3 participants