Commit Graph

38 Commits

Author SHA1 Message Date
Fredrik Harrysson 75b6a31e87 Trezor Support (#6403)
* Copy modal from keepkey branch and generalize

The keepkey PinMatrix modal needs to be the same for Trezor, but we
should probably try to keep it general since it can be used for both.

* Add trezor communication code

This is a result of much trial-and-error and a couple of dead-ends in
how to communicate and wire everything up.

Code here is still a bit WIP with lots of debug prints and stuff.

The test works though, it is possible to sign a transaction.

* Extend the basic lib to allow Trezor

This is kind of ugly and needs some cleanup and generalization. I’ve
just copy-pasted some things to bring in the trezor wallets. I’ve also
had to add a lock to the USB API so that only one thing talks to the
USB at once.

* Add RPC plumbing needed

We need to be able to get “locked” devices from the frontend to figure
out if we’re going to display the PinMatrix or not. Then we need to be
able to send a pin to a device.

* Add logic to query backend for Trezor and display PinMatrix

There’s a bug somewhere here because signing a transaction fails if you
take too long to press the confirm button on the device.

* Change back to paritytech branch

As my fork has been merged in.

* Converting spaces to tabs, as it should be

* Incorporate correct handling of EIP-155

Turns out the Trezor was adjusting the v part of the signature, and
we’re already doing that so it was done twice.

* Some circular logic here that was incorrect

BE-encoded U256 is almost the same as RLP encoded without the
size-byte, except for <u8 sized values. What’s really done is
BE-encoded U256 and then left-trimmed to the smallest size. Kind of
obvious in hindsight.

* Resolve issue where not clicking fast enough fails

The device will not repeat a ButtonRequest when you read from it, so
you need to have a blocking `read` for whatever amount of time that you
want to give the user to click. You could also have a shorter timeout
but keep retrying for some amount of time, but it would amount to the
same thing.

* Scan after pin entry to make accepting it faster

* Remove ability to cancel pin request

* Some slight cleanup

* Probe for the correct HID Version to determine padding

* Move the PinMatrix from Accounts to Application

* Removing unused dependencies

* Mistake in copying over stuff from keepkey branch

* Simplify FormattedMessage

* Move generated code to external crate

* Remove ethcore-util dependency

* Fix broken import in test

This test is useless without a connected Trezor, not sure how to make
it useful without one.

* Merge branch 'master' into fh-4500-trezor-support

# Conflicts:
#	rpc/src/v1/helpers/dispatch.rs

* Ignore test that can't be run without trezor device

* Fixing grumbles

* Avoiding owning data in RPC method
* Checking for overflow in v part of signature
* s/network_id/chain_id
* Propagating an error from the HID Api
* Condensing code a little bit

* Fixing UI.

* Debugging trezor.

* Minor styling tweak

* Make message type into an actual type

This makes the message type that the RPC message accepts into an actual
type as opposed to just a string, based on feedback. Although I’m not
100% sure this has actually improved the situation.

Overall I think the hardware wallet interface needs some refactoring
love.

* Split the trezor RPC endpoint

It’s split into two more generic endpoints that should be suitable for
any hardware wallets with the same behavior to sit behind.

* Reflect RPC method split in javascript

* Fix bug with pin entry

* Fix deadlock for Ledger

* Avoid having a USB lock in just listing locked wallets

* Fix javascript issue (see #6509)

* Replace Mutex with RwLock

* Update Ledger test

* Fix typo causing faulty signatures (sometimes)

* *Actually* fix tests

* Update git submodule

Needed to make tests pass

* Swap line orders to prevent possible deadlock

* Make setPinMatrixRequest an @action
2017-09-14 19:28:43 +02:00
Tomasz Drwięga 73644adf69
Rename network_id to chain_id where applicable. 2017-08-21 14:23:10 +02:00
Craig O'Connor 7d17d77254 Dapp refresh (#5752)
* RwLock

* getting there

* argh

* parking_lot

* rpc

* wax on wax off

* almost there

* remove lock

* write over read

* works

* linting

* small updates

* dissapearing act

* router update

* complete

* one m

* grumbles1

* grumbles part II

* parking_lot->util

* missed test case

* fied package-lock.json

* small fixes

* 404 tests failing

* cleanup

* cleanup 2

* updates and the likes

* play

* simplify filter

* f-ing bugs

* read->write

* Address own grumbles.

* Fix test.
2017-08-09 19:06:40 +02:00
Tomasz Drwięga f7fb1bfa1d
Fix linting. 2017-06-14 11:45:44 +02:00
Tomasz Drwięga 9994133446
Adding docs. 2017-06-13 14:07:39 +02:00
Tomasz Drwięga cbcc369a2d UI server refactoring (#5580)
* Full API in Authenticated WS server.

* Replacing UI server with Hyper.

* Solving CLI, RPCs and tests.

* Porting signer tests.

* Fixing origin recognition for dapps/rpc.

* Fixing tests. Adding parity-rpc-client to test.

* Dapps exposed as RPC method.

* JS code to support new connection scheme.

* Fixing dapps tests.

* Updating allowed origins/hosts to support web3.site.

* Fixing tests, fixing UI.

* Fixing tests.

* Removing invalid tests.

* Fixing merge.

* 404 fallback for UI

* Improve ContentFetcher constructor readability.

* Naming.

* Update .gitlab-ci.yml

fix CI lint error

* Fixing tests and linting issues.

* Fixing new tests.

* UI hosts.

* Submodules fix.
2017-05-24 12:24:07 +02:00
Maciej Hirsz d5683d2016 Added missing methods (#5542)
* Added missing methods

* Adding to Parity.js
2017-05-04 17:58:01 +02:00
Jaco Greeff 70e87677b3 Retrieve block headers only for header-only info (#5480)
* Add parity_getBlockHeaderByNumber

* Use parity_getBlockHeaderByNumber for retrieval
2017-05-03 14:12:06 +02:00
Craig O'Connor f7d5d6c0cd Cancel tx JS (#4958)
* Remove transaction RPC

* Bumping multihash and libc

* Updating nanomsg

* bump nanomsg

* cancel tx

* cancel-tx-js

* cancel-tx-js

* cancel-tx-js

* cancel-tx-hs

* cancel-tx-js

* cancel-tx-js

* cancel-tx-js

* small fixes

* edit & time till submit

* edit & time till submit

* updates

* updates

* udpates

* udpates

* grumbles

* step 1

* Wonderful updates

* ready

* small refact

* small refact

* grumbles 1

* ffx2

* good ol' fashioned updates

* latest and greatest

* removeHash

* removeHash

* spec

* fix 1

* fix 1

* fix 2

* fix 2

* ff

* ff

* ff

* updates
2017-04-25 10:08:09 +02:00
keorn 52eae66c72 Add raw hash signing (#5423)
* add sign any

* Add RPC signMessage call to JS API

* Add signMessage to JSON RPC docs

* PostSignTransaction -> EthSignMessage

* fix doc typo

* revert incorect naming
2017-04-12 12:15:13 +02:00
Tomasz Drwięga 4e498790d4 Updating documentation for RPCs (#5392)
* Removing minBlocks occurrencies

* Docs for new RPCs.

* Fixing linting issues, updating *withToken documentatiojn.

* Adding missing RPCs. Fixing tests.

* Fixing lint issues.
2017-04-08 11:28:04 +02:00
Tomasz Drwięga d2394d3ac3 Updating paths to repos. (#5330)
* Updating paths to repos.

* Updating rotor and libusb

* Fixing other occurrences
2017-03-29 15:17:27 +02:00
Robert Habermeier 62158601fb node kind RPC (#5025)
* node kind RPC

* JS interface for parity_nodeKind
2017-03-27 17:30:19 +02:00
Gav Wood 3041c95408 Chain-selection from UI (#4859)
* First little bits for chain-selection.

* Provide RPCs and get settings through to user defaults.

* Hasty stash.

* Fix updater accidentally redownloading.

* Finish up.

* Add JS tests.

* Hypervisor should never run a binary modified before itself.

* Style.

* Help tweak.

* Fix test compile.

* Fix JS test

* Build fix for tests.

* Revert default chain name

* Another test

* Use spec name via client.

* Fix mock up.

* whitespace

[ci:skip]

* whitespace

[ci:skip]

* remove exit/restart endpoints.
2017-03-13 12:10:53 +01:00
Maciej Hirsz d297ddbfe5 Update wiki (#4743)
- Added missing `creates` field.
- Removed deprecated methods.
2017-03-03 14:55:04 +01:00
Jaco Greeff b11caaf071 UI support for hardware wallets (#4539)
* Add parity_hardwareAccountsInfo

* Ledger Promise interface wrapper

* Initial hardwarestore

* Move ~/views/historyStore to ~/mobx

* split scanLedger

* test createEntry

* Also scan via parity_hardwareAccountsInfo

* Explanation for scanning options

* react-intl-inify tooltips

* add hwstore

* Listen for hw walet updates

* Return arrays from scanning

* Readability

* add u2f-api polyfill

* check response.errorCode

* Support hardware types in state.personal

* Tooltips (to be split into sep. PR)

* Tooltips support intl strings

* FormattedMessage for strings to Tooltip

* Fix TabBar tooltip display

* signLedger

* Use wallets as an object map

* PendingForm -> FormattedMessage

* Pending form doesn't render password for hardware

* Groundwork for JS API signing

* Show hardware accounts in list

* Cleanup rendering conditions

* Update RequestPending rendering tests (verification)

* Tests for extended signer middleware

* sign properly & handle response, error

* Align outputs between Parity & Ledger u2f

* Ledger returns checksummed addresses

* Update ethereum-tx for EIP155 support

* Update construction of tx

* Updates after sanity checks (thanks @tomusdrw)

* Allow display for disabled IdentityIcon

* Disabled accounts

* Disabled auto-disabling

* Password button ebaled for hardware

* Don't display password hint for hardware

* Disable non-applicable options when not connected

* Fix failing test

* Confirmation via ledger (u2f)

* Confirm on device message

* Cleanups & support checks

* Mark u2f as unsupported (until https)

* rewording

* Pass account & disabled flags

* Render attach device message

* Use isConnected for checking availability

* Show hardware accounts in defaults list

* Pass signerstore

* Update u2f to correct version

* remove debug u2f lib

* Update test (prop name change)

* Add ETC path (future work)

* new Buffer -> Buffer.from (thanks @derhuerst)
2017-03-02 23:51:56 +01:00
Jaco Greeff 92fa4249d3 Update condition documentation (Thanks @arkpar) (#4659) 2017-02-24 09:40:38 +01:00
Tomasz Drwięga 72998d3ce3 Proper default accounts RPCs (#4580)
* Default accounts setting - account provider

* RPC support for default accounts

* Updating JS code

* Rename whitelist to addresses
2017-02-20 16:33:12 +01:00
Jaco Greeff 7a627f88cb parity.js interfaces for vaults (#4497) 2017-02-09 11:07:08 -05:00
Tomasz Drwięga 4462c18690 Fixing invalid address in docs (#4388) 2017-02-01 17:14:16 +01:00
Jaco Greeff 04fb2afba1 Add parity_defaultAccount RPC (with subscription) (#4383)
* Add parity_defaultAccount RPC (with subscription)

* Add jsonrpc interface
2017-02-01 14:52:15 +01:00
Maciej Hirsz ed09a76c91 Full JSON-RPC docs + sync tests. (#4335)
* Extended Markdown generator

* Synced and extended all JSON-RPC interfaces

* Fix linter errors

* Format `parity_listAccounts` output in API

* typo

* Check if interfaces are synced in JS spec tests

* Fixing missing interface errors

* Better #[rpc] attribute parsing

* Fixed RPC JS spec tests

* More examples

* Refactored how dummy data appears in examples

* Complete trace docs!

* fix typo

* Less copy-paste

* All the docs!

* Fix differences between CallRequest and TransactionRequest

* Fix differences between CallRequest and TransactionRequest

* Missing examples

* Grumble fixes
2017-02-01 10:58:09 +01:00
Gav Wood 8404edb656 Fix whitespace (#4299)
* Fix whitespace.

* Update copyright years/owner.

* Push release only for tags.
2017-01-25 18:51:41 +01:00
Maciej Hirsz a58fad06a7 JSON-RPC interfaces with documentation (#4276)
* Extended Markdown generator

* Synced and extended all JSON-RPC interfaces

* Fix linter errors

* Format `parity_listAccounts` output in API

* typo
2017-01-24 22:02:52 +01:00
Jaco Greeff b27c809c64 Visible accounts for dapps (default whitelist) (#3898)
* Add APIs for Dapp management

* Move AddDapps modal

* Add DappsPermissions Modal (basics)

* Allow whitelist editing

* Add select/unselect tests

* Case

* Case

* Modal render/non-render tests

* UI made slightly prettier

* Adjust spacing

* Allow get/set of null for default whitelist (all)

* Allow null = all for selection

* Adjust selected background

* Address valid comment on formatters location
2016-12-27 15:23:41 +00:00
Tomasz Drwięga 27ba0e6922 Limiting accounts returned by parity_accountInfo (#3931)
* Limiting accountNames returned by parity_accountNames

* Fixing middleware

* Change RPC interface

* Enhance tests for RPC layer

* UI uses parity_allAccountsInfo

* Update dapps to use parity_accountsInfo

* Don't filter by uuid (deprecated)

* Consistency in calls

* Fix js tests (missed stub call)
2016-12-23 18:52:02 +01:00
Jaco Greeff d89ee5432e JS API interface for parity_chainStatus 2016-12-20 12:12:39 +01:00
Jaco Greeff dbc6b42267 Lint fixes 2016-12-12 23:14:44 +01:00
Jaco Greeff c784ab55d2 Extend jsapi interfaces with documentation 2016-12-12 15:43:59 +01:00
Gav Wood 10b0898bdf
Crate tidyups.
- Move Updater into its own crate.
- Change ethcore -> parity in authors, homepages and licenses.
2016-12-11 19:14:42 +01:00
Gav Wood 5f1fcf95e0
Make *ID names consistent with std Rust (Id) 2016-12-09 23:01:43 +01:00
Jaco Greeff 46840d36c9 Add parity_removeAddress RPC 2016-12-07 16:53:46 +01:00
Jaco Greeff 78ffd10236 Typo in description 2016-11-23 10:33:04 +01:00
Jaco Greeff 3db5e3e627 jsapi interface for parity_killAccount 2016-11-22 15:52:23 +01:00
Tomasz Drwięga ff27bbcb4f Simple GUI for local transactions 2016-11-17 10:15:11 +01:00
Tomasz Drwięga 2f98169539 In-browser signing support (#3231)
* Signer RAW confirmations

* Returning address book as eth_accounts

* UI support for in-browser signing

* Post review fixes

* Adding new methods to jsonrpc

* Fixing eth_accounts

* Deterministic accounts ordering
2016-11-10 11:27:05 +01:00
Tomasz Drwięga 88c9cea04d Dapps interface RPC (#3311)
* Dapps Interface RPC

* Adding JS apis

* Support for signer interface in proxypac and embeds

* Fixing tests

* fixing tests again
2016-11-09 19:41:47 +01:00
Tomasz Drwięga 9c4979681c Cleaning up polluted namespaces (#3143)
* Renaming ethcore_ to parity_

* Renaming files

* Renaming poluted EthSigning

* Tidy up the namespaces

* Renaming files to match new structure

* Splitting EthSigning into separate traits

* jsapi move ethcore.* -> parity.*

* Move jsonrpc parity definitions

* Update UI API calls for parity interfaces

* Move jsapi signer interfaces from personal to signer

* Update UI to use signer.* where applicable

* Updsate jsapi subscriptions for signer

* Fix dodgy merge.

* Update README.

* Fix some tests.

* Move parity-only personal.* to parity.*

* Update UI for personal -> parity API moves

* Update subscription APIs after personal -> parity move

* personal. generateAuthorizationToken -> parity. generateAuthorizationToken (UI)

* enode, dappsPort & signerPort (UI)

* Update subscription tests (accountsInfo)

* subscription update

* personal -> parity

* Additional error logging on method failures

* move postTransaction to parity

* Additional debug info with method failures

* Fix personal tests.

* Console wrning shows parameters, error object does not

* Include parity_ signing methods.

* Console log http transport info

* Fix failing tests

* Add RPC stubs for parity_accounts.

* Allow some secure built-in dapps

* Use parity_accounts in place of accountsInfo

* Improve error reporting

* Cleanup GHH error handling
2016-11-06 12:51:53 +01:00