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

Receive bug and more tests #2562

Merged
merged 6 commits into from
Jan 30, 2020
Merged

Receive bug and more tests #2562

merged 6 commits into from
Jan 30, 2020

Conversation

LianaHus
Copy link
Collaborator

No description provided.

@@ -161,7 +161,7 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
const fallback = self.udapp.getFallbackInterface(contractABI)
const receive = self.udapp.getReceiveInterface(contractABI)
const args = {
funABI: fallback,
funABI: (fallback ? fallback : receive),
Copy link
Collaborator

Choose a reason for hiding this comment

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

and if both are defined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

then it's fine. fallback is default one

@@ -177,16 +177,22 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
}
}
if (calldata) {
if (calldata.length > 3 && calldata.substr(0, 2) === '0x') {
if (calldata.length < 2) setLLIError('the calldata should be a valid hexadecimal value with size of at least one byte.')
if (calldata.length < 4 && calldata.substr(0, 2) === '0x') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is more than that, the size should be even

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

:) thanks

// if receive is defined and that there is no calldata => receive function is called
// if fallback is defined => fallback function is called
if (receive && !calldata) args.funABI = receive
if (fallback) args.funABI = fallback
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this will rewrite your previous change

Copy link
Collaborator

Choose a reason for hiding this comment

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

indeed , changed it

@yann300 yann300 merged commit 8fe25a9 into master Jan 30, 2020
@yann300 yann300 deleted the receiveF branch January 30, 2020 21:53
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