-
Notifications
You must be signed in to change notification settings - Fork 168
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
QR support for UOS #273
QR support for UOS #273
Conversation
I don't think this will work for you, as |
Multipart will be a separate PR, though the logic is there I have no way to test them atm |
Could you please rebase the project on |
yes, doing this now |
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.
Found one issue, some other grumbles.
src/util/keyExtract.js
Outdated
*/ | ||
|
||
export default function keyExtract (suri) { | ||
const RE_CAPTURE = /^((\/\/?[^/]+)*)(\/\/\/(.*))?$/; | ||
const RE_CAPTURE = /^(\w+( \w+)*)?((\/\/?[^/]+)*)(\/\/\/(.*))?$/; |
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.
Tip: you can silence capturing groups with ?:
inside parenthesis. With regex /^(\w+(?: \w+)*)?((?:\/\/?[^/]+)*)(\/\/\/(?:.*))?$/
you can then simply do [, phrase = '', derivePath = '', password = '']
.
src/stores/AccountsStore.js
Outdated
return this.state.accounts.get(accountId(account)) || empty(account); | ||
} | ||
|
||
<<<<<<< HEAD |
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.
Merging artifact
src/util/keyExtract.js
Outdated
let phrase, derivePath, password = ''; | ||
|
||
if (matches) { | ||
[, phrase = '', , derivePath = '', , , password = ''] = matches; |
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.
Edit: my mistake, slashes are stripped.password
here includes the ///
(if it exists), but every time you construct a suri
you also add the slashes. This means the slashes will be included in the suri, which will lead to //////password
.
I'd recommend having two functions here: one to convert a suri string to an object, and another to convert the object to a suri, next to each other so the logic that does the conversion is contained next to each other in a single file, is easy to audit. Avoid constructing the suri string in any other places for security. This is pretty critical, people can lose money if their derivations don't work as expected.
moved to #325 |
UOS introduction
format, with extra information at the end (either achainId
or agenesisHash
)keccak
for Ethereum,sr25519
ored25519
for Substrate.