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

UOS Qr Support (rebased on master) #325

Merged
merged 207 commits into from
Aug 26, 2019
Merged

UOS Qr Support (rebased on master) #325

merged 207 commits into from
Aug 26, 2019

Conversation

pmespresso
Copy link
Contributor

I made a new branch for rebasing #273 rather than force pushing. Unit tests pass and the tested the same QRs from https://uostestqrs.herokuapp.com/ as well on iOS.

  • - QrView: would not change. However in its usage for displaying addresses, it is expected to be in UOS introduction format, with extra information at the end (either a chainId or a genesisHash)
  • - QrScanner:
    • - convert rawBytes from RNNative to U8a (Unit Tested)
    • - strip padding, length, frame info (Unit Tested)
    • - parse address, crypto (if substrate), payload, data as per UOS specification (Unit Tested)
    • - encode address from bytes to ss58 (Unit Tested)
    • - merging in from the identicon PR thank you @Tbaut for this one!
    • - decode SCALE payload
      • - Cold Signer SHOULD decode the transaction details from the SCALE encoding and display them to the user for verification before signing. (Unit Tested)
        • payload MUST be the SCALE encoding of the tuple of transaction items (nonce, call, era_description, era_header).
        • payload_hash MUST be the Blake2s 32-byte hash of the SCALE encoding of the tuple of transaction items (nonce, call, era_description, era_header).
        • immortal_payload MUST be the SCALE encoding of the tuple of transaction items (nonce, call).
      • - Cold Signer SHOULD attempt to decode the message as UTF-8 encoded human readable string by whatever heuristics it finds suitable (Unit Tested) and display it to the user for verification before signing.
      • - Cold Signer SHOULD warn the user that signing a hash is inherently insecure, in the cash of type 01.
      • - Cold Signer SHOULD (at the user's discretion) sign the message, immortal_payload, or payload if payload is of length 256 bytes or fewer.
      • - If payload is longer than 256 bytes, then it SHOULD instead sign the Blake2s hash of payload.
      • - Cold Signer SHOULD display all account id values in SS58Check encoding. [Substrate accounts management #293 - It should be stored in AccountStore as such]
  • - ScannerStore:
    • - setDataToSign with appropriate native method based on network type, i.e. was crypto field defined (substrate) or not (eth) (Unit Tested)
    • - setTxToSign with appropriate hashing method based on network type. keccak for Ethereum, sr25519 or ed25519 for Substrate.

pmespresso and others added 30 commits July 22, 2019 14:09
Copy link
Contributor

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

Just a couple nits, I'll build and test tomorrow

src/console.d.ts Show resolved Hide resolved
src/screens/MessageDetails.js Outdated Show resolved Hide resolved
src/screens/MessageDetails.js Outdated Show resolved Hide resolved
src/screens/MessageDetails.js Outdated Show resolved Hide resolved
src/screens/MessageDetails.js Outdated Show resolved Hide resolved
src/screens/MessageDetails.js Outdated Show resolved Hide resolved
src/screens/MessageDetails.js Outdated Show resolved Hide resolved
src/stores/AccountsStore.js Show resolved Hide resolved
src/stores/AccountsStore.js Show resolved Hide resolved
@Tbaut
Copy link
Contributor

Tbaut commented Aug 23, 2019

When linking or unlinking rn-camera I get an error:

react-native link react-native-camera
error Linking "react-native-camera" failed. Run CLI with --verbose flag for more details.
SyntaxError: Expected [\n\r] but end of input found.
    at peg$buildStructuredError (/home/thib/github/parity-signer/node_modules/xcode/lib/parser/pbxproj.js:429:12)
    at Object.peg$parse [as parse] (/home/thib/github/parity-signer/node_modules/xcode/lib/parser/pbxproj.js:1891:11)
    at pbxProject.parseSync (/home/thib/github/parity-signer/node_modules/xcode/lib/pbxProject.js:63:24)
    at isInstalled (/home/thib/github/parity-signer/node_modules/@react-native-community/cli-platform-ios/build/link/isInstalled.js:44:67)
    at Object.isInstalled (/home/thib/github/parity-signer/node_modules/@react-native-community/cli-platform-ios/build/link/common/isInstalled.js:23:35)
    at Object.keys.forEach.platform (/home/thib/github/parity-signer/node_modules/@react-native-community/cli/build/commands/link/linkDependency.js:53:36)
    at Array.forEach (<anonymous>)
    at linkDependency (/home/thib/github/parity-signer/node_modules/@react-native-community/cli/build/commands/link/linkDependency.js:36:32)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)

I can manually add the linking for android sure, but since this error is in ios files.. better let you know

Tbaut and others added 6 commits August 23, 2019 10:17
Co-Authored-By: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-Authored-By: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-Authored-By: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-Authored-By: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
@pmespresso pmespresso mentioned this pull request Aug 23, 2019
17 tasks
@pmespresso
Copy link
Contributor Author

### Sign Message ### Sign Hash ### Sign Extrinsic Payload
ezgif-2-4421c6d52e6c ezgif-2-96f04dc4aa26 ezgif-1-1ebae92564c0

Copy link
Contributor

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

Working well on android 🎉

@pmespresso pmespresso merged commit e41ad3f into master Aug 26, 2019
@pmespresso pmespresso deleted the yj-uos-rebased branch August 26, 2019 08:50
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.

4 participants