-
Notifications
You must be signed in to change notification settings - Fork 16
fix: randomSatoshis trigger success #482
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
Conversation
chedieck
left a comment
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.
Not sure if I understood it correctly, but I was guessing random-satoshis=true should make ONLY the amounts being equal necessary to call a transaction a success transaction.
i.e. ignoring the opReturn, and with him the paymentId.
| contributionOffset, | ||
| ...widgetProps | ||
| } = props; | ||
| const [internalCurrencyObj, _setInternalCurrencyObj] = useState<CurrencyObject>(); |
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.
Setter shouldn't have been prefixed with a underscore, it is used in the line below
d3e2241 to
c62aee4
Compare
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 getting a success with the same amount if I don't send anything in the OP_RETURN.
Tried for the button:
<div class="paybutton" to="ecash:qq3zv9s3jna6x5t0fxzfgd2zwteqyyjrscf9zmthz7" text="Mine" amount="21"
random-satoshis="true"
currency="XEC" goal-amount="1000" success-text="WOW!" on-close="myClose" on-open="myOpen"
on-success="mySuccessFunction" on-transaction="myTransactionFunction"
></div>
chedieck
left a comment
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.
My bad, didn't pulled the latest changes, it is actually working well. Just left a code question.
| transaction: Transaction, | ||
| currency: string, | ||
| price: number, | ||
| randomSatoshis: number | boolean, |
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.
why 'number'? AFAIK this is a boolean.
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.
Check WidgetContainerProps randomSatoshis is boolean | number there
3a231c3 to
fb51c8a
Compare
Related to #366
Description
Fix button not triggering success when random satoshis is active
Test plan
1 - Test component(paybutton and widget) with no amount should trigger succes
2 - Test if component (paybutton and widget) with an amount and without random satoshis active is triggering sucess
3 - Test if component (paybutton and widget) with an amount and random satoshis active is triggering success as expected