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

Bip070 status monitoring #32

Merged
merged 31 commits into from
Nov 18, 2019

Conversation

BytesOfMan
Copy link
Contributor

  • Websocket status monitoring for BIP70 invoices (support for pay.bitcoin.com invoices only)
  • Bug fixes in PriceDisplay caused by previous errors
  • Countdown timer for BIP70 invoices, changes to red for times below 1 min

Copy link
Collaborator

@SpicyPete SpicyPete left a comment

Choose a reason for hiding this comment

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

Good progress on this, lots of small requests.
Largest thing is I think we need to re-think the price display especially in the BIP70 flows. Showing the price/value optionally there would be very useful, and keeping the price display optional and moving the BIP70 information elsewhere will keep the components concerns separated.

src/atoms/ButtonQR/ButtonQR.js Show resolved Hide resolved
src/components/BadgerBadge/BadgerBadge.js Show resolved Hide resolved
src/components/BadgerBadge/BadgerBadge.js Outdated Show resolved Hide resolved
src/components/BadgerBadge/stories.js Outdated Show resolved Hide resolved
src/components/BadgerButton/stories.js Outdated Show resolved Hide resolved
src/hoc/BadgerBase/BadgerBase.js Outdated Show resolved Hide resolved
src/hoc/BadgerBase/BadgerBase.js Outdated Show resolved Hide resolved
src/hoc/BadgerBase/BadgerBase.js Outdated Show resolved Hide resolved
src/hoc/BadgerBase/BadgerBase.js Outdated Show resolved Hide resolved
src/images/XSVG.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@SpicyPete SpicyPete left a comment

Choose a reason for hiding this comment

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

Broken: Display for sending SLP tokens not through BIP70
Missing: USD/Fiat prices for Price Display with BIP70 BCH requests.

Then just some smaller changes requested.
I think it could be valuable to do a once over on simplifying where the logic is handled, such that multiple flows can re-use the same simple logic, such as updating the token metadata.
It's confusing if there's 2 flows which are slightly different with special guards on them, ideally the updateTokenMetadata can be a simple flow which is the same regardless of BIP70 or not. Look at the tokenID => set the info.

src/components/BadgerBadge/stories.js Outdated Show resolved Hide resolved
src/components/BadgerButton/stories.js Show resolved Hide resolved
.add(
'Default',
() => {
return <InvoiceTimer secondsRemaining={600} />;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still seems broken, not seeing a knob or an example in the storybook anymore
NaN:NaN

src/components/PriceDisplay/PriceDisplay.js Outdated Show resolved Hide resolved
@@ -368,7 +505,7 @@ const BadgerBase = (Wrapped: React.AbstractComponent<any>) => {
this.startRepeatable();
}

if (tokenId !== prevTokenId) {
if (tokenId !== prevTokenId && !paymentRequestUrl) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we do all the setupCoinMeta in the same way as before, and just set the relevant fields in the paymentRequest setup step?
This would allow the setupCoinMeta to stay simple, and handle the payment request added complexity locally in the payment request flows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code must over-ride props if the invoice SLP type does not match the prop type. This could be handled by setting tokenId in both props and state; exporting the state version, and having BadgerButton and BadgerBadge only read these and not the props version. I think this would be more complicated than what we have right now. Right now, program logic is the same for cases with no paymentRequestUrl parameter. If paymentRequestUrl is set, then information from the invoice over-rides anything in props (should be this way to prevent anyone from using badger-react-components to display incorrect information about an invoice by entering misleading props).

Let me know thoughts on improving this. I don't think the current implementation is perfect, but I wanted to make sure that in the case of any invoice being displayed, the display information can come only from that invoice.

src/images/XSVG.js Outdated Show resolved Hide resolved
src/styles/colors.js Outdated Show resolved Hide resolved
@BytesOfMan
Copy link
Contributor Author

Broken: Display for sending SLP tokens not through BIP70

c0a5c5c

@BytesOfMan
Copy link
Contributor Author

Missing: USD/Fiat prices for Price Display with BIP70 BCH requests.
b452dde

Copy link
Collaborator

@SpicyPete SpicyPete left a comment

Choose a reason for hiding this comment

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

Looks good and seem to work as expected.
Update the package.json version + add the collaborators section if you like.
Can merge + publish tomorrow if no issues found

CHANGELOG.md Outdated Show resolved Hide resolved
@SpicyPete SpicyPete merged commit 2410642 into badger-cash:master Nov 18, 2019
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.

2 participants