Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

order-utils: Order Interface can't handle large salts #1670

Closed
aakilfernandes opened this issue Mar 5, 2019 · 8 comments
Closed

order-utils: Order Interface can't handle large salts #1670

aakilfernandes opened this issue Mar 5, 2019 · 8 comments

Comments

@aakilfernandes
Copy link

Expected Behavior

Create an order interface with a salt of 2^256 - 1

Current Behavior

Validation errors: instance.salt is not any of [subschema 0],[subschema 1]

Possible Solution

Replace Order interface to accept hex strings (alternatively, use BN.js which I believe can handle numbers that large)

Your Environment

node v10.0.0

| Package | Version |
| 0x.js | 6.0.3 |

@aakilfernandes
Copy link
Author

Come to think of this, this probably effects all BigNumber interfaces. Not just the salt

@fabioberger
Copy link
Contributor

@aakilfernandes have you tried passing it in as a string rather then as a number type? That should work, although I agree that it's inelegant.

@aakilfernandes
Copy link
Author

@fabioberger you mean a hexadecimal encoding? The typescript interface only allows for bignumbers

@fabioberger
Copy link
Contributor

@aakilfernandes which method call and order is giving you this error? Mind posting both of them here?

@aakilfernandes
Copy link
Author

https://github.com/GuildCrypt/makerfacility/blob/master/test/setSignatures.js#L29-L33

The error only shows up for large salts

Validation errors: instance.salt is not any of [subschema 0],[subschema 1]

@fabioberger
Copy link
Contributor

I see you are using your own BigNumber dep. Do you configure it with:

BigNumber.config({
    // By default BigNumber's `toString` method converts to exponential notation if the value has
    // more then 20 digits. We want to avoid this behavior, so we set EXPONENTIAL_AT to a high number
    EXPONENTIAL_AT: 1000,
});

?

@stale
Copy link

stale bot commented May 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 23, 2019
@fabioberger fabioberger changed the title Order Interface can't handle large salts order-utils: Order Interface can't handle large salts Jun 4, 2019
@stale stale bot removed the stale label Jun 4, 2019
@stale stale bot removed the stale label Jun 4, 2019
@stale
Copy link

stale bot commented Jul 4, 2019

This issue has been automatically closed because no activity occured in 7 days after being marked as stale. If it's still relevant - feel free to reopen. Thank you for your contributions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants