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

Clear email hash using null not working #965

Closed
RareData opened this issue Oct 30, 2018 · 2 comments
Closed

Clear email hash using null not working #965

RareData opened this issue Oct 30, 2018 · 2 comments

Comments

@RareData
Copy link
Contributor

RareData commented Oct 30, 2018

Setting an email hash using the prepareSettings and sign methods work fine, but following the API documentation to clear the email hash doesn't.

Reproduce the issue by preparing a settings transaction using api.prepareSettings({emailHash: null}, {sequence: 3, fee: "0.00012", maxLedgerVersion: null}). The sequence number must be adjusted.

The response should look something like:
{txJSON: "{"TransactionType":"AccountSet","Account":"rHehtyAwASiwsrD6W5xWDkw2tSS6cicuGy","EmailHash":"0","Flags":2147483648,"Fee":"12","Sequence":3}", instructions: {fee:"0.000012", maxLedgerVersion: null, sequence:3}}

Trying to perform api.sign(txJSON, secret) with this prepared settings transaction, results in the following assertion error (stack):

    at klass.Hash [as inherits] (webpack-internal:///./node_modules/ripple-binary-codec/distrib/npm/types/hash.js:11:12)
    at new klass (webpack-internal:///./node_modules/ripple-binary-codec/distrib/npm/utils/make-class.js:29:16)
    at Function.from (webpack-internal:///./node_modules/ripple-binary-codec/distrib/npm/types/hash.js:20:14)
    at eval (webpack-internal:///./node_modules/ripple-binary-codec/distrib/npm/types/st-object.js:31:46)
    at eval (webpack-internal:///./node_modules/lodash/lodash.js:13805:16)
    at eval (webpack-internal:///./node_modules/lodash/lodash.js:4925:15)
    at baseForOwn (webpack-internal:///./node_modules/lodash/lodash.js:3010:24)
    at Function.transform (webpack-internal:///./node_modules/lodash/lodash.js:13804:43)
    at Function.from (webpack-internal:///./node_modules/ripple-binary-codec/distrib/npm/types/st-object.js:28:18)
    at serializeObject (webpack-internal:///./node_modules/ripple-binary-codec/distrib/npm/binary.js:23:18)"```
@RareData
Copy link
Contributor Author

You can currently only clear by setting {emailHash: "00000000000000000000000000000000"}, not sure if this is the intended behaviour.

@RareData
Copy link
Contributor Author

Fixed in ripple-lib 1.4.2

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

No branches or pull requests

2 participants