Commit Graph

47 Commits

Author SHA1 Message Date
Artem Vorotnikov 751210c963
Remove deprecated flags 2020-09-10 05:53:41 +03:00
Artem Vorotnikov 11fb967c6a
Remove support for hardware wallets (#10678) 2020-09-10 05:53:29 +03:00
Artem Vorotnikov 610d9baba4
Reformat the source code 2020-08-07 20:46:52 +03:00
Niklas Adolfsson c5c3fb6a75
fix(rpc-types): replace uint and hash with `ethereum_types v0.4` (#10217)
* fix(rpc-types): remove uint and hash wrappers

* fix(tests)

* fix(cleanup)

* grumbles(rpc-api): revert `verify_signature`

* revert change of `U64` -> `u64`

* fix(cleanup after bad merge)

* chore(bump ethereum-types)

* fix(bad merge)

* feat(tests ethereum-types): add tests

* chore(update `ethereum-types` to 0.4.2)

* feat(tests for h256)

* chore(rpc): remove `ethbloom` import

Use re-export from `ethereum-types` instead

* fix(bad merge): remove `DefaultAccount` type

* doc(add TODO with issue link)
2019-02-25 14:27:28 +01:00
Tomasz Drwięga d5c19f8719 Deprecate account management (#10213)
* Extract accounts from ethcore.

* Fix ethcore.

* Get rid of AccountProvider in test_helpers

* Fix rest of the code.

* Re-use EngineSigner, fix tests.

* Simplify EngineSigner to always have an Address.

* Fix RPC tests.

* Add deprecation notice to RPCs.

* Feature to disable accounts.

* extract accounts in RPC

* Run with accounts in tests.

* Fix RPC compilation and tests.

* Fix compilation of the binary.

* Fix compilation of the binary.

* Fix compilation with accounts enabled.

* Fix tests.

* Update submodule.

* Remove android.

* Use derive for Default

* Don't build secretstore by default.

* Add link to issue.

* Refresh Cargo.lock.

* Fix miner tests.

* Update rpc/Cargo.toml

Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com>

* Fix private tests.
2019-02-07 14:34:24 +01:00
Afri Schoedon 7c335e8764
misc: bump license header to 2019 (#10135)
* misc: bump license header to 2019

* misc: remove_duplicate_empty_lines.sh

* misc: run license header script

* commit cargo lock
2019-01-07 11:33:07 +01:00
Wei Tang 1f18dbb17c
Remove all dapp permissions related settings (#9120)
* Completely remove all dapps struct from rpc

* Remove unused pub use

* Remove dapp policy/permission func in ethcore

* Remove all dapps settings from rpc

* Fix rpc tests

* Use both origin and user_agent

* Address grumbles

* Address grumbles

* Fix tests
2018-08-07 20:52:23 +08:00
Niklas Adolfsson 1a16f335fa Disable hardware-wallets on platforms that don't support `libusb` (#8464)
* disable hardware-wallets that don't support libusb

* address grumbles

* nits

* Refactor to get rid off as much annotations asap

* Might consume slight more memory than pure conditional compilation
flags

* formatting nits

* Enable libusb for android

* Tested by it compiling succesfully with `cargo build --target=armv7--linux-androideabi`
* The binary is ~66 MB

```bash
$ size
size target/armv7-linux-androideabi/release/parity
text    	data     	bss     	dec     	hex 		filename
50676230        416200   	31456 		51123886        30c16ae 	target/armv7-linux-androideabi/release/parity
```

* Move all `fake-hardware-wallet` to its own crate

* Removes some conditional compilation flags
* Introduces `fake-hardware-wallet` crate

* return error if no hardware wallets are found
2018-06-26 09:03:38 +02:00
Toralf Wittner 41348dead4 Add type for passwords. (#8920)
* Add type for passwords.

* Fix test.

* Simplify `Drop` impls of `Password` and `Memzero`.

* Spaces to tabs.

* Custom `Drop` impl for `Password`.
2018-06-22 15:09:15 +02:00
Andrew Jones 8057e8df43
Remove Result wrapper from AccountProvider in RPC impls (#8763)
* Remove AccountProvider Result, it's always `Ok`

* Remove unnecessary clones

* Remove redundant `Ok`
2018-06-04 10:26:30 +01:00
Niklas Adolfsson 98b7c07171 Update `license header` and `scripts` (#8666)
* Update `add_license` script

* run script

* add `remove duplicate lines script` and run it

* Revert changes `English spaces`

* strip whitespaces

* Revert `GPL` in files with `apache/mit license`

* don't append `gpl license` in files with other lic

* Don't append `gpl header` in files with other lic.

* re-ran script

* include c and cpp files too

* remove duplicate header

* rebase nit
2018-06-04 10:19:50 +02:00
Wei Tang 79eb8f7ace Remove public node settings from cli (#8758)
* Remove public node related settings

* Fix tests

* Unwrap accounts provider in all rpc apis

* Unwrap AccountProvider in all cli places

* Fix rpc tests
2018-06-01 15:49:55 +01:00
André Silva d1815eec55 Fix wallet import (#7873)
* rpc: generate new account id for imported wallets

* ethstore: handle duplicate wallet filenames

* ethstore: simplify deduplication of wallet file names

* ethstore: do not dedup wallet filenames on update

* ethstore: fix minor grumbles
2018-02-14 14:21:58 +01:00
Marek Kotewicz e95b093483 dissolve util (#7460)
* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor finished

* removed obsolete util/src/lib.rs

* removed commented out code
2018-01-10 15:35:18 +03:00
Tomasz Drwięga f7fa9f6e9d
Drop jsonrpc_core::Error 2017-11-14 12:17:48 +01:00
Tomasz Drwięga e8b418ca03 Update jsonrpc dependencies and rewrite dapps to futures. (#6522)
* Bump version.

* Fix RPC crate.

* Fix BoxFuture in crates.

* Compiles and passes tests!

* Get rid of .boxed()

* Fixing issues with the UI.

* Remove minihttp. Support threads.

* Reimplement files serving to do it in chunks.

* Increase chunk size.

* Remove some unecessary copying.

* Fix tests.

* Fix stratum warning and ipfs todo.

* Switch to proper branch of jsonrpc.

* Update Cargo.lock.

* Update docs.

* Include dapps-glue in workspace.

* fixed merge artifacts

* Fix test compilation.
2017-10-05 12:35:01 +02:00
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
maciejhirsz 2c254e3b32 Prioritize accounts over address book 2017-06-23 16:29:45 +02:00
Craig O'Connor 3991178b8d rpc -> weak to arc (#5688)
* helpers-1

* helpers2-impls1

* small adjustments1

* cleanup-2

* small changes

* helper-impl-cleanup-finished

* test-update

* merge fix

* merge fix

* merge fix2

* fix tests

* fix tests2

* fix tests3
2017-05-28 08:40:36 -04:00
Tomasz Drwięga 3ff72794e5 Create an account for chain=dev (#5612)
* implement From<&'static str> for Secret

* Dev account.

* Fix Secret semantics.
2017-05-19 17:06:36 +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
maciejhirsz 9bd3f10f41 Squashed: Public Node 2017-03-29 17:07:58 +02:00
Tomasz Drwięga bb1bbebfd6 Export account RPC (#4967)
* Export account RPC

* Removing GethDirectory and ParityDirectory

* Updating ethstore-cli help.
2017-03-23 13:23:03 +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
Nikolay Volf 494a0de1e2 Key derivation in ethstore & rpc (#4515)
* initial in secret store

* generation

* test

* refactor of the derivation

* signing

* account provider

* tests for account provider

* rpc types

* rpc types converts

* rpc tests

* fix warnings

* some extra docs

* derivate -> derive

* secret() -> as_raw()

* secret() -> as_raw() in rpc

* fix merge bug

* align with new serde changes
2017-02-15 16:56:15 +01:00
Svyatoslav Nikolsky a92bf65181 parity_getVaultMeta && parity_setVaultMeta (#4475) 2017-02-08 07:53:39 -05:00
Svyatoslav Nikolsky 2f340a547a Vaults RPCs (#4366)
* vaults RPCs

* vault.password != vault_account.password

* moved vault RPCs to parityAccounts NS

* parity_listVaults + parity_listOpenedVaults
2017-02-05 10:17:56 -05:00
Tomasz Drwięga 248cd5e036 RPC middleware: Informant & Client.keep_alive (#4384)
* Adding RPC informant structs

* RPC informant

* Middleware counting RPC requests

* Moving client keep_alive to middleware
2017-02-04 22:18:19 +01:00
Tomasz Drwięga 853aae2b92 Validate dapps accounts with address book (#4407)
* Parametrize address book

* Improving types in account_provider

* Filtering dapps_accounts

* Fixing RPC tests
2017-02-03 13:56:47 +01:00
Tomasz Drwięga 9fb2be8f2b Optional from field in Transaction Requests (#4332)
* Infering default account when sending transactions if not provided

* Fixing test

* Fixing tests code

* Fixes.

* More fixes.

* Final fix.
2017-01-30 21:08:36 +01:00
Tomasz Drwięga cf348dae60 Persistent tracking of dapps (#4302)
* Tests for RPC

* Extracting dapp_id from Origin and x-parity-origin

* Separate type for DappId

* Persistent tracking of recent dapps

* Fixing tests

* Exposing dapp timestamps

* Fixing import to work on stable

* Fixing test again
2017-01-30 10:59:46 +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
Tomasz Drwięga 21006da125 Get rid of unsafe code in ethkey, propagate incorrect Secret errors. (#4119)
* Implementing secret

* Fixing tests
2017-01-11 12:16:47 +01:00
Robert Habermeier 8125b5690c Port `try` macro to new `?` operator. (#3962)
* initial untry sweep

* restore try in ipc codegen, fix inference

* change a few missed try instances
2016-12-27 12:53:56 +01: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
Gav Wood db73b0d66f
Merge remote-tracking branch 'origin/master' into dapps-accounts-rpc 2016-12-15 13:28:37 +01:00
Gav Wood 17cc2be4b5
Rename ethcore -> parity in license. 2016-12-11 19:30:54 +01:00
Tomasz Drwięga 4696d7f606 Additional RPCs for dapps accounts management 2016-12-10 12:36:04 +01:00
Robert Habermeier de4715bc67 Merge pull request #3732 from ethcore/jg-duplicate-accounts
Give accounts precedence over address_book entries
2016-12-08 12:27:26 +01:00
Jaco Greeff dba8cf3a3b Add test for RPC side 2016-12-07 17:58:22 +01:00
Jaco Greeff 46840d36c9 Add parity_removeAddress RPC 2016-12-07 16:53:46 +01:00
Jaco Greeff 21a3cf7b65 Swap order of addressbook & acocunts merge 2016-12-07 11:44:45 +01:00
Tomasz Drwięga a9028ca986 Merge branch 'master' into rpc-middleware
Conflicts:
	Cargo.lock
	rpc/src/v1/tests/mocked/parity_accounts.rs
2016-11-25 21:18:02 +01:00
Gav Wood 9f3a042f55 Update message 2016-11-23 20:16:33 +01:00
Tomasz Drwięga cd6f565f69 RPC Middleware & Get/Set dapp-specific accounts 2016-11-23 16:27:05 +01:00
Gav Wood 2b8bed434c
RPC for deleting accounts. 2016-11-20 16:17:57 +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