From 2fa0af6392f75cf9f7dd5f8250906e3767da8a5b Mon Sep 17 00:00:00 2001 From: Chase Wright Date: Tue, 5 Dec 2017 11:29:17 -0600 Subject: [PATCH] Patch 1 (#1) * Iterate over both buffered and unbuffered database entries * Fix iterator issues * no default uncles * prepare cargo configuration for upload of crates * update bigint version number * update ethcore-bigint version * rename hash crate to keccak-hash * update memorydb * update rlp * update patricia-trie cargo.toml * use error-chain in ethcore-network * interleaved-ordered 0.1.1 * static linking for snappy * removed redundant imports * Add the desktop file for the snap Now that we have added plugs to allow accessing the display, the snap needs a desktop file. And bonus point, it will appear on the menu when it's installed, and once you make a stable relase, it will appear in the gnome software center app! So, one-click install for parity :) Closes: #7056 * update icon for desktop * Properly display Signer errors (Snackbar display popup) (#7053) * Update to fixed @parity/ui (Errors component) * Update ParityBar radius to align with Snackbar/Errors * Update to latest @parity/ui * Update dependencies @parity/signer-plugin-* * Really pull in @parity/signer-plugin-* deps * CHANGELOG for 1.7.8, 1.7.9, 1.8.2, and 1.8.3 (#7055) * Update changelog for 1.7.8 stable * Update changelog for 1.7.9 stable * Improve wording in Changelog * Update changelog for 1.8.2 beta * Update changelog for 1.8.3 beta * [ci skip] js-precompiled 20171115-103846 * ECIP-1039: Monetary policy rounding specification Fix potential rounding errors between geth and parity in the long-term future. * Change reward calculation to only use divide once * SecretStore: servers set change session api (#6925) * SecretStore: first key versions flush * SecretStore: key versions in encryption session * SecretStore: flush key versions negotiation session * SecretStore: connected key version negotiation session to cluster * SecretStore: cluster sessions container refactoring * SecretStore: flush * SecretStore: flush key versions * SecretStore: flush * SecretStore: delegation proto * SecretStore: decryption_session_is_delegated_when_node_does_not_have_key_share * SecretStore: fixed version in decryption session * SecretStore: signing_session_is_delegated_when_node_does_not_have_key_share * SecretStore: started restoring admin sessions * SecretStore: restoring admin sessions * SecretStore: removed obsolete ShareRemove && ShareMove sessions * SecretStore: ShareAdd math tests only require old_t+1 nodes * SecretStore: ShareAdd revamp using new math backend * SecretStore: do not include isolated nodes into consensus_group * SecretStore: ServersSetChange + ShareAdd revamp * removed debug printlns * SecretStore: key version negotiation tests * SecretStore: removed debug/merge artifacts * SecretStore: fixed master node selection * SecretStore: cleanup + tests + fixes * SecretStore: uncommented tests * SecretStore: cleaning up * SecretStore: cleaning up + tests * SecretStore: cleaning up * SecretStore: cleaning up && tests * SecretStore: fixing TODOs * SecretStore: fixing TODOs + cleanup * SecretStore: fixing TODOs * SecretStore: nodes_add_to_the_node_with_obsolete_version * SecretStore: nodes_add_fails_when_not_enough_share_owners_are_connected * SecretStore: tests * SecretStore: signing && delegation tests * SecretStore: signing && decryption tests when some nodes are isolated * SecretStore: sessions_are_removed_when_initialization_fails * SecretStore: ceaning up * SecretStore: removed obsolete comments * SecretStore: signing_session_completes_if_node_does_not_have_a_share * SecretStore: initial ServersSetChange API * SecretStore: added secretstore_signServersSet RPC * SecretStore: ChangeServersSet parse tests * SecretStore: fixes after manual ServersSetChange tests * lost file * fixed network ports overlap in tests * lost files * fix tests on patricia-trie * updated eth-secp256k1 * Fix no-default-features. * Parse payload from panic Impl payload empty str is none Update tests Clean Update wasm-tests * Allow localUrl in manifest * Improve Github Issue Template: IT CROWD approved version. * Remove seperator that causes issue descriptions to become headlines sometimes * Add to all icon_url places * Add appId as needed to local dapps * localUrl only from manifest * Update panic_payload.rs * Use query-string for search parsing * spaces to tabs. * Add localUrl to serialization * Make storage_read/write return nothing * Update gas values * Update wasm-tests * Cleanup debug info * Remove debug log * Optimize & group dapp requests (#7083) * Group similar methods in same grouping * Add a shell_getMethodGroups API * Small code clean changes * Fix bug dapp.name not showing * Additional error handling * Store sources in own map * Remove observable variables where not needed * Refactor code and fix bug dapp not showing on approve * [ci skip] js-precompiled 20171121-150329 * Remove unused and duplicated files in js-old (#7082) * Cleanup v1 build process, application-only * Remove built-in dapps from build (duplicated) * User @parity/api instead of local version * Update references to @parity/abi * Remove unused js-old api/abi folders * Remove duplicated v1 jsonrpc * Cleanup unused routes * Update manifest with wallet image * Update wallet logo * Re-add missing test.sh * Update rpc mocks * Update tests for Providers * Use flex for iframe & status * Additional cleanups (Home screen for embed) * Keep statusbar fixed (and non-overallping with dapps) * [ci skip] js-precompiled 20171121-164807 * Cleanup top bar, add Home icon for navigation (#7118) * Localise images to config.js file * Remove sample status plugin (commented) * Update image references from config * Remove Unknown capability & Capable (only display actions) * Update to @parity/ui 2.2.14 * Add Home icon on statusbar (go back) * 2.2.14 -> 2.2.x * Builtin dapp icons where dappreg not available * [ci skip] js-precompiled 20171122-140247 * fixed RotatingLogger after migrating to new arrayvec * Update packages, pull in compiled-only repos (#7125) * Update packages, pull in compiled-only repos * Update js-precompiled to point to js-dist-paritytech * Trigger both js & js-old builds to force update * Update to bring scripts 100% in-sync * Fixed build && test (#7128) * fixed build && test * fixed rpc tests * Update js-precompiled ref, trigger JS build * Add test for ECIP1017 at block 250000000 * Wrong era used in ECIP1017 test It is era 49, and should correspond to ECIP1017/ECIP1039's era 50. * [ci skip] js-precompiled 20171124-124119 * Push to correct shell branch (#7135) * Push to correct shell branch * Trigger both js & js-old builds * [ci skip] js-precompiled 20171124-134823 * pwasm-run-test utility * WASM Remove blockhash error (#7121) * Remove blockhash error * Update tests. * Pull in new dapp-{methods,visible} dapps (#7150) * [ci skip] js-precompiled 20171128-091552 * fixes typo in user config path (#7159) * Cleanup JS build artifacts (#7164) * Cleanup JS build artifacts * Trigger js & js-old * [ci skip] js-precompiled 20171129-135441 * Use git flag to remove old js artifacts (#7165) * [ci skip] js-precompiled 20171129-144917 * Remove *.css.map & *.js.map (#7168) * [ci skip] js-precompiled 20171129-172021 * Delete unused package.json (dist) (#7173) * [ci skip] js-precompiled 20171130-103432 * Assorted improvements for ethstore and ethkey (#6961) * Testing many passwords for presale wallet. * Add multiple threads. * WiP: ethkey brain wallets recover. * Refactor pre-sale-wallet cracking. * Generate in multiple threads. Brain with prefix. * Validate bain wallet phrase. * Brain wallet recovery. * Self-review fixes. * Fix tests. * More docs. * Bump versions. * Remove cmd_find from borked merge. * Update wasm submodules. * Use threadpool. * upper limit is gas limit * 10 in estimate gas * React 16 (#7174) * Update packages to use React 16 * Rollback to react-router v3 * Use component instead of pure one * Remove warning about mobx * Make webpack load css from @parity/ui * Update enzyme to support react16 * Fix lint * Use @parity/ui v3 * Update refs of plugin-signer-* deps * Exclude plugin-signer-* from babel processing * Reupdate refs to old method * Update refs again * [ci skip] js-precompiled 20171201-114538 * pwasm-run-test utility upgrade * Removed ethcore-util dependency from ethcore-network (#7180) * Removed ethcore-util dependency * Removed snappy * New account selector UI in top bar (#7179) * Add a dropdown popup for account selector * Install sui latest version for hideOnScroll bug fix * Update ui * Update package-lock after rebase * Require parity/ui v3.0.3 * Pass accountStore as props * Require parity/ui v3.0.4 * [ci skip] js-precompiled 20171204-115345 * Update mocha import stubs (#7191) * Update mocha import stubs * Add .md files to ignore list * [ci skip] js-precompiled 20171205-084709 * Update FirstRun for UI-2 (#7195) * WIP * Update after @parity/ui update * Update to latest * Update semver for @parity * Update & -> & * [ci skip] js-precompiled 20171205-102703 * Maximum uncle count transition (#7196) * Enable delayed maximum_uncle_count activation. * Fix tests. * Defer kovan HF. * mistake comment in calc difficulty (#7154) * Send each log as a separate notifications. (#7175) * Update config.full.toml --- .github/ISSUE_TEMPLATE.md | 11 +- CHANGELOG.md | 43 +- Cargo.lock | 307 +- Cargo.toml | 4 +- dapps/Cargo.toml | 2 +- dapps/src/apps/app.rs | 4 + dapps/src/apps/fetcher/mod.rs | 1 + dapps/src/apps/fs.rs | 1 + dapps/src/endpoint.rs | 1 + dapps/src/lib.rs | 2 +- dapps/src/page/builtin.rs | 1 + dapps/src/tests/fetch.rs | 5 +- dapps/ui/Cargo.toml | 4 +- docs/CHANGELOG-1.7.md | 47 +- ethash/Cargo.toml | 2 +- ethash/src/keccak.rs | 2 +- ethcore/Cargo.toml | 6 +- ethcore/evm/Cargo.toml | 2 +- ethcore/evm/src/lib.rs | 2 +- ethcore/light/Cargo.toml | 8 +- ethcore/light/src/client/service.rs | 6 +- ethcore/light/src/lib.rs | 4 +- ethcore/light/src/net/error.rs | 16 +- ethcore/light/src/net/load_timer.rs | 5 +- ethcore/res/ethereum/kovan.json | 4 +- ethcore/res/wasm-tests | 2 +- ethcore/src/block.rs | 9 +- ethcore/src/client/client.rs | 18 +- ethcore/src/engines/authority_round/mod.rs | 49 +- ethcore/src/engines/mod.rs | 5 +- ethcore/src/engines/null_engine.rs | 3 + ethcore/src/engines/tendermint/mod.rs | 2 +- ethcore/src/ethereum/ethash.rs | 14 +- ethcore/src/lib.rs | 2 +- ethcore/src/verification/verification.rs | 11 +- ethcore/types/Cargo.toml | 2 +- ethcore/types/src/lib.rs | 2 +- ethcore/vm/Cargo.toml | 4 +- ethcore/vm/src/lib.rs | 2 +- ethcore/wasm/run/Cargo.toml | 19 + ethcore/wasm/run/res/sample-fixture.json | 45 + ethcore/wasm/run/res/sample1.wasm | Bin 0 -> 125 bytes ethcore/wasm/run/res/sample2.wasm | Bin 0 -> 15410 bytes ethcore/wasm/run/res/sample3.wasm | Bin 0 -> 9736 bytes ethcore/wasm/run/src/fixture.rs | 70 + ethcore/wasm/run/src/main.rs | 46 + ethcore/wasm/run/src/runner.rs | 261 + ethcore/wasm/src/env.rs | 6 +- ethcore/wasm/src/lib.rs | 1 + ethcore/wasm/src/panic_payload.rs | 168 + ethcore/wasm/src/runtime.rs | 33 +- ethcore/wasm/src/tests.rs | 46 +- ethkey/Cargo.toml | 15 +- ethkey/README.md | 97 +- ethkey/cli/Cargo.toml | 9 +- ethkey/cli/src/main.rs | 187 +- ethkey/src/brain.rs | 14 +- ethkey/src/brain_prefix.rs | 70 + ethkey/src/brain_recover.rs | 175 + ethkey/src/lib.rs | 22 +- ethkey/src/prefix.rs | 2 +- ethkey/src/random.rs | 6 +- ethstore/Cargo.toml | 2 +- ethstore/README.md | 25 +- ethstore/cli/Cargo.toml | 4 +- ethstore/cli/src/crack.rs | 50 + ethstore/cli/src/main.rs | 28 +- hash-fetch/Cargo.toml | 2 +- hash-fetch/src/lib.rs | 2 +- ipfs/Cargo.toml | 1 - ipfs/src/lib.rs | 1 - js-old/npm/etherscan/README.md | 34 - js-old/npm/etherscan/package.json | 33 - js-old/npm/jsonrpc/README.md | 5 - js-old/npm/jsonrpc/package.json | 29 - js-old/npm/parity/README.md | 83 - js-old/npm/parity/package.json | 33 - js-old/npm/parity/test/smoke.spec.js | 26 - js-old/npm/shapeshift/README.md | 34 - js-old/npm/shapeshift/package.json | 31 - js-old/npm/test/mocha.config.js | 29 - js-old/npm/test/mocha.opts | 1 - js-old/package-lock.json | 586 +- js-old/package.json | 8 +- js-old/scripts/build-rpc-json.js | 70 - js-old/scripts/build-rpc-markdown.js | 328 - js-old/scripts/dryrun-npm.sh | 36 - js-old/scripts/helpers/log.js | 32 - js-old/scripts/helpers/parsed-rpc-traits.js | 81 - js-old/scripts/push-precompiled.sh | 71 +- js-old/scripts/test.js | 2 +- js-old/src/3rdparty/etherscan/account.js | 2 +- js-old/src/abi/README.md | 32 - js-old/src/abi/decoder/bytesTaken.js | 30 - js-old/src/abi/decoder/bytesTaken.spec.js | 29 - js-old/src/abi/decoder/decodeResult.js | 30 - js-old/src/abi/decoder/decodeResult.spec.js | 29 - js-old/src/abi/decoder/decoder.js | 156 - js-old/src/abi/decoder/decoder.spec.js | 319 - js-old/src/abi/encoder/encoder.js | 75 - js-old/src/abi/encoder/encoder.spec.js | 291 - js-old/src/abi/encoder/index.js | 17 - js-old/src/abi/encoder/mediate.js | 142 - js-old/src/abi/encoder/mediate.spec.js | 105 - js-old/src/abi/spec/constructor.js | 36 - js-old/src/abi/spec/constructor.spec.js | 52 - js-old/src/abi/spec/event/decodedLog.js | 30 - js-old/src/abi/spec/event/decodedLog.spec.js | 28 - js-old/src/abi/spec/event/decodedLogParam.js | 45 - .../abi/spec/event/decodedLogParam.spec.js | 42 - js-old/src/abi/spec/event/event.js | 114 - js-old/src/abi/spec/event/event.spec.js | 111 - js-old/src/abi/spec/event/eventParam.js | 41 - js-old/src/abi/spec/event/eventParam.spec.js | 44 - js-old/src/abi/spec/function.js | 88 - js-old/src/abi/spec/function.spec.js | 101 - js-old/src/abi/spec/index.js | 17 - js-old/src/abi/spec/interface.js | 77 - js-old/src/abi/spec/interface.spec.js | 126 - js-old/src/abi/spec/param.js | 42 - js-old/src/abi/spec/param.spec.js | 47 - js-old/src/abi/spec/paramType/format.js | 80 - js-old/src/abi/spec/paramType/format.spec.js | 228 - js-old/src/abi/spec/paramType/index.js | 17 - js-old/src/abi/spec/paramType/paramType.js | 52 - .../src/abi/spec/paramType/paramType.spec.js | 87 - js-old/src/abi/spec/paramType/types.js | 19 - js-old/src/abi/token/index.js | 17 - js-old/src/abi/token/token.js | 42 - js-old/src/abi/token/token.spec.js | 75 - js-old/src/abi/util/address.js | 66 - js-old/src/abi/util/address.spec.js | 100 - js-old/src/abi/util/pad.js | 77 - js-old/src/abi/util/pad.spec.js | 124 - js-old/src/abi/util/signature.js | 49 - js-old/src/abi/util/signature.spec.js | 111 - js-old/src/abi/util/slice.js | 31 - js-old/src/abi/util/slice.spec.js | 44 - js-old/src/abi/util/sliceAs.js | 47 - js-old/src/abi/util/sliceAs.spec.js | 55 - js-old/src/abi/util/types.js | 27 - js-old/src/abi/util/types.spec.js | 62 - js-old/src/api/README.md | 146 - js-old/src/api/api.js | 179 - js-old/src/api/api.spec.js | 59 - js-old/src/api/contract/contract.js | 561 - js-old/src/api/contract/contract.spec.js | 597 - js-old/src/api/contract/index.js | 17 - js-old/src/api/format/input.js | 242 - js-old/src/api/format/input.spec.js | 341 - js-old/src/api/format/output.js | 414 - js-old/src/api/format/output.spec.js | 502 - js-old/src/api/index.js | 17 - js-old/src/api/local/accounts/account.js | 116 - js-old/src/api/local/accounts/accounts.js | 229 - js-old/src/api/local/ethkey/ethkey.js | 147 - js-old/src/api/local/ethkey/ethkey.wasm.js | 1 - js-old/src/api/local/ethkey/index.js | 47 - js-old/src/api/local/ethkey/index.spec.js | 58 - js-old/src/api/local/ethkey/worker.js | 138 - js-old/src/api/local/ethkey/workerPool.js | 105 - js-old/src/api/local/index.js | 17 - .../src/api/local/localAccountsMiddleware.js | 288 - .../api/local/localAccountsMiddleware.spec.js | 157 - js-old/src/api/local/transactions.js | 147 - js-old/src/api/local/transactions.spec.js | 85 - js-old/src/api/pubsub/eth/eth.js | 227 - js-old/src/api/pubsub/eth/index.js | 16 - js-old/src/api/pubsub/index.js | 16 - js-old/src/api/pubsub/net/index.js | 16 - js-old/src/api/pubsub/net/net.js | 42 - js-old/src/api/pubsub/parity/index.js | 16 - js-old/src/api/pubsub/parity/parity.js | 356 - js-old/src/api/pubsub/pubsub.js | 50 - js-old/src/api/pubsub/pubsub.spec.js | 613 - js-old/src/api/pubsub/pubsubBase.js | 37 - js-old/src/api/rpc/db/db.js | 43 - js-old/src/api/rpc/db/db.spec.js | 38 - js-old/src/api/rpc/db/index.js | 17 - js-old/src/api/rpc/eth/eth.e2e.js | 170 - js-old/src/api/rpc/eth/eth.js | 321 - js-old/src/api/rpc/eth/eth.spec.js | 474 - js-old/src/api/rpc/eth/index.js | 17 - js-old/src/api/rpc/index.js | 25 - js-old/src/api/rpc/net/index.js | 17 - js-old/src/api/rpc/net/net.e2e.js | 46 - js-old/src/api/rpc/net/net.js | 39 - js-old/src/api/rpc/net/net.spec.js | 36 - js-old/src/api/rpc/parity/index.js | 17 - js-old/src/api/rpc/parity/parity.e2e.js | 79 - js-old/src/api/rpc/parity/parity.js | 578 - js-old/src/api/rpc/parity/parity.spec.js | 146 - js-old/src/api/rpc/personal/index.js | 17 - js-old/src/api/rpc/personal/personal.e2e.js | 53 - js-old/src/api/rpc/personal/personal.js | 46 - js-old/src/api/rpc/personal/personal.spec.js | 75 - js-old/src/api/rpc/shh/index.js | 17 - js-old/src/api/rpc/shh/shh.js | 91 - js-old/src/api/rpc/signer/index.js | 17 - js-old/src/api/rpc/signer/signer.js | 65 - js-old/src/api/rpc/trace/index.js | 17 - js-old/src/api/rpc/trace/trace.e2e.js | 45 - js-old/src/api/rpc/trace/trace.js | 66 - js-old/src/api/rpc/trace/trace.spec.js | 44 - js-old/src/api/rpc/web3/index.js | 17 - js-old/src/api/rpc/web3/web3.e2e.js | 44 - js-old/src/api/rpc/web3/web3.js | 33 - js-old/src/api/rpc/web3/web3.spec.js | 38 - js-old/src/api/subscriptions/eth.js | 63 - js-old/src/api/subscriptions/eth.spec.js | 101 - js-old/src/api/subscriptions/index.js | 19 - js-old/src/api/subscriptions/logging.js | 44 - js-old/src/api/subscriptions/logging.spec.js | 49 - js-old/src/api/subscriptions/manager.js | 137 - js-old/src/api/subscriptions/manager.spec.js | 134 - js-old/src/api/subscriptions/personal.js | 135 - js-old/src/api/subscriptions/personal.spec.js | 156 - js-old/src/api/subscriptions/signer.js | 91 - js-old/src/api/transport/error.js | 61 - js-old/src/api/transport/http/http.e2e.js | 29 - js-old/src/api/transport/http/http.js | 103 - js-old/src/api/transport/http/http.spec.js | 142 - js-old/src/api/transport/http/index.js | 17 - js-old/src/api/transport/index.js | 20 - js-old/src/api/transport/jsonRpcBase.js | 145 - js-old/src/api/transport/jsonRpcBase.spec.js | 88 - js-old/src/api/transport/middleware.js | 44 - js-old/src/api/transport/middleware.spec.js | 62 - js-old/src/api/transport/ws/index.js | 17 - js-old/src/api/transport/ws/ws.e2e.js | 29 - js-old/src/api/transport/ws/ws.js | 387 - js-old/src/api/transport/ws/ws.spec.js | 116 - js-old/src/api/util/decode.js | 95 - js-old/src/api/util/decode.spec.js | 105 - js-old/src/api/util/encode.js | 69 - js-old/src/api/util/encode.spec.js | 90 - js-old/src/api/util/format.js | 106 - js-old/src/api/util/format.spec.js | 94 - js-old/src/api/util/identity.js | 30 - js-old/src/api/util/index.js | 51 - js-old/src/api/util/sha3.js | 36 - js-old/src/api/util/sha3.spec.js | 46 - js-old/src/api/util/types.js | 60 - js-old/src/api/util/types.spec.js | 118 - js-old/src/api/util/wei.js | 37 - js-old/src/api/util/wei.spec.js | 57 - js-old/src/contracts/badgereg.js | 2 +- js-old/src/contracts/registry.spec.js | 2 +- js-old/src/dapps/chaindeploy.js | 29 - .../chaindeploy/Application/application.css | 78 - .../chaindeploy/Application/application.js | 178 - .../dapps/chaindeploy/Application/index.js | 17 - .../dapps/chaindeploy/Contract/contract.js | 132 - .../src/dapps/chaindeploy/Contract/index.js | 17 - js-old/src/dapps/chaindeploy/Dapp/dapp.js | 98 - js-old/src/dapps/chaindeploy/Dapp/index.js | 17 - .../chaindeploy/ListItem/Header/header.js | 45 - .../chaindeploy/ListItem/Header/index.js | 17 - .../dapps/chaindeploy/ListItem/Icon/icon.js | 53 - .../dapps/chaindeploy/ListItem/Icon/index.js | 17 - .../dapps/chaindeploy/ListItem/Row/index.js | 17 - .../src/dapps/chaindeploy/ListItem/Row/row.js | 54 - .../src/dapps/chaindeploy/ListItem/index.js | 20 - .../dapps/chaindeploy/ListItem/listItem.css | 94 - .../dapps/chaindeploy/ListItem/listItem.js | 63 - js-old/src/dapps/chaindeploy/_dapps.js | 43 - .../chaindeploy/contracts/abi/jg-voting.json | 1 - .../chaindeploy/contracts/code/badgereg.json | 5 - .../chaindeploy/contracts/code/dappreg.json | 5 - .../chaindeploy/contracts/code/gavcoin.json | 5 - .../contracts/code/githubhint.json | 5 - .../chaindeploy/contracts/code/jg-voting.json | 5 - .../chaindeploy/contracts/code/registry.json | 5 - .../contracts/code/signaturereg.json | 5 - .../contracts/code/tokendeploy.json | 5 - .../chaindeploy/contracts/code/tokenreg.json | 5 - .../contracts/code/verifyEmail.json | 5 - .../chaindeploy/contracts/code/verifySms.json | 5 - .../dapps/chaindeploy/contracts/dappreg.js | 30 - .../dapps/chaindeploy/contracts/gavcoin.js | 32 - .../dapps/chaindeploy/contracts/githubhint.js | 30 - .../src/dapps/chaindeploy/contracts/index.js | 52 - .../dapps/chaindeploy/contracts/jg-voting.js | 32 - .../dapps/chaindeploy/contracts/registry.js | 30 - .../chaindeploy/contracts/signaturereg.js | 30 - .../chaindeploy/contracts/tokendeployMgr.js | 30 - .../chaindeploy/contracts/tokendeployReg.js | 28 - .../dapps/chaindeploy/contracts/tokenreg.js | 30 - .../chaindeploy/contracts/verifyEmail.js | 37 - .../dapps/chaindeploy/contracts/verifySms.js | 37 - .../src/dapps/chaindeploy/contracts/wallet.js | 29 - js-old/src/dapps/chaindeploy/dapps/console.js | 33 - js-old/src/dapps/chaindeploy/dapps/dappreg.js | 33 - js-old/src/dapps/chaindeploy/dapps/gavcoin.js | 41 - .../src/dapps/chaindeploy/dapps/githubhint.js | 33 - js-old/src/dapps/chaindeploy/dapps/index.js | 50 - .../src/dapps/chaindeploy/dapps/jg-voting.js | 41 - .../dapps/chaindeploy/dapps/jg-whenblock.js | 39 - js-old/src/dapps/chaindeploy/dapps/localtx.js | 33 - .../src/dapps/chaindeploy/dapps/registry.js | 33 - .../dapps/chaindeploy/dapps/signaturereg.js | 33 - .../dapps/chaindeploy/dapps/tokendeploy.js | 33 - .../src/dapps/chaindeploy/dapps/tokenreg.js | 33 - js-old/src/dapps/chaindeploy/dapps/web.js | 33 - js-old/src/dapps/chaindeploy/parity.js | 21 - js-old/src/dapps/chaindeploy/store.js | 714 -- js-old/src/dapps/chaindeploy/utils.js | 82 - js-old/src/dapps/console.js | 59 - .../dapps/console/Application/application.css | 65 - .../dapps/console/Application/application.js | 94 - js-old/src/dapps/console/Application/index.js | 17 - .../console/Autocomplete/autocomplete.css | 55 - .../console/Autocomplete/autocomplete.js | 96 - .../Autocomplete/autocomplete.store.js | 234 - .../src/dapps/console/Autocomplete/index.js | 17 - js-old/src/dapps/console/Console/console.css | 58 - js-old/src/dapps/console/Console/console.js | 118 - .../dapps/console/Console/console.store.js | 126 - js-old/src/dapps/console/Console/index.js | 17 - js-old/src/dapps/console/Header/header.css | 51 - js-old/src/dapps/console/Header/header.js | 65 - js-old/src/dapps/console/Header/index.js | 17 - js-old/src/dapps/console/Input/index.js | 17 - js-old/src/dapps/console/Input/input.css | 46 - js-old/src/dapps/console/Input/input.js | 145 - js-old/src/dapps/console/Input/input.store.js | 124 - js-old/src/dapps/console/Settings/index.js | 17 - .../src/dapps/console/Settings/settings.css | 32 - js-old/src/dapps/console/Settings/settings.js | 70 - .../dapps/console/Settings/settings.store.js | 71 - js-old/src/dapps/console/Snippets/index.js | 17 - .../src/dapps/console/Snippets/snippets.css | 122 - js-old/src/dapps/console/Snippets/snippets.js | 221 - .../dapps/console/Snippets/snippets.store.js | 249 - js-old/src/dapps/console/Watches/index.js | 17 - js-old/src/dapps/console/Watches/watches.css | 107 - js-old/src/dapps/console/Watches/watches.js | 186 - .../dapps/console/Watches/watches.store.js | 148 - js-old/src/dapps/console/codemirror.css | 36 - js-old/src/dapps/console/parity.js | 331 - js-old/src/dapps/console/utils.js | 36 - js-old/src/dapps/dappreg.js | 48 - .../dapps/dappreg/Application/application.css | 59 - .../dapps/dappreg/Application/application.js | 69 - js-old/src/dapps/dappreg/Application/index.js | 17 - js-old/src/dapps/dappreg/Button/button.css | 47 - js-old/src/dapps/dappreg/Button/button.js | 55 - js-old/src/dapps/dappreg/Button/index.js | 17 - js-old/src/dapps/dappreg/Card/card.css | 66 - js-old/src/dapps/dappreg/Card/card.js | 99 - js-old/src/dapps/dappreg/Card/index.js | 17 - .../dappreg/CreateDappCard/createDappCard.js | 84 - .../src/dapps/dappreg/CreateDappCard/index.js | 17 - .../src/dapps/dappreg/DappCard/dappCard.css | 22 - js-old/src/dapps/dappreg/DappCard/dappCard.js | 110 - js-old/src/dapps/dappreg/DappCard/index.js | 17 - .../src/dapps/dappreg/DappModal/dappModal.css | 82 - .../src/dapps/dappreg/DappModal/dappModal.js | 423 - js-old/src/dapps/dappreg/DappModal/index.js | 17 - js-old/src/dapps/dappreg/Dapps/dapps.css | 38 - js-old/src/dapps/dappreg/Dapps/dapps.js | 73 - js-old/src/dapps/dappreg/Dapps/index.js | 17 - js-old/src/dapps/dappreg/Input/index.js | 17 - js-old/src/dapps/dappreg/Input/input.css | 96 - js-old/src/dapps/dappreg/Input/input.js | 53 - js-old/src/dapps/dappreg/Modal/index.js | 17 - js-old/src/dapps/dappreg/Modal/modal.css | 141 - js-old/src/dapps/dappreg/Modal/modal.js | 160 - js-old/src/dapps/dappreg/ModalDelete/index.js | 17 - .../dapps/dappreg/ModalDelete/modalDelete.js | 61 - .../src/dapps/dappreg/ModalRegister/index.js | 17 - .../dappreg/ModalRegister/modalRegister.js | 68 - js-old/src/dapps/dappreg/ModalUpdate/index.js | 17 - .../dapps/dappreg/ModalUpdate/modalUpdate.js | 84 - .../src/dapps/dappreg/SelectAccount/index.js | 17 - .../dappreg/SelectAccount/selectAccount.js | 57 - .../src/dapps/dappreg/Transactions/index.js | 17 - .../dappreg/Transactions/transactions.css | 95 - .../dappreg/Transactions/transactions.js | 136 - js-old/src/dapps/dappreg/Warning/index.js | 17 - js-old/src/dapps/dappreg/Warning/warning.js | 55 - js-old/src/dapps/dappreg/_colors.css | 30 - js-old/src/dapps/dappreg/_utils.css | 22 - js-old/src/dapps/dappreg/dappStore.js | 153 - js-old/src/dapps/dappreg/dappsStore.js | 522 - js-old/src/dapps/dappreg/parity.js | 45 - js-old/src/dapps/dappreg/utils.js | 190 - js-old/src/dapps/dappreg/utils.spec.js | 33 - js-old/src/dapps/githubhint.js | 48 - .../githubhint/Application/application.css | 161 - .../githubhint/Application/application.js | 521 - .../src/dapps/githubhint/Application/index.js | 17 - js-old/src/dapps/githubhint/Button/button.css | 56 - js-old/src/dapps/githubhint/Button/button.js | 53 - js-old/src/dapps/githubhint/Button/index.js | 17 - js-old/src/dapps/githubhint/Events/events.css | 37 - js-old/src/dapps/githubhint/Events/events.js | 52 - js-old/src/dapps/githubhint/Events/index.js | 17 - js-old/src/dapps/githubhint/Loading/index.js | 17 - .../src/dapps/githubhint/Loading/loading.css | 24 - .../src/dapps/githubhint/Loading/loading.js | 29 - js-old/src/dapps/githubhint/parity.js | 21 - js-old/src/dapps/githubhint/services.js | 60 - js-old/src/dapps/index.ejs | 37 - js-old/src/dapps/localtx.js | 48 - .../dapps/localtx/Application/application.css | 43 - .../dapps/localtx/Application/application.js | 212 - .../localtx/Application/application.spec.js | 32 - js-old/src/dapps/localtx/Application/index.js | 17 - .../localtx/IdentityIcon/identityIcon.css | 23 - .../localtx/IdentityIcon/identityIcon.js | 37 - .../src/dapps/localtx/IdentityIcon/index.js | 17 - js-old/src/dapps/localtx/Transaction/index.js | 17 - .../dapps/localtx/Transaction/transaction.css | 39 - .../dapps/localtx/Transaction/transaction.js | 395 - .../localtx/Transaction/transaction.spec.js | 67 - js-old/src/dapps/localtx/parity.js | 21 - js-old/src/dapps/registry.js | 49 - .../src/dapps/registry/Accounts/accounts.js | 66 - js-old/src/dapps/registry/Accounts/actions.js | 40 - js-old/src/dapps/registry/Accounts/index.js | 17 - .../registry/Application/application.css | 66 - .../dapps/registry/Application/application.js | 138 - .../src/dapps/registry/Application/index.js | 17 - js-old/src/dapps/registry/Container.js | 68 - js-old/src/dapps/registry/Events/actions.js | 102 - js-old/src/dapps/registry/Events/events.css | 57 - js-old/src/dapps/registry/Events/events.js | 315 - js-old/src/dapps/registry/Events/index.js | 17 - js-old/src/dapps/registry/Events/reducers.js | 90 - .../registry/IdentityIcon/identityIcon.css | 23 - .../registry/IdentityIcon/identityIcon.js | 40 - .../src/dapps/registry/IdentityIcon/index.js | 17 - js-old/src/dapps/registry/Lookup/actions.js | 108 - js-old/src/dapps/registry/Lookup/index.js | 17 - js-old/src/dapps/registry/Lookup/lookup.css | 26 - js-old/src/dapps/registry/Lookup/lookup.js | 179 - js-old/src/dapps/registry/Lookup/reducers.js | 48 - js-old/src/dapps/registry/Names/actions.js | 135 - js-old/src/dapps/registry/Names/index.js | 17 - js-old/src/dapps/registry/Names/names.css | 46 - js-old/src/dapps/registry/Names/names.js | 191 - js-old/src/dapps/registry/Names/reducers.js | 75 - js-old/src/dapps/registry/Records/actions.js | 75 - js-old/src/dapps/registry/Records/index.js | 1 - js-old/src/dapps/registry/Records/records.css | 42 - js-old/src/dapps/registry/Records/records.js | 137 - js-old/src/dapps/registry/Records/reducers.js | 55 - js-old/src/dapps/registry/Reverse/actions.js | 117 - js-old/src/dapps/registry/Reverse/index.js | 1 - js-old/src/dapps/registry/Reverse/reducers.js | 85 - js-old/src/dapps/registry/Reverse/reverse.css | 42 - js-old/src/dapps/registry/Reverse/reverse.js | 162 - js-old/src/dapps/registry/actions.js | 95 - .../registry/addresses/accounts-reducer.js | 39 - .../src/dapps/registry/addresses/actions.js | 38 - .../registry/addresses/contacts-reducer.js | 32 - js-old/src/dapps/registry/parity.js | 23 - js-old/src/dapps/registry/reducers.js | 63 - js-old/src/dapps/registry/store.js | 22 - js-old/src/dapps/registry/ui/address.css | 41 - js-old/src/dapps/registry/ui/address.js | 120 - js-old/src/dapps/registry/ui/hash.css | 25 - js-old/src/dapps/registry/ui/hash.js | 67 - js-old/src/dapps/registry/ui/image.js | 40 - js-old/src/dapps/registry/util/actions.js | 31 - .../src/dapps/registry/util/etherscan-url.js | 28 - js-old/src/dapps/registry/util/post-tx.js | 30 - js-old/src/dapps/registry/util/registry.js | 37 - js-old/src/dapps/signaturereg.js | 48 - .../signaturereg/Application/application.css | 29 - .../signaturereg/Application/application.js | 121 - .../dapps/signaturereg/Application/index.js | 17 - .../src/dapps/signaturereg/Button/button.css | 43 - .../src/dapps/signaturereg/Button/button.js | 50 - js-old/src/dapps/signaturereg/Button/index.js | 17 - .../src/dapps/signaturereg/Events/events.css | 76 - .../src/dapps/signaturereg/Events/events.js | 84 - js-old/src/dapps/signaturereg/Events/index.js | 17 - .../src/dapps/signaturereg/Header/header.css | 67 - .../src/dapps/signaturereg/Header/header.js | 48 - js-old/src/dapps/signaturereg/Header/index.js | 17 - .../IdentityIcon/identityIcon.css | 23 - .../signaturereg/IdentityIcon/identityIcon.js | 37 - .../dapps/signaturereg/IdentityIcon/index.js | 17 - .../src/dapps/signaturereg/Import/import.css | 151 - .../src/dapps/signaturereg/Import/import.js | 204 - js-old/src/dapps/signaturereg/Import/index.js | 17 - .../src/dapps/signaturereg/Loading/index.js | 17 - .../dapps/signaturereg/Loading/loading.css | 24 - .../src/dapps/signaturereg/Loading/loading.js | 29 - js-old/src/dapps/signaturereg/format.js | 40 - js-old/src/dapps/signaturereg/parity.js | 21 - js-old/src/dapps/signaturereg/services.js | 181 - js-old/src/dapps/static/.gitkeep | 0 js-old/src/dapps/style.css | 48 - js-old/src/dapps/tokendeploy.js | 68 - .../AddressSelect/addressSelect.css | 27 - .../AddressSelect/addressSelect.js | 95 - .../dapps/tokendeploy/AddressSelect/index.js | 17 - .../tokendeploy/Application/Header/header.css | 71 - .../tokendeploy/Application/Header/header.js | 81 - .../tokendeploy/Application/Header/index.js | 17 - .../tokendeploy/Application/Loading/index.js | 17 - .../Application/Loading/loading.css | 24 - .../Application/Loading/loading.js | 29 - .../tokendeploy/Application/application.css | 28 - .../tokendeploy/Application/application.js | 107 - .../dapps/tokendeploy/Application/index.js | 17 - .../dapps/tokendeploy/Application/pages.js | 38 - .../dapps/tokendeploy/Container/container.css | 26 - .../dapps/tokendeploy/Container/container.js | 37 - .../src/dapps/tokendeploy/Container/index.js | 17 - .../Deploy/Deployment/deployment.css | 19 - .../Deploy/Deployment/deployment.js | 321 - .../tokendeploy/Deploy/Deployment/index.js | 17 - .../dapps/tokendeploy/Deploy/Event/event.css | 69 - .../dapps/tokendeploy/Deploy/Event/event.js | 104 - .../dapps/tokendeploy/Deploy/Event/index.js | 17 - .../tokendeploy/Deploy/Events/events.css | 41 - .../dapps/tokendeploy/Deploy/Events/events.js | 145 - .../dapps/tokendeploy/Deploy/Events/index.js | 17 - js-old/src/dapps/tokendeploy/Deploy/deploy.js | 31 - js-old/src/dapps/tokendeploy/Deploy/index.js | 17 - .../tokendeploy/IdentityIcon/identityIcon.css | 22 - .../tokendeploy/IdentityIcon/identityIcon.js | 39 - .../dapps/tokendeploy/IdentityIcon/index.js | 17 - .../dapps/tokendeploy/Overview/Owner/index.js | 17 - .../tokendeploy/Overview/Owner/owner.css | 54 - .../dapps/tokendeploy/Overview/Owner/owner.js | 79 - .../dapps/tokendeploy/Overview/Token/index.js | 17 - .../tokendeploy/Overview/Token/token.css | 53 - .../dapps/tokendeploy/Overview/Token/token.js | 68 - .../src/dapps/tokendeploy/Overview/index.js | 17 - .../dapps/tokendeploy/Overview/overview.css | 26 - .../dapps/tokendeploy/Overview/overview.js | 105 - .../dapps/tokendeploy/Transfer/Event/event.js | 106 - .../dapps/tokendeploy/Transfer/Event/index.js | 17 - .../tokendeploy/Transfer/Events/events.js | 151 - .../tokendeploy/Transfer/Events/index.js | 17 - .../dapps/tokendeploy/Transfer/Send/index.js | 17 - .../dapps/tokendeploy/Transfer/Send/send.css | 19 - .../dapps/tokendeploy/Transfer/Send/send.js | 345 - .../src/dapps/tokendeploy/Transfer/index.js | 17 - .../dapps/tokendeploy/Transfer/transfer.js | 31 - js-old/src/dapps/tokendeploy/_form.css | 108 - js-old/src/dapps/tokendeploy/_status.css | 36 - js-old/src/dapps/tokendeploy/background.jpg | Bin 127459 -> 0 bytes js-old/src/dapps/tokendeploy/parity.js | 21 - js-old/src/dapps/tokendeploy/services.js | 293 - js-old/src/dapps/tokenreg.js | 54 - .../AccountSelector/account-selector.css | 25 - .../AccountSelector/account-selector.js | 130 - .../Accounts/AccountSelector/container.js | 51 - .../Accounts/AccountSelector/index.js | 17 - js-old/src/dapps/tokenreg/Accounts/actions.js | 55 - js-old/src/dapps/tokenreg/Accounts/reducer.js | 57 - .../src/dapps/tokenreg/Actions/Query/index.js | 17 - .../src/dapps/tokenreg/Actions/Query/query.js | 217 - .../dapps/tokenreg/Actions/Register/index.js | 17 - .../tokenreg/Actions/Register/register.js | 235 - js-old/src/dapps/tokenreg/Actions/actions.css | 50 - js-old/src/dapps/tokenreg/Actions/actions.js | 179 - .../src/dapps/tokenreg/Actions/component.js | 119 - .../src/dapps/tokenreg/Actions/container.js | 60 - js-old/src/dapps/tokenreg/Actions/index.js | 17 - js-old/src/dapps/tokenreg/Actions/reducer.js | 155 - .../tokenreg/Application/application.css | 35 - .../dapps/tokenreg/Application/application.js | 77 - .../src/dapps/tokenreg/Application/index.js | 17 - js-old/src/dapps/tokenreg/Chip/chip.css | 45 - js-old/src/dapps/tokenreg/Chip/chip.js | 72 - js-old/src/dapps/tokenreg/Chip/index.js | 17 - js-old/src/dapps/tokenreg/Container.js | 66 - .../tokenreg/IdentityIcon/identityIcon.css | 23 - .../tokenreg/IdentityIcon/identityIcon.js | 37 - .../src/dapps/tokenreg/IdentityIcon/index.js | 17 - .../dapps/tokenreg/Inputs/Text/container.js | 38 - .../src/dapps/tokenreg/Inputs/Text/index.js | 17 - .../dapps/tokenreg/Inputs/Text/input-text.js | 149 - js-old/src/dapps/tokenreg/Inputs/inputs.css | 33 - .../src/dapps/tokenreg/Inputs/validation.js | 253 - js-old/src/dapps/tokenreg/Loading/index.js | 17 - js-old/src/dapps/tokenreg/Loading/loading.js | 36 - js-old/src/dapps/tokenreg/Status/actions.js | 185 - js-old/src/dapps/tokenreg/Status/index.js | 17 - js-old/src/dapps/tokenreg/Status/reducer.js | 63 - js-old/src/dapps/tokenreg/Status/status.css | 42 - js-old/src/dapps/tokenreg/Status/status.js | 45 - .../dapps/tokenreg/Tokens/Token/add-meta.js | 227 - .../src/dapps/tokenreg/Tokens/Token/index.js | 17 - .../src/dapps/tokenreg/Tokens/Token/token.css | 140 - .../src/dapps/tokenreg/Tokens/Token/token.js | 399 - .../tokenreg/Tokens/Token/tokenContainer.js | 73 - js-old/src/dapps/tokenreg/Tokens/actions.js | 261 - js-old/src/dapps/tokenreg/Tokens/container.js | 65 - js-old/src/dapps/tokenreg/Tokens/index.js | 17 - js-old/src/dapps/tokenreg/Tokens/reducer.js | 114 - js-old/src/dapps/tokenreg/Tokens/tokens.css | 24 - js-old/src/dapps/tokenreg/Tokens/tokens.js | 52 - js-old/src/dapps/tokenreg/constants.js | 30 - js-old/src/dapps/tokenreg/parity.js | 21 - js-old/src/dapps/tokenreg/reducers.js | 28 - js-old/src/dapps/tokenreg/store.js | 22 - js-old/src/dapps/tokenreg/utils.js | 76 - js-old/src/dev.parity.html | 36 - js-old/src/dev.web3.html | 38 - js-old/src/embed.js | 132 - js-old/src/error_pages.css | 113 - js-old/src/inject.js | 18 - js-old/src/jsonrpc/.gitignore | 1 - js-old/src/jsonrpc/README.md | 21 - js-old/src/jsonrpc/helpers.js | 92 - js-old/src/jsonrpc/index.js | 37 - js-old/src/jsonrpc/index.spec.js | 49 - js-old/src/jsonrpc/interfaces/db.js | 107 - js-old/src/jsonrpc/interfaces/eth.js | 1319 --- js-old/src/jsonrpc/interfaces/net.js | 51 - js-old/src/jsonrpc/interfaces/parity.js | 2070 ---- js-old/src/jsonrpc/interfaces/personal.js | 101 - js-old/src/jsonrpc/interfaces/shh.js | 291 - js-old/src/jsonrpc/interfaces/signer.js | 237 - js-old/src/jsonrpc/interfaces/trace.js | 376 - js-old/src/jsonrpc/interfaces/web3.js | 46 - js-old/src/jsonrpc/types.js | 202 - js-old/src/library.etherscan.js | 33 - js-old/src/library.jsonrpc.js | 19 - js-old/src/library.parity.js | 34 - js-old/src/library.shapeshift.js | 33 - js-old/src/main.js | 6 +- js-old/src/manifest.json | 2 +- .../src/modals/CreateAccount/createAccount.js | 2 +- .../CreateAccount/createAccount.test.js | 2 +- js-old/src/modals/CreateAccount/store.js | 2 +- .../CreateWallet/WalletInfo/walletInfo.js | 2 +- .../modals/CreateWallet/createWalletStore.js | 4 +- .../modals/ExecuteContract/executeContract.js | 2 +- js-old/src/modals/Faucet/store.js | 2 +- js-old/src/modals/FirstRun/firstRun.js | 2 +- js-old/src/modals/Transfer/store.js | 2 +- .../Verification/GatherData/gatherData.js | 2 +- js-old/src/modals/Verification/email-store.js | 4 +- js-old/src/modals/Verification/store.js | 4 +- .../modals/WalletSettings/walletSettings.js | 2 +- js-old/src/parity.js | 31 - js-old/src/redux/providers/balancesActions.js | 2 +- .../certifications/certifiers.monitor.js | 4 +- .../certifications/enhanced-querier.js | 2 +- js-old/src/redux/providers/imagesReducer.js | 2 +- js-old/src/redux/providers/personalActions.js | 2 +- js-old/src/redux/providers/requestsActions.js | 2 +- .../src/redux/providers/signerMiddleware.js | 2 +- js-old/src/redux/providers/tokens.js | 2 +- js-old/src/redux/providers/walletActions.js | 4 +- js-old/src/routes.js | 36 +- js-old/src/ui/Balance/balance.spec.js | 2 +- .../ui/Form/AddressSelect/addressSelect.js | 2 +- .../Form/AddressSelect/addressSelectStore.js | 2 +- .../src/ui/Form/InputAddress/inputAddress.js | 2 +- js-old/src/ui/Form/TypedInput/typedInput.js | 4 +- js-old/src/ui/IdentityIcon/identityIcon.js | 2 +- .../ui/MethodDecoding/methodDecodingStore.js | 4 +- js-old/src/ui/TxList/TxRow/txRow.spec.js | 7 +- js-old/src/ui/TxList/txList.spec.js | 7 +- js-old/src/util/dapps.js | 2 +- js-old/src/util/qrscan.js | 4 +- js-old/src/util/signer.js | 4 +- js-old/src/util/tokens/index.js | 2 +- js-old/src/util/validation.js | 2 +- js-old/src/util/wallets/consensys-wallet.js | 6 +- js-old/src/util/wallets/foundation-wallet.js | 6 +- js-old/src/util/web3.extensions.js | 48 - js-old/src/views/Home/home.css | 5 +- js-old/src/views/Home/home.js | 67 +- js-old/src/views/Home/home.spec.js | 77 +- js-old/src/views/Settings/Views/defaults.js | 16 +- js-old/src/views/Settings/Views/views.js | 11 - .../SignRequest/signRequest.spec.js | 2 +- .../Wallet/Confirmations/confirmations.js | 2 +- .../views/Wallet/Transactions/transactions.js | 2 +- .../views/WriteContract/writeContractStore.js | 2 +- js-old/src/views/index.js | 8 +- js-old/src/web3.js | 36 - js-old/test/e2e/ethapi.js | 14 +- .../{src/abi/abi.js => test/ignoreImports.js} | 8 +- js-old/test/mocha.opts | 2 +- js-old/test/mockRpc.js | 2 +- js-old/test/npmJsonRpc.js | 29 - js-old/test/npmParity.js | 45 - js-old/test/types.js | 6 +- js-old/webpack/app.js | 116 +- js-old/webpack/embed.js | 49 - js-old/webpack/npm.js | 137 - js-old/webpack/shared.js | 7 +- js/assets/parity-logo-black-no-text.png | Bin 0 -> 1777 bytes js/package-lock.json | 9916 +++++++++++++---- js/package.json | 73 +- js/scripts/push-cargo.sh | 26 +- js/scripts/push-precompiled.sh | 70 +- js/scripts/test.js | 2 +- js/src/Application/application.css | 7 +- js/src/Application/application.js | 19 +- js/src/Application/store.js | 95 - js/src/Dapp/dapp.css | 4 +- js/src/Dapp/dapp.js | 4 +- js/src/DappRequests/README.md | 9 + js/src/DappRequests/Request/index.js | 17 - js/src/DappRequests/Request/request.js | 85 - .../RequestGroups/RequestGroups.css | 33 +- .../RequestGroups/RequestGroups.js | 116 + .../src/DappRequests/RequestGroups}/index.js | 2 +- js/src/DappRequests/dappRequests.css | 17 - js/src/DappRequests/dappRequests.js | 53 +- .../{filteredRequests.js => methodGroups.js} | 25 +- js/src/DappRequests/store.js | 330 +- js/src/FirstRun/TnC/tnc.js | 9 +- js/src/FirstRun/Welcome/welcome.js | 4 +- js/src/FirstRun/firstRun.js | 344 +- js/src/FirstRun/firstRun.spec.js | 34 +- .../src/FirstRun/store.js | 34 +- js/src/ParityBar/parityBar.css | 4 +- js/src/Status/Consensus/consensus.js | 38 +- .../AccountItem/accountItem.css | 19 +- .../DefaultAccount/AccountItem/accountItem.js | 64 + .../DefaultAccount/AccountItem}/index.js | 2 +- .../Status/DefaultAccount/defaultAccount.css | 24 +- .../Status/DefaultAccount/defaultAccount.js | 104 + .../src/Status/DefaultAccount}/index.js | 2 +- js/src/Status/status.css | 28 +- js/src/Status/status.js | 107 +- .../contracts/badgereg.js => js/src/config.js | 17 +- js/src/index.parity.js | 9 +- js/src/inject.js | 9 +- js/src/shellMiddleware.js | 41 +- .../index.js => js/test/ignoreImports.js | 9 +- js/test/mocha.config.js | 5 +- js/test/mocha.opts | 2 +- js/webpack/app.js | 44 +- json/src/spec/authority_round.rs | 12 +- local-store/Cargo.toml | 1 - local-store/src/lib.rs | 1 - logger/Cargo.toml | 4 +- logger/src/rotating.rs | 10 +- parity/configuration.rs | 9 +- parity/dapps.rs | 5 +- parity/helpers.rs | 7 +- parity/main.rs | 2 +- parity/modules.rs | 4 +- rpc/Cargo.toml | 3 +- rpc/src/lib.rs | 3 +- rpc/src/v1/helpers/secretstore.rs | 17 + rpc/src/v1/impls/eth_pubsub.rs | 6 +- rpc/src/v1/impls/secretstore.rs | 12 +- rpc/src/v1/tests/helpers/dapps.rs | 1 + rpc/src/v1/tests/mocked/eth_pubsub.rs | 8 +- rpc/src/v1/tests/mocked/parity_set.rs | 2 +- rpc/src/v1/tests/mocked/secretstore.rs | 34 +- rpc/src/v1/traits/secretstore.rs | 6 + rpc/src/v1/types/dapps.rs | 6 +- rpc/src/v1/types/pubsub.rs | 6 +- rpc_client/Cargo.toml | 2 +- rpc_client/src/lib.rs | 2 +- scripts/parity.service | 2 +- secret_store/Cargo.toml | 6 +- secret_store/src/http_listener.rs | 113 +- secret_store/src/key_server.rs | 31 +- .../servers_set_change_session.rs | 15 +- .../client_sessions/decryption_session.rs | 23 +- .../client_sessions/generation_session.rs | 2 +- .../client_sessions/signing_session.rs | 21 +- .../src/key_server_cluster/cluster.rs | 21 +- .../key_server_cluster/cluster_sessions.rs | 9 +- .../src/key_server_cluster/message.rs | 4 +- secret_store/src/key_storage.rs | 16 +- secret_store/src/lib.rs | 3 +- secret_store/src/traits.rs | 13 +- snap/gui/icon.png | Bin 0 -> 10671 bytes snap/gui/parity.desktop | 8 + stratum/Cargo.toml | 12 +- stratum/src/lib.rs | 7 +- sync/Cargo.toml | 3 +- sync/src/api.rs | 20 +- sync/src/blocks.rs | 14 +- sync/src/chain.rs | 6 +- sync/src/lib.rs | 5 +- sync/src/sync_io.rs | 14 +- sync/src/tests/helpers.rs | 8 +- test.sh | 4 + util/Cargo.toml | 5 +- util/bloomable/Cargo.toml | 2 +- util/bloomable/tests/test.rs | 2 +- util/bytes/Cargo.toml | 2 + util/error/Cargo.toml | 2 +- util/hash/Cargo.toml | 4 +- util/hashdb/Cargo.toml | 6 +- util/io/src/lib.rs | 10 +- util/journaldb/Cargo.toml | 2 +- util/journaldb/src/lib.rs | 2 +- util/kvdb-rocksdb/Cargo.toml | 1 + util/kvdb-rocksdb/src/lib.rs | 21 +- util/kvdb/Cargo.toml | 2 +- util/memorydb/Cargo.toml | 12 +- util/memorydb/src/lib.rs | 2 +- util/migration/Cargo.toml | 2 +- util/network/Cargo.toml | 6 +- util/network/src/connection.rs | 26 +- util/network/src/discovery.rs | 24 +- util/network/src/error.rs | 149 +- util/network/src/handshake.rs | 34 +- util/network/src/host.rs | 45 +- util/network/src/lib.rs | 9 +- util/network/src/node_table.rs | 16 +- util/network/src/service.rs | 17 +- util/network/src/session.rs | 50 +- util/patricia_trie/Cargo.toml | 22 +- util/patricia_trie/src/lib.rs | 2 +- util/patricia_trie/src/triedbmut.rs | 5 +- util/rlp/Cargo.toml | 4 +- util/snappy/Cargo.toml | 7 - util/snappy/src/lib.rs | 163 - util/src/lib.rs | 3 +- util/triehash/Cargo.toml | 8 +- util/triehash/src/lib.rs | 2 +- whisper/src/net.rs | 8 +- 824 files changed, 11086 insertions(+), 51427 deletions(-) create mode 100644 ethcore/wasm/run/Cargo.toml create mode 100644 ethcore/wasm/run/res/sample-fixture.json create mode 100644 ethcore/wasm/run/res/sample1.wasm create mode 100644 ethcore/wasm/run/res/sample2.wasm create mode 100644 ethcore/wasm/run/res/sample3.wasm create mode 100644 ethcore/wasm/run/src/fixture.rs create mode 100644 ethcore/wasm/run/src/main.rs create mode 100644 ethcore/wasm/run/src/runner.rs create mode 100644 ethcore/wasm/src/panic_payload.rs create mode 100644 ethkey/src/brain_prefix.rs create mode 100644 ethkey/src/brain_recover.rs create mode 100644 ethstore/cli/src/crack.rs delete mode 100644 js-old/npm/etherscan/README.md delete mode 100644 js-old/npm/etherscan/package.json delete mode 100644 js-old/npm/jsonrpc/README.md delete mode 100644 js-old/npm/jsonrpc/package.json delete mode 100644 js-old/npm/parity/README.md delete mode 100644 js-old/npm/parity/package.json delete mode 100644 js-old/npm/parity/test/smoke.spec.js delete mode 100644 js-old/npm/shapeshift/README.md delete mode 100644 js-old/npm/shapeshift/package.json delete mode 100644 js-old/npm/test/mocha.config.js delete mode 100644 js-old/npm/test/mocha.opts delete mode 100644 js-old/scripts/build-rpc-json.js delete mode 100644 js-old/scripts/build-rpc-markdown.js delete mode 100755 js-old/scripts/dryrun-npm.sh delete mode 100644 js-old/scripts/helpers/log.js delete mode 100644 js-old/scripts/helpers/parsed-rpc-traits.js delete mode 100644 js-old/src/abi/README.md delete mode 100644 js-old/src/abi/decoder/bytesTaken.js delete mode 100644 js-old/src/abi/decoder/bytesTaken.spec.js delete mode 100644 js-old/src/abi/decoder/decodeResult.js delete mode 100644 js-old/src/abi/decoder/decodeResult.spec.js delete mode 100644 js-old/src/abi/decoder/decoder.js delete mode 100644 js-old/src/abi/decoder/decoder.spec.js delete mode 100644 js-old/src/abi/encoder/encoder.js delete mode 100644 js-old/src/abi/encoder/encoder.spec.js delete mode 100644 js-old/src/abi/encoder/index.js delete mode 100644 js-old/src/abi/encoder/mediate.js delete mode 100644 js-old/src/abi/encoder/mediate.spec.js delete mode 100644 js-old/src/abi/spec/constructor.js delete mode 100644 js-old/src/abi/spec/constructor.spec.js delete mode 100644 js-old/src/abi/spec/event/decodedLog.js delete mode 100644 js-old/src/abi/spec/event/decodedLog.spec.js delete mode 100644 js-old/src/abi/spec/event/decodedLogParam.js delete mode 100644 js-old/src/abi/spec/event/decodedLogParam.spec.js delete mode 100644 js-old/src/abi/spec/event/event.js delete mode 100644 js-old/src/abi/spec/event/event.spec.js delete mode 100644 js-old/src/abi/spec/event/eventParam.js delete mode 100644 js-old/src/abi/spec/event/eventParam.spec.js delete mode 100644 js-old/src/abi/spec/function.js delete mode 100644 js-old/src/abi/spec/function.spec.js delete mode 100644 js-old/src/abi/spec/index.js delete mode 100644 js-old/src/abi/spec/interface.js delete mode 100644 js-old/src/abi/spec/interface.spec.js delete mode 100644 js-old/src/abi/spec/param.js delete mode 100644 js-old/src/abi/spec/param.spec.js delete mode 100644 js-old/src/abi/spec/paramType/format.js delete mode 100644 js-old/src/abi/spec/paramType/format.spec.js delete mode 100644 js-old/src/abi/spec/paramType/index.js delete mode 100644 js-old/src/abi/spec/paramType/paramType.js delete mode 100644 js-old/src/abi/spec/paramType/paramType.spec.js delete mode 100644 js-old/src/abi/spec/paramType/types.js delete mode 100644 js-old/src/abi/token/index.js delete mode 100644 js-old/src/abi/token/token.js delete mode 100644 js-old/src/abi/token/token.spec.js delete mode 100644 js-old/src/abi/util/address.js delete mode 100644 js-old/src/abi/util/address.spec.js delete mode 100644 js-old/src/abi/util/pad.js delete mode 100644 js-old/src/abi/util/pad.spec.js delete mode 100644 js-old/src/abi/util/signature.js delete mode 100644 js-old/src/abi/util/signature.spec.js delete mode 100644 js-old/src/abi/util/slice.js delete mode 100644 js-old/src/abi/util/slice.spec.js delete mode 100644 js-old/src/abi/util/sliceAs.js delete mode 100644 js-old/src/abi/util/sliceAs.spec.js delete mode 100644 js-old/src/abi/util/types.js delete mode 100644 js-old/src/abi/util/types.spec.js delete mode 100644 js-old/src/api/README.md delete mode 100644 js-old/src/api/api.js delete mode 100644 js-old/src/api/api.spec.js delete mode 100644 js-old/src/api/contract/contract.js delete mode 100644 js-old/src/api/contract/contract.spec.js delete mode 100644 js-old/src/api/contract/index.js delete mode 100644 js-old/src/api/format/input.js delete mode 100644 js-old/src/api/format/input.spec.js delete mode 100644 js-old/src/api/format/output.js delete mode 100644 js-old/src/api/format/output.spec.js delete mode 100644 js-old/src/api/index.js delete mode 100644 js-old/src/api/local/accounts/account.js delete mode 100644 js-old/src/api/local/accounts/accounts.js delete mode 100644 js-old/src/api/local/ethkey/ethkey.js delete mode 100644 js-old/src/api/local/ethkey/ethkey.wasm.js delete mode 100644 js-old/src/api/local/ethkey/index.js delete mode 100644 js-old/src/api/local/ethkey/index.spec.js delete mode 100644 js-old/src/api/local/ethkey/worker.js delete mode 100644 js-old/src/api/local/ethkey/workerPool.js delete mode 100644 js-old/src/api/local/index.js delete mode 100644 js-old/src/api/local/localAccountsMiddleware.js delete mode 100644 js-old/src/api/local/localAccountsMiddleware.spec.js delete mode 100644 js-old/src/api/local/transactions.js delete mode 100644 js-old/src/api/local/transactions.spec.js delete mode 100644 js-old/src/api/pubsub/eth/eth.js delete mode 100644 js-old/src/api/pubsub/eth/index.js delete mode 100644 js-old/src/api/pubsub/index.js delete mode 100644 js-old/src/api/pubsub/net/index.js delete mode 100644 js-old/src/api/pubsub/net/net.js delete mode 100644 js-old/src/api/pubsub/parity/index.js delete mode 100644 js-old/src/api/pubsub/parity/parity.js delete mode 100644 js-old/src/api/pubsub/pubsub.js delete mode 100644 js-old/src/api/pubsub/pubsub.spec.js delete mode 100644 js-old/src/api/pubsub/pubsubBase.js delete mode 100644 js-old/src/api/rpc/db/db.js delete mode 100644 js-old/src/api/rpc/db/db.spec.js delete mode 100644 js-old/src/api/rpc/db/index.js delete mode 100644 js-old/src/api/rpc/eth/eth.e2e.js delete mode 100644 js-old/src/api/rpc/eth/eth.js delete mode 100644 js-old/src/api/rpc/eth/eth.spec.js delete mode 100644 js-old/src/api/rpc/eth/index.js delete mode 100644 js-old/src/api/rpc/index.js delete mode 100644 js-old/src/api/rpc/net/index.js delete mode 100644 js-old/src/api/rpc/net/net.e2e.js delete mode 100644 js-old/src/api/rpc/net/net.js delete mode 100644 js-old/src/api/rpc/net/net.spec.js delete mode 100644 js-old/src/api/rpc/parity/index.js delete mode 100644 js-old/src/api/rpc/parity/parity.e2e.js delete mode 100644 js-old/src/api/rpc/parity/parity.js delete mode 100644 js-old/src/api/rpc/parity/parity.spec.js delete mode 100644 js-old/src/api/rpc/personal/index.js delete mode 100644 js-old/src/api/rpc/personal/personal.e2e.js delete mode 100644 js-old/src/api/rpc/personal/personal.js delete mode 100644 js-old/src/api/rpc/personal/personal.spec.js delete mode 100644 js-old/src/api/rpc/shh/index.js delete mode 100644 js-old/src/api/rpc/shh/shh.js delete mode 100644 js-old/src/api/rpc/signer/index.js delete mode 100644 js-old/src/api/rpc/signer/signer.js delete mode 100644 js-old/src/api/rpc/trace/index.js delete mode 100644 js-old/src/api/rpc/trace/trace.e2e.js delete mode 100644 js-old/src/api/rpc/trace/trace.js delete mode 100644 js-old/src/api/rpc/trace/trace.spec.js delete mode 100644 js-old/src/api/rpc/web3/index.js delete mode 100644 js-old/src/api/rpc/web3/web3.e2e.js delete mode 100644 js-old/src/api/rpc/web3/web3.js delete mode 100644 js-old/src/api/rpc/web3/web3.spec.js delete mode 100644 js-old/src/api/subscriptions/eth.js delete mode 100644 js-old/src/api/subscriptions/eth.spec.js delete mode 100644 js-old/src/api/subscriptions/index.js delete mode 100644 js-old/src/api/subscriptions/logging.js delete mode 100644 js-old/src/api/subscriptions/logging.spec.js delete mode 100644 js-old/src/api/subscriptions/manager.js delete mode 100644 js-old/src/api/subscriptions/manager.spec.js delete mode 100644 js-old/src/api/subscriptions/personal.js delete mode 100644 js-old/src/api/subscriptions/personal.spec.js delete mode 100644 js-old/src/api/subscriptions/signer.js delete mode 100644 js-old/src/api/transport/error.js delete mode 100644 js-old/src/api/transport/http/http.e2e.js delete mode 100644 js-old/src/api/transport/http/http.js delete mode 100644 js-old/src/api/transport/http/http.spec.js delete mode 100644 js-old/src/api/transport/http/index.js delete mode 100644 js-old/src/api/transport/index.js delete mode 100644 js-old/src/api/transport/jsonRpcBase.js delete mode 100644 js-old/src/api/transport/jsonRpcBase.spec.js delete mode 100644 js-old/src/api/transport/middleware.js delete mode 100644 js-old/src/api/transport/middleware.spec.js delete mode 100644 js-old/src/api/transport/ws/index.js delete mode 100644 js-old/src/api/transport/ws/ws.e2e.js delete mode 100644 js-old/src/api/transport/ws/ws.js delete mode 100644 js-old/src/api/transport/ws/ws.spec.js delete mode 100644 js-old/src/api/util/decode.js delete mode 100644 js-old/src/api/util/decode.spec.js delete mode 100644 js-old/src/api/util/encode.js delete mode 100644 js-old/src/api/util/encode.spec.js delete mode 100644 js-old/src/api/util/format.js delete mode 100644 js-old/src/api/util/format.spec.js delete mode 100644 js-old/src/api/util/identity.js delete mode 100644 js-old/src/api/util/index.js delete mode 100644 js-old/src/api/util/sha3.js delete mode 100644 js-old/src/api/util/sha3.spec.js delete mode 100644 js-old/src/api/util/types.js delete mode 100644 js-old/src/api/util/types.spec.js delete mode 100644 js-old/src/api/util/wei.js delete mode 100644 js-old/src/api/util/wei.spec.js delete mode 100644 js-old/src/dapps/chaindeploy.js delete mode 100644 js-old/src/dapps/chaindeploy/Application/application.css delete mode 100644 js-old/src/dapps/chaindeploy/Application/application.js delete mode 100644 js-old/src/dapps/chaindeploy/Application/index.js delete mode 100644 js-old/src/dapps/chaindeploy/Contract/contract.js delete mode 100644 js-old/src/dapps/chaindeploy/Contract/index.js delete mode 100644 js-old/src/dapps/chaindeploy/Dapp/dapp.js delete mode 100644 js-old/src/dapps/chaindeploy/Dapp/index.js delete mode 100644 js-old/src/dapps/chaindeploy/ListItem/Header/header.js delete mode 100644 js-old/src/dapps/chaindeploy/ListItem/Header/index.js delete mode 100644 js-old/src/dapps/chaindeploy/ListItem/Icon/icon.js delete mode 100644 js-old/src/dapps/chaindeploy/ListItem/Icon/index.js delete mode 100644 js-old/src/dapps/chaindeploy/ListItem/Row/index.js delete mode 100644 js-old/src/dapps/chaindeploy/ListItem/Row/row.js delete mode 100644 js-old/src/dapps/chaindeploy/ListItem/index.js delete mode 100644 js-old/src/dapps/chaindeploy/ListItem/listItem.css delete mode 100644 js-old/src/dapps/chaindeploy/ListItem/listItem.js delete mode 100644 js-old/src/dapps/chaindeploy/_dapps.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/abi/jg-voting.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/badgereg.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/dappreg.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/gavcoin.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/githubhint.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/jg-voting.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/registry.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/signaturereg.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/tokendeploy.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/tokenreg.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/verifyEmail.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/code/verifySms.json delete mode 100644 js-old/src/dapps/chaindeploy/contracts/dappreg.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/gavcoin.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/githubhint.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/index.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/jg-voting.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/registry.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/signaturereg.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/tokendeployMgr.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/tokendeployReg.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/tokenreg.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/verifyEmail.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/verifySms.js delete mode 100644 js-old/src/dapps/chaindeploy/contracts/wallet.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/console.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/dappreg.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/gavcoin.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/githubhint.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/index.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/jg-voting.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/jg-whenblock.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/localtx.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/registry.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/signaturereg.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/tokendeploy.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/tokenreg.js delete mode 100644 js-old/src/dapps/chaindeploy/dapps/web.js delete mode 100644 js-old/src/dapps/chaindeploy/parity.js delete mode 100644 js-old/src/dapps/chaindeploy/store.js delete mode 100644 js-old/src/dapps/chaindeploy/utils.js delete mode 100644 js-old/src/dapps/console.js delete mode 100644 js-old/src/dapps/console/Application/application.css delete mode 100644 js-old/src/dapps/console/Application/application.js delete mode 100644 js-old/src/dapps/console/Application/index.js delete mode 100644 js-old/src/dapps/console/Autocomplete/autocomplete.css delete mode 100644 js-old/src/dapps/console/Autocomplete/autocomplete.js delete mode 100644 js-old/src/dapps/console/Autocomplete/autocomplete.store.js delete mode 100644 js-old/src/dapps/console/Autocomplete/index.js delete mode 100644 js-old/src/dapps/console/Console/console.css delete mode 100644 js-old/src/dapps/console/Console/console.js delete mode 100644 js-old/src/dapps/console/Console/console.store.js delete mode 100644 js-old/src/dapps/console/Console/index.js delete mode 100644 js-old/src/dapps/console/Header/header.css delete mode 100644 js-old/src/dapps/console/Header/header.js delete mode 100644 js-old/src/dapps/console/Header/index.js delete mode 100644 js-old/src/dapps/console/Input/index.js delete mode 100644 js-old/src/dapps/console/Input/input.css delete mode 100644 js-old/src/dapps/console/Input/input.js delete mode 100644 js-old/src/dapps/console/Input/input.store.js delete mode 100644 js-old/src/dapps/console/Settings/index.js delete mode 100644 js-old/src/dapps/console/Settings/settings.css delete mode 100644 js-old/src/dapps/console/Settings/settings.js delete mode 100644 js-old/src/dapps/console/Settings/settings.store.js delete mode 100644 js-old/src/dapps/console/Snippets/index.js delete mode 100644 js-old/src/dapps/console/Snippets/snippets.css delete mode 100644 js-old/src/dapps/console/Snippets/snippets.js delete mode 100644 js-old/src/dapps/console/Snippets/snippets.store.js delete mode 100644 js-old/src/dapps/console/Watches/index.js delete mode 100644 js-old/src/dapps/console/Watches/watches.css delete mode 100644 js-old/src/dapps/console/Watches/watches.js delete mode 100644 js-old/src/dapps/console/Watches/watches.store.js delete mode 100644 js-old/src/dapps/console/codemirror.css delete mode 100644 js-old/src/dapps/console/parity.js delete mode 100644 js-old/src/dapps/console/utils.js delete mode 100644 js-old/src/dapps/dappreg.js delete mode 100644 js-old/src/dapps/dappreg/Application/application.css delete mode 100644 js-old/src/dapps/dappreg/Application/application.js delete mode 100644 js-old/src/dapps/dappreg/Application/index.js delete mode 100644 js-old/src/dapps/dappreg/Button/button.css delete mode 100644 js-old/src/dapps/dappreg/Button/button.js delete mode 100644 js-old/src/dapps/dappreg/Button/index.js delete mode 100644 js-old/src/dapps/dappreg/Card/card.css delete mode 100644 js-old/src/dapps/dappreg/Card/card.js delete mode 100644 js-old/src/dapps/dappreg/Card/index.js delete mode 100644 js-old/src/dapps/dappreg/CreateDappCard/createDappCard.js delete mode 100644 js-old/src/dapps/dappreg/CreateDappCard/index.js delete mode 100644 js-old/src/dapps/dappreg/DappCard/dappCard.css delete mode 100644 js-old/src/dapps/dappreg/DappCard/dappCard.js delete mode 100644 js-old/src/dapps/dappreg/DappCard/index.js delete mode 100644 js-old/src/dapps/dappreg/DappModal/dappModal.css delete mode 100644 js-old/src/dapps/dappreg/DappModal/dappModal.js delete mode 100644 js-old/src/dapps/dappreg/DappModal/index.js delete mode 100644 js-old/src/dapps/dappreg/Dapps/dapps.css delete mode 100644 js-old/src/dapps/dappreg/Dapps/dapps.js delete mode 100644 js-old/src/dapps/dappreg/Dapps/index.js delete mode 100644 js-old/src/dapps/dappreg/Input/index.js delete mode 100644 js-old/src/dapps/dappreg/Input/input.css delete mode 100644 js-old/src/dapps/dappreg/Input/input.js delete mode 100644 js-old/src/dapps/dappreg/Modal/index.js delete mode 100644 js-old/src/dapps/dappreg/Modal/modal.css delete mode 100644 js-old/src/dapps/dappreg/Modal/modal.js delete mode 100644 js-old/src/dapps/dappreg/ModalDelete/index.js delete mode 100644 js-old/src/dapps/dappreg/ModalDelete/modalDelete.js delete mode 100644 js-old/src/dapps/dappreg/ModalRegister/index.js delete mode 100644 js-old/src/dapps/dappreg/ModalRegister/modalRegister.js delete mode 100644 js-old/src/dapps/dappreg/ModalUpdate/index.js delete mode 100644 js-old/src/dapps/dappreg/ModalUpdate/modalUpdate.js delete mode 100644 js-old/src/dapps/dappreg/SelectAccount/index.js delete mode 100644 js-old/src/dapps/dappreg/SelectAccount/selectAccount.js delete mode 100644 js-old/src/dapps/dappreg/Transactions/index.js delete mode 100644 js-old/src/dapps/dappreg/Transactions/transactions.css delete mode 100644 js-old/src/dapps/dappreg/Transactions/transactions.js delete mode 100644 js-old/src/dapps/dappreg/Warning/index.js delete mode 100644 js-old/src/dapps/dappreg/Warning/warning.js delete mode 100644 js-old/src/dapps/dappreg/_colors.css delete mode 100644 js-old/src/dapps/dappreg/_utils.css delete mode 100644 js-old/src/dapps/dappreg/dappStore.js delete mode 100644 js-old/src/dapps/dappreg/dappsStore.js delete mode 100644 js-old/src/dapps/dappreg/parity.js delete mode 100644 js-old/src/dapps/dappreg/utils.js delete mode 100644 js-old/src/dapps/dappreg/utils.spec.js delete mode 100644 js-old/src/dapps/githubhint.js delete mode 100644 js-old/src/dapps/githubhint/Application/application.css delete mode 100644 js-old/src/dapps/githubhint/Application/application.js delete mode 100644 js-old/src/dapps/githubhint/Application/index.js delete mode 100644 js-old/src/dapps/githubhint/Button/button.css delete mode 100644 js-old/src/dapps/githubhint/Button/button.js delete mode 100644 js-old/src/dapps/githubhint/Button/index.js delete mode 100644 js-old/src/dapps/githubhint/Events/events.css delete mode 100644 js-old/src/dapps/githubhint/Events/events.js delete mode 100644 js-old/src/dapps/githubhint/Events/index.js delete mode 100644 js-old/src/dapps/githubhint/Loading/index.js delete mode 100644 js-old/src/dapps/githubhint/Loading/loading.css delete mode 100644 js-old/src/dapps/githubhint/Loading/loading.js delete mode 100644 js-old/src/dapps/githubhint/parity.js delete mode 100644 js-old/src/dapps/githubhint/services.js delete mode 100644 js-old/src/dapps/index.ejs delete mode 100644 js-old/src/dapps/localtx.js delete mode 100644 js-old/src/dapps/localtx/Application/application.css delete mode 100644 js-old/src/dapps/localtx/Application/application.js delete mode 100644 js-old/src/dapps/localtx/Application/application.spec.js delete mode 100644 js-old/src/dapps/localtx/Application/index.js delete mode 100644 js-old/src/dapps/localtx/IdentityIcon/identityIcon.css delete mode 100644 js-old/src/dapps/localtx/IdentityIcon/identityIcon.js delete mode 100644 js-old/src/dapps/localtx/IdentityIcon/index.js delete mode 100644 js-old/src/dapps/localtx/Transaction/index.js delete mode 100644 js-old/src/dapps/localtx/Transaction/transaction.css delete mode 100644 js-old/src/dapps/localtx/Transaction/transaction.js delete mode 100644 js-old/src/dapps/localtx/Transaction/transaction.spec.js delete mode 100644 js-old/src/dapps/localtx/parity.js delete mode 100644 js-old/src/dapps/registry.js delete mode 100644 js-old/src/dapps/registry/Accounts/accounts.js delete mode 100644 js-old/src/dapps/registry/Accounts/actions.js delete mode 100644 js-old/src/dapps/registry/Accounts/index.js delete mode 100644 js-old/src/dapps/registry/Application/application.css delete mode 100644 js-old/src/dapps/registry/Application/application.js delete mode 100644 js-old/src/dapps/registry/Application/index.js delete mode 100644 js-old/src/dapps/registry/Container.js delete mode 100644 js-old/src/dapps/registry/Events/actions.js delete mode 100644 js-old/src/dapps/registry/Events/events.css delete mode 100644 js-old/src/dapps/registry/Events/events.js delete mode 100644 js-old/src/dapps/registry/Events/index.js delete mode 100644 js-old/src/dapps/registry/Events/reducers.js delete mode 100644 js-old/src/dapps/registry/IdentityIcon/identityIcon.css delete mode 100644 js-old/src/dapps/registry/IdentityIcon/identityIcon.js delete mode 100644 js-old/src/dapps/registry/IdentityIcon/index.js delete mode 100644 js-old/src/dapps/registry/Lookup/actions.js delete mode 100644 js-old/src/dapps/registry/Lookup/index.js delete mode 100644 js-old/src/dapps/registry/Lookup/lookup.css delete mode 100644 js-old/src/dapps/registry/Lookup/lookup.js delete mode 100644 js-old/src/dapps/registry/Lookup/reducers.js delete mode 100644 js-old/src/dapps/registry/Names/actions.js delete mode 100644 js-old/src/dapps/registry/Names/index.js delete mode 100644 js-old/src/dapps/registry/Names/names.css delete mode 100644 js-old/src/dapps/registry/Names/names.js delete mode 100644 js-old/src/dapps/registry/Names/reducers.js delete mode 100644 js-old/src/dapps/registry/Records/actions.js delete mode 100644 js-old/src/dapps/registry/Records/index.js delete mode 100644 js-old/src/dapps/registry/Records/records.css delete mode 100644 js-old/src/dapps/registry/Records/records.js delete mode 100644 js-old/src/dapps/registry/Records/reducers.js delete mode 100644 js-old/src/dapps/registry/Reverse/actions.js delete mode 100644 js-old/src/dapps/registry/Reverse/index.js delete mode 100644 js-old/src/dapps/registry/Reverse/reducers.js delete mode 100644 js-old/src/dapps/registry/Reverse/reverse.css delete mode 100644 js-old/src/dapps/registry/Reverse/reverse.js delete mode 100644 js-old/src/dapps/registry/actions.js delete mode 100644 js-old/src/dapps/registry/addresses/accounts-reducer.js delete mode 100644 js-old/src/dapps/registry/addresses/actions.js delete mode 100644 js-old/src/dapps/registry/addresses/contacts-reducer.js delete mode 100644 js-old/src/dapps/registry/parity.js delete mode 100644 js-old/src/dapps/registry/reducers.js delete mode 100644 js-old/src/dapps/registry/store.js delete mode 100644 js-old/src/dapps/registry/ui/address.css delete mode 100644 js-old/src/dapps/registry/ui/address.js delete mode 100644 js-old/src/dapps/registry/ui/hash.css delete mode 100644 js-old/src/dapps/registry/ui/hash.js delete mode 100644 js-old/src/dapps/registry/ui/image.js delete mode 100644 js-old/src/dapps/registry/util/actions.js delete mode 100644 js-old/src/dapps/registry/util/etherscan-url.js delete mode 100644 js-old/src/dapps/registry/util/post-tx.js delete mode 100644 js-old/src/dapps/registry/util/registry.js delete mode 100644 js-old/src/dapps/signaturereg.js delete mode 100644 js-old/src/dapps/signaturereg/Application/application.css delete mode 100644 js-old/src/dapps/signaturereg/Application/application.js delete mode 100644 js-old/src/dapps/signaturereg/Application/index.js delete mode 100644 js-old/src/dapps/signaturereg/Button/button.css delete mode 100644 js-old/src/dapps/signaturereg/Button/button.js delete mode 100644 js-old/src/dapps/signaturereg/Button/index.js delete mode 100644 js-old/src/dapps/signaturereg/Events/events.css delete mode 100644 js-old/src/dapps/signaturereg/Events/events.js delete mode 100644 js-old/src/dapps/signaturereg/Events/index.js delete mode 100644 js-old/src/dapps/signaturereg/Header/header.css delete mode 100644 js-old/src/dapps/signaturereg/Header/header.js delete mode 100644 js-old/src/dapps/signaturereg/Header/index.js delete mode 100644 js-old/src/dapps/signaturereg/IdentityIcon/identityIcon.css delete mode 100644 js-old/src/dapps/signaturereg/IdentityIcon/identityIcon.js delete mode 100644 js-old/src/dapps/signaturereg/IdentityIcon/index.js delete mode 100644 js-old/src/dapps/signaturereg/Import/import.css delete mode 100644 js-old/src/dapps/signaturereg/Import/import.js delete mode 100644 js-old/src/dapps/signaturereg/Import/index.js delete mode 100644 js-old/src/dapps/signaturereg/Loading/index.js delete mode 100644 js-old/src/dapps/signaturereg/Loading/loading.css delete mode 100644 js-old/src/dapps/signaturereg/Loading/loading.js delete mode 100644 js-old/src/dapps/signaturereg/format.js delete mode 100644 js-old/src/dapps/signaturereg/parity.js delete mode 100644 js-old/src/dapps/signaturereg/services.js delete mode 100644 js-old/src/dapps/static/.gitkeep delete mode 100644 js-old/src/dapps/style.css delete mode 100644 js-old/src/dapps/tokendeploy.js delete mode 100644 js-old/src/dapps/tokendeploy/AddressSelect/addressSelect.css delete mode 100644 js-old/src/dapps/tokendeploy/AddressSelect/addressSelect.js delete mode 100644 js-old/src/dapps/tokendeploy/AddressSelect/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Application/Header/header.css delete mode 100644 js-old/src/dapps/tokendeploy/Application/Header/header.js delete mode 100644 js-old/src/dapps/tokendeploy/Application/Header/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Application/Loading/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Application/Loading/loading.css delete mode 100644 js-old/src/dapps/tokendeploy/Application/Loading/loading.js delete mode 100644 js-old/src/dapps/tokendeploy/Application/application.css delete mode 100644 js-old/src/dapps/tokendeploy/Application/application.js delete mode 100644 js-old/src/dapps/tokendeploy/Application/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Application/pages.js delete mode 100644 js-old/src/dapps/tokendeploy/Container/container.css delete mode 100644 js-old/src/dapps/tokendeploy/Container/container.js delete mode 100644 js-old/src/dapps/tokendeploy/Container/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/Deployment/deployment.css delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/Deployment/deployment.js delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/Deployment/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/Event/event.css delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/Event/event.js delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/Event/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/Events/events.css delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/Events/events.js delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/Events/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/deploy.js delete mode 100644 js-old/src/dapps/tokendeploy/Deploy/index.js delete mode 100644 js-old/src/dapps/tokendeploy/IdentityIcon/identityIcon.css delete mode 100644 js-old/src/dapps/tokendeploy/IdentityIcon/identityIcon.js delete mode 100644 js-old/src/dapps/tokendeploy/IdentityIcon/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Overview/Owner/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Overview/Owner/owner.css delete mode 100644 js-old/src/dapps/tokendeploy/Overview/Owner/owner.js delete mode 100644 js-old/src/dapps/tokendeploy/Overview/Token/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Overview/Token/token.css delete mode 100644 js-old/src/dapps/tokendeploy/Overview/Token/token.js delete mode 100644 js-old/src/dapps/tokendeploy/Overview/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Overview/overview.css delete mode 100644 js-old/src/dapps/tokendeploy/Overview/overview.js delete mode 100644 js-old/src/dapps/tokendeploy/Transfer/Event/event.js delete mode 100644 js-old/src/dapps/tokendeploy/Transfer/Event/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Transfer/Events/events.js delete mode 100644 js-old/src/dapps/tokendeploy/Transfer/Events/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Transfer/Send/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Transfer/Send/send.css delete mode 100644 js-old/src/dapps/tokendeploy/Transfer/Send/send.js delete mode 100644 js-old/src/dapps/tokendeploy/Transfer/index.js delete mode 100644 js-old/src/dapps/tokendeploy/Transfer/transfer.js delete mode 100644 js-old/src/dapps/tokendeploy/_form.css delete mode 100644 js-old/src/dapps/tokendeploy/_status.css delete mode 100644 js-old/src/dapps/tokendeploy/background.jpg delete mode 100644 js-old/src/dapps/tokendeploy/parity.js delete mode 100644 js-old/src/dapps/tokendeploy/services.js delete mode 100644 js-old/src/dapps/tokenreg.js delete mode 100644 js-old/src/dapps/tokenreg/Accounts/AccountSelector/account-selector.css delete mode 100644 js-old/src/dapps/tokenreg/Accounts/AccountSelector/account-selector.js delete mode 100644 js-old/src/dapps/tokenreg/Accounts/AccountSelector/container.js delete mode 100644 js-old/src/dapps/tokenreg/Accounts/AccountSelector/index.js delete mode 100644 js-old/src/dapps/tokenreg/Accounts/actions.js delete mode 100644 js-old/src/dapps/tokenreg/Accounts/reducer.js delete mode 100644 js-old/src/dapps/tokenreg/Actions/Query/index.js delete mode 100644 js-old/src/dapps/tokenreg/Actions/Query/query.js delete mode 100644 js-old/src/dapps/tokenreg/Actions/Register/index.js delete mode 100644 js-old/src/dapps/tokenreg/Actions/Register/register.js delete mode 100644 js-old/src/dapps/tokenreg/Actions/actions.css delete mode 100644 js-old/src/dapps/tokenreg/Actions/actions.js delete mode 100644 js-old/src/dapps/tokenreg/Actions/component.js delete mode 100644 js-old/src/dapps/tokenreg/Actions/container.js delete mode 100644 js-old/src/dapps/tokenreg/Actions/index.js delete mode 100644 js-old/src/dapps/tokenreg/Actions/reducer.js delete mode 100644 js-old/src/dapps/tokenreg/Application/application.css delete mode 100644 js-old/src/dapps/tokenreg/Application/application.js delete mode 100644 js-old/src/dapps/tokenreg/Application/index.js delete mode 100644 js-old/src/dapps/tokenreg/Chip/chip.css delete mode 100644 js-old/src/dapps/tokenreg/Chip/chip.js delete mode 100644 js-old/src/dapps/tokenreg/Chip/index.js delete mode 100644 js-old/src/dapps/tokenreg/Container.js delete mode 100644 js-old/src/dapps/tokenreg/IdentityIcon/identityIcon.css delete mode 100644 js-old/src/dapps/tokenreg/IdentityIcon/identityIcon.js delete mode 100644 js-old/src/dapps/tokenreg/IdentityIcon/index.js delete mode 100644 js-old/src/dapps/tokenreg/Inputs/Text/container.js delete mode 100644 js-old/src/dapps/tokenreg/Inputs/Text/index.js delete mode 100644 js-old/src/dapps/tokenreg/Inputs/Text/input-text.js delete mode 100644 js-old/src/dapps/tokenreg/Inputs/inputs.css delete mode 100644 js-old/src/dapps/tokenreg/Inputs/validation.js delete mode 100644 js-old/src/dapps/tokenreg/Loading/index.js delete mode 100644 js-old/src/dapps/tokenreg/Loading/loading.js delete mode 100644 js-old/src/dapps/tokenreg/Status/actions.js delete mode 100644 js-old/src/dapps/tokenreg/Status/index.js delete mode 100644 js-old/src/dapps/tokenreg/Status/reducer.js delete mode 100644 js-old/src/dapps/tokenreg/Status/status.css delete mode 100644 js-old/src/dapps/tokenreg/Status/status.js delete mode 100644 js-old/src/dapps/tokenreg/Tokens/Token/add-meta.js delete mode 100644 js-old/src/dapps/tokenreg/Tokens/Token/index.js delete mode 100644 js-old/src/dapps/tokenreg/Tokens/Token/token.css delete mode 100644 js-old/src/dapps/tokenreg/Tokens/Token/token.js delete mode 100644 js-old/src/dapps/tokenreg/Tokens/Token/tokenContainer.js delete mode 100644 js-old/src/dapps/tokenreg/Tokens/actions.js delete mode 100644 js-old/src/dapps/tokenreg/Tokens/container.js delete mode 100644 js-old/src/dapps/tokenreg/Tokens/index.js delete mode 100644 js-old/src/dapps/tokenreg/Tokens/reducer.js delete mode 100644 js-old/src/dapps/tokenreg/Tokens/tokens.css delete mode 100644 js-old/src/dapps/tokenreg/Tokens/tokens.js delete mode 100644 js-old/src/dapps/tokenreg/constants.js delete mode 100644 js-old/src/dapps/tokenreg/parity.js delete mode 100644 js-old/src/dapps/tokenreg/reducers.js delete mode 100644 js-old/src/dapps/tokenreg/store.js delete mode 100644 js-old/src/dapps/tokenreg/utils.js delete mode 100644 js-old/src/dev.parity.html delete mode 100644 js-old/src/dev.web3.html delete mode 100644 js-old/src/embed.js delete mode 100644 js-old/src/error_pages.css delete mode 100644 js-old/src/inject.js delete mode 100644 js-old/src/jsonrpc/.gitignore delete mode 100644 js-old/src/jsonrpc/README.md delete mode 100644 js-old/src/jsonrpc/helpers.js delete mode 100644 js-old/src/jsonrpc/index.js delete mode 100644 js-old/src/jsonrpc/index.spec.js delete mode 100644 js-old/src/jsonrpc/interfaces/db.js delete mode 100644 js-old/src/jsonrpc/interfaces/eth.js delete mode 100644 js-old/src/jsonrpc/interfaces/net.js delete mode 100644 js-old/src/jsonrpc/interfaces/parity.js delete mode 100644 js-old/src/jsonrpc/interfaces/personal.js delete mode 100644 js-old/src/jsonrpc/interfaces/shh.js delete mode 100644 js-old/src/jsonrpc/interfaces/signer.js delete mode 100644 js-old/src/jsonrpc/interfaces/trace.js delete mode 100644 js-old/src/jsonrpc/interfaces/web3.js delete mode 100644 js-old/src/jsonrpc/types.js delete mode 100644 js-old/src/library.etherscan.js delete mode 100644 js-old/src/library.jsonrpc.js delete mode 100644 js-old/src/library.parity.js delete mode 100644 js-old/src/library.shapeshift.js delete mode 100644 js-old/src/parity.js delete mode 100644 js-old/src/util/web3.extensions.js delete mode 100644 js-old/src/web3.js rename js-old/{src/abi/abi.js => test/ignoreImports.js} (81%) delete mode 100644 js-old/test/npmJsonRpc.js delete mode 100644 js-old/test/npmParity.js delete mode 100644 js-old/webpack/embed.js delete mode 100644 js-old/webpack/npm.js create mode 100644 js/assets/parity-logo-black-no-text.png delete mode 100644 js/src/Application/store.js create mode 100644 js/src/DappRequests/README.md delete mode 100644 js/src/DappRequests/Request/index.js delete mode 100644 js/src/DappRequests/Request/request.js rename js-old/src/dapps/dappreg/Warning/warning.css => js/src/DappRequests/RequestGroups/RequestGroups.css (69%) create mode 100644 js/src/DappRequests/RequestGroups/RequestGroups.js rename {js-old/src/abi => js/src/DappRequests/RequestGroups}/index.js (94%) rename js/src/DappRequests/{filteredRequests.js => methodGroups.js} (78%) rename js-old/src/dapps/console/Application/application.store.js => js/src/FirstRun/store.js (61%) rename js-old/src/dapps/tokenreg/Loading/loading.css => js/src/Status/DefaultAccount/AccountItem/accountItem.css (76%) create mode 100644 js/src/Status/DefaultAccount/AccountItem/accountItem.js rename {js-old/src/abi/decoder => js/src/Status/DefaultAccount/AccountItem}/index.js (95%) rename js-old/src/dapps/registry/Accounts/accounts.css => js/src/Status/DefaultAccount/defaultAccount.css (77%) create mode 100644 js/src/Status/DefaultAccount/defaultAccount.js rename {js-old/src/abi/spec/event => js/src/Status/DefaultAccount}/index.js (94%) rename js-old/src/dapps/chaindeploy/contracts/badgereg.js => js/src/config.js (72%) rename js-old/src/api/local/accounts/index.js => js/test/ignoreImports.js (81%) create mode 100644 snap/gui/icon.png create mode 100644 snap/gui/parity.desktop delete mode 100644 util/snappy/Cargo.toml delete mode 100644 util/snappy/src/lib.rs diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f4b5311d59e..506667ef980 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -2,11 +2,10 @@ _Before filing a new issue, please **provide the following information**._ > I'm running: > -> - **Parity version**: 0.0.0 -> - **Operating system**: Windows / MacOS / Linux -> - **And installed**: via installer / homebrew / binaries / from source +> - **Which Parity version?**: 0.0.0 +> - **Which operating system?**: Windows / MacOS / Linux +> - **How installed?**: via installer / homebrew / binaries / from source +> - **Are you fully synchronized?**: no / yes +> - **Did you try to restart the node?**: no / yes _Your issue description goes here below. Try to include **actual** vs. **expected behavior** and **steps to reproduce** the issue._ - ---- - diff --git a/CHANGELOG.md b/CHANGELOG.md index 7110201e100..a50ac02dbfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,42 @@ +## Parity [v1.8.3](https://github.com/paritytech/parity/releases/tag/v1.8.3) (2017-11-15) + +Parity 1.8.3 contains several bug-fixes and removes the ability to deploy built-in multi-signature wallets. + +The full list of included changes: + +- Backports to beta ([#7043](https://github.com/paritytech/parity/pull/7043)) + - pwasm-std update ([#7018](https://github.com/paritytech/parity/pull/7018)) + - Version 1.8.3 + - Make CLI arguments parsing more backwards compatible ([#7004](https://github.com/paritytech/parity/pull/7004)) + - Skip nonce check for gas estimation ([#6997](https://github.com/paritytech/parity/pull/6997)) + - Events in WASM runtime ([#6967](https://github.com/paritytech/parity/pull/6967)) + - Return decoded seal fields. ([#6932](https://github.com/paritytech/parity/pull/6932)) + - Fix serialization of status in transaction receipts. ([#6926](https://github.com/paritytech/parity/pull/6926)) + - Windows fixes ([#6921](https://github.com/paritytech/parity/pull/6921)) +- Disallow built-in multi-sig deploy (only watch) ([#7014](https://github.com/paritytech/parity/pull/7014)) +- Add hint in ActionParams for splitting code/data ([#6968](https://github.com/paritytech/parity/pull/6968)) + - Action params and embedded params handling + - Fix name-spaces + +## Parity [v1.8.2](https://github.com/paritytech/parity/releases/tag/v1.8.2) (2017-10-26) + +Parity 1.8.2 fixes an important potential consensus issue and a few additional minor issues: + +- `blockNumber` transaction field is now returned correctly in RPC calls. +- Possible crash when `--force-sealing` option is used. + +The full list of included changes: + +- Beta Backports ([#6891](https://github.com/paritytech/parity/pull/6891)) + - Bump to v1.8.2 + - Refactor static context check in CREATE. ([#6886](https://github.com/paritytech/parity/pull/6886)) + - Refactor static context check in CREATE. + - Fix wasm. + - Fix serialization of non-localized transactions ([#6868](https://github.com/paritytech/parity/pull/6868)) + - Fix serialization of non-localized transactions. + - Return proper SignedTransactions representation. + - Allow force sealing and reseal=0 for non-dev chains. ([#6878](https://github.com/paritytech/parity/pull/6878)) + ## Parity [v1.8.1](https://github.com/paritytech/parity/releases/tag/v1.8.1) (2017-10-20) Parity 1.8.1 fixes several bugs with token balances, tweaks snapshot-sync, improves the performance of nodes with huge amounts of accounts and changes the Trezor account derivation path. @@ -13,7 +52,7 @@ Parity 1.8.1 fixes several bugs with token balances, tweaks snapshot-sync, impro If you don't want to downgrade or move your funds off your Trezor-device, you can also use the official Trezor application or other wallets allowing to select the derivation path to access the funds. -Full list of included changes: +The full list of included changes: - Add ECIP1017 to Morden config ([#6845](https://github.com/paritytech/parity/pull/6845)) - Ethstore optimizations ([#6844](https://github.com/paritytech/parity/pull/6844)) @@ -45,7 +84,7 @@ Further, users upgrading from 1.7 should acknowledge the following changes: - `trace_filter` RPC method now comes with pagination. [#6312](https://github.com/paritytech/parity/pull/6312) - Added tracing of rewards on closing blocks. [#6194](https://github.com/paritytech/parity/pull/6194) -Full list of included changes: +The full list of included changes: - Updated ethabi to fix auto-update ([#6771](https://github.com/paritytech/parity/pull/6771)) - Fixed kovan chain validation ([#6760](https://github.com/paritytech/parity/pull/6760)) diff --git a/Cargo.lock b/Cargo.lock index e1c089df28e..ea88d9ae718 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,7 +38,7 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.3.23" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "nodrop 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -168,7 +168,7 @@ name = "bloomable" version = "0.1.0" dependencies = [ "ethcore-bigint 0.2.1", - "hash 0.1.0", + "keccak-hash 0.1.0", ] [[package]] @@ -284,9 +284,9 @@ dependencies = [ "ethcore-bytes 0.1.0", "ethcore-util 1.9.0", "ethjson 0.1.0", - "hash 0.1.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "keccak-hash 0.1.0", + "rlp 0.2.1", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -398,6 +398,11 @@ name = "dtoa" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "edit-distance" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "either" version = "1.1.0" @@ -430,11 +435,11 @@ dependencies = [ [[package]] name = "eth-secp256k1" -version = "0.5.6" -source = "git+https://github.com/paritytech/rust-secp256k1#b6b67055edc929057e97d64f036c78ad91f58a7f" +version = "0.5.7" +source = "git+https://github.com/paritytech/rust-secp256k1#6370d63adf4e8c91e2eae9225eef4b4e0294c5d0" dependencies = [ - "arrayvec 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -459,7 +464,7 @@ version = "1.9.0" dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hash 0.1.0", + "keccak-hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -488,17 +493,17 @@ dependencies = [ "ethcore-stratum 1.9.0", "ethcore-util 1.9.0", "ethjson 0.1.0", - "ethkey 0.2.0", - "ethstore 0.1.0", + "ethkey 0.3.0", + "ethstore 0.2.0", "evm 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hardware-wallet 1.9.0", - "hash 0.1.0", - "hashdb 0.1.0", + "hashdb 0.1.1", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.10.0-a.0 (git+https://github.com/paritytech/hyper)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.1.0", + "keccak-hash 0.1.0", "kvdb 0.1.0", "kvdb-memorydb 0.1.0", "kvdb-rocksdb 0.1.0", @@ -508,23 +513,23 @@ dependencies = [ "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "memory-cache 0.1.0", - "memorydb 0.1.0", + "memorydb 0.1.1", "migration 0.1.0", "native-contracts 0.1.0", "num 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-machine 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "patricia_trie 0.1.0", + "patricia-trie 0.1.0", "price-info 1.7.0", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "rlp_derive 0.1.0", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semantic_version 0.1.0", - "snappy 0.1.0", + "snappy 0.1.0 (git+https://github.com/paritytech/rust-snappy)", "stats 0.1.0", "table 0.1.0", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", @@ -586,30 +591,30 @@ dependencies = [ "ethcore 1.9.0", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-devtools 1.9.0", "ethcore-io 1.9.0", "ethcore-network 1.9.0", "ethcore-util 1.9.0", "evm 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "hash 0.1.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.0", "kvdb 0.1.0", "kvdb-memorydb 0.1.0", "kvdb-rocksdb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "memory-cache 0.1.0", - "memorydb 0.1.0", + "memorydb 0.1.1", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "patricia_trie 0.1.0", + "patricia-trie 0.1.0", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "rlp_derive 0.1.0", "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", "triehash 0.1.0", "vm 0.1.0", @@ -620,7 +625,7 @@ name = "ethcore-logger" version = "1.9.0" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "arrayvec 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "isatty 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -637,29 +642,29 @@ dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-devtools 1.9.0", "ethcore-io 1.9.0", "ethcore-logger 1.9.0", - "ethcore-util 1.9.0", "ethcrypto 0.1.0", - "ethkey 0.2.0", - "hash 0.1.0", + "ethkey 0.3.0", "igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.0", "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "path 0.1.0", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "snappy 0.1.0", + "snappy 0.1.0 (git+https://github.com/paritytech/rust-snappy)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -673,15 +678,14 @@ dependencies = [ "ethcore 1.9.0", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-devtools 1.9.0", "ethcore-logger 1.9.0", "ethcore-util 1.9.0", "ethcrypto 0.1.0", - "ethkey 0.2.0", + "ethkey 0.3.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "hash 0.1.0", "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.0", "kvdb 0.1.0", "kvdb-rocksdb 0.1.0", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -692,6 +696,7 @@ dependencies = [ "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -706,13 +711,11 @@ version = "1.9.0" dependencies = [ "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.2.1", - "ethcore-devtools 1.9.0", "ethcore-logger 1.9.0", - "ethcore-util 1.9.0", - "hash 0.1.0", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-tcp-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", + "keccak-hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -726,23 +729,22 @@ dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)", + "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-logger 1.9.0", - "hash 0.1.0", - "hashdb 0.1.0", + "hashdb 0.1.1", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.1.0", + "keccak-hash 0.1.0", "kvdb 0.1.0", "kvdb-memorydb 0.1.0", "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memorydb 0.1.0", + "memorydb 0.1.1", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "patricia_trie 0.1.0", - "rlp 0.2.0", - "rocksdb 0.4.5 (git+https://github.com/paritytech/rust-rocksdb)", + "patricia-trie 0.1.0", + "rlp 0.2.1", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -756,9 +758,9 @@ dependencies = [ name = "ethcrypto" version = "0.1.0" dependencies = [ - "eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)", + "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", "ethcore-bigint 0.2.1", - "ethkey 0.2.0", + "ethkey 0.3.0", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "subtle 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -778,12 +780,15 @@ dependencies = [ [[package]] name = "ethkey" -version = "0.2.0" +version = "0.3.0" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)", + "edit-distance 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)", "ethcore-bigint 0.2.1", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wordlist 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -795,24 +800,27 @@ name = "ethkey-cli" version = "0.1.0" dependencies = [ "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ethkey 0.2.0", + "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ethkey 0.3.0", "panic_hook 0.1.0", + "parity-wordlist 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ethstore" -version = "0.1.0" +version = "0.2.0" dependencies = [ "ethcore-bigint 0.2.1", "ethcrypto 0.1.0", - "ethkey 0.2.0", + "ethkey 0.3.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-wordlist 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-wordlist 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -831,8 +839,10 @@ name = "ethstore-cli" version = "0.1.0" dependencies = [ "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ethstore 0.1.0", + "ethstore 0.2.0", + "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "panic_hook 0.1.0", + "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -847,22 +857,21 @@ dependencies = [ "ethcore 1.9.0", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-devtools 1.9.0", "ethcore-io 1.9.0", "ethcore-light 1.9.0", "ethcore-network 1.9.0", "ethcore-util 1.9.0", - "ethkey 0.2.0", - "hash 0.1.0", + "ethkey 0.3.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.0", "kvdb 0.1.0", "kvdb-memorydb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", @@ -877,8 +886,8 @@ dependencies = [ "ethcore-bigint 0.2.1", "ethcore-util 1.9.0", "evmjit 1.9.0", - "hash 0.1.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.0", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "memory-cache 0.1.0", @@ -972,7 +981,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1015,7 +1024,7 @@ name = "hardware-wallet" version = "1.9.0" dependencies = [ "ethcore-bigint 0.2.1", - "ethkey 0.2.0", + "ethkey 0.3.0", "hidapi 0.3.1 (git+https://github.com/paritytech/hidapi-rs)", "libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1025,19 +1034,9 @@ dependencies = [ "trezor-sys 1.0.0 (git+https://github.com/paritytech/trezor-sys)", ] -[[package]] -name = "hash" -version = "0.1.0" -dependencies = [ - "cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-bigint 0.2.1", - "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "hashdb" -version = "0.1.0" +version = "0.1.1" dependencies = [ "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.2.1", @@ -1107,7 +1106,7 @@ dependencies = [ "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1178,6 +1177,11 @@ name = "integer-encoding" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "interleaved-ordered" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "iovec" version = "0.1.0" @@ -1222,15 +1226,15 @@ dependencies = [ "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-logger 1.9.0", - "hash 0.1.0", - "hashdb 0.1.0", + "hashdb 0.1.1", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hash 0.1.0", "kvdb 0.1.0", "kvdb-memorydb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memorydb 0.1.0", + "memorydb 0.1.1", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "util-error 0.1.0", ] @@ -1330,6 +1334,16 @@ dependencies = [ "ws 0.7.1 (git+https://github.com/tomusdrw/ws-rs)", ] +[[package]] +name = "keccak-hash" +version = "0.1.0" +dependencies = [ + "cc 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethcore-bigint 0.2.1", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -1354,7 +1368,7 @@ version = "0.1.0" dependencies = [ "kvdb 0.1.0", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", ] [[package]] @@ -1363,11 +1377,12 @@ version = "0.1.0" dependencies = [ "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.2.1", + "interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "rocksdb 0.4.5 (git+https://github.com/paritytech/rust-rocksdb)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1508,15 +1523,15 @@ dependencies = [ [[package]] name = "memorydb" -version = "0.1.0" +version = "0.1.1" dependencies = [ "bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.2.1", - "hash 0.1.0", - "hashdb 0.1.0", + "hashdb 0.1.1", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "keccak-hash 0.1.0", + "rlp 0.2.1", ] [[package]] @@ -1813,7 +1828,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "num_cpus" -version = "1.6.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1916,23 +1931,23 @@ dependencies = [ "ethcore-secretstore 1.0.0", "ethcore-stratum 1.9.0", "ethcore-util 1.9.0", - "ethkey 0.2.0", + "ethkey 0.3.0", "ethsync 1.9.0", "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "hash 0.1.0", "ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", "isatty 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "journaldb 0.1.0", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", + "keccak-hash 0.1.0", "kvdb 0.1.0", "kvdb-rocksdb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "migration 0.1.0", "node-filter 1.9.0", "node-health 0.1.0", - "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "number_prefix 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "panic_hook 0.1.0", "parity-dapps 1.9.0", @@ -1948,7 +1963,7 @@ dependencies = [ "path 0.1.0", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "rpassword 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rpc-cli 1.4.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1977,10 +1992,10 @@ dependencies = [ "fetch 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "hash 0.1.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", + "keccak-hash 0.1.0", "linked-hash-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2038,7 +2053,7 @@ dependencies = [ "ethcore-util 1.9.0", "fetch 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "hash 0.1.0", + "keccak-hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mime_guess 2.0.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2057,11 +2072,10 @@ dependencies = [ "ethcore 1.9.0", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", - "ethcore-util 1.9.0", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "multihash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2071,12 +2085,11 @@ version = "0.1.0" dependencies = [ "ethcore 1.9.0", "ethcore-io 1.9.0", - "ethcore-util 1.9.0", - "ethkey 0.2.0", + "ethkey 0.3.0", "kvdb 0.1.0", "kvdb-memorydb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2117,14 +2130,13 @@ dependencies = [ "ethcore-util 1.9.0", "ethcrypto 0.1.0", "ethjson 0.1.0", - "ethkey 0.2.0", - "ethstore 0.1.0", + "ethkey 0.3.0", + "ethstore 0.2.0", "ethsync 1.9.0", "fetch 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "hardware-wallet 1.9.0", - "hash 0.1.0", "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", @@ -2132,6 +2144,7 @@ dependencies = [ "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-pubsub 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-ws-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", + "keccak-hash 0.1.0", "kvdb-memorydb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "macros 0.1.0", @@ -2143,7 +2156,7 @@ dependencies = [ "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2152,6 +2165,7 @@ dependencies = [ "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", + "tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "transient-hashmap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", @@ -2162,9 +2176,9 @@ name = "parity-rpc-client" version = "1.4.0" dependencies = [ "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "hash 0.1.0", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-ws-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", + "keccak-hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.9.0", @@ -2197,8 +2211,8 @@ version = "1.9.0" dependencies = [ "parity-ui-dev 1.9.0", "parity-ui-old-dev 1.9.0", - "parity-ui-old-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git?branch=v1)", - "parity-ui-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git)", + "parity-ui-old-precompiled 1.9.0 (git+https://github.com/js-dist-paritytech/parity-master-1-9-v1.git)", + "parity-ui-precompiled 1.9.0 (git+https://github.com/js-dist-paritytech/parity-master-1-9-shell.git)", "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2219,7 +2233,7 @@ dependencies = [ [[package]] name = "parity-ui-old-precompiled" version = "1.9.0" -source = "git+https://github.com/paritytech/js-precompiled.git?branch=v1#f3fa5e5efb0ed8ada6cd091694fcdaa921e6720f" +source = "git+https://github.com/js-dist-paritytech/parity-master-1-9-v1.git#395d489b1bb399cede784f03fcbe1d8b20ec5b52" dependencies = [ "parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2227,7 +2241,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.9.0" -source = "git+https://github.com/paritytech/js-precompiled.git#31b526f7ec289801a96100e80f19c4cbe850276b" +source = "git+https://github.com/js-dist-paritytech/parity-master-1-9-shell.git#35790d393195e452c506ec8272c2f84b96c09d78" dependencies = [ "parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2271,7 +2285,7 @@ dependencies = [ "ethcore-bigint 0.2.1", "ethcore-network 1.9.0", "ethcrypto 0.1.0", - "ethkey 0.2.0", + "ethkey 0.3.0", "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.9)", @@ -2281,7 +2295,7 @@ dependencies = [ "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2293,7 +2307,7 @@ dependencies = [ [[package]] name = "parity-wordlist" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2327,19 +2341,19 @@ name = "path" version = "0.1.0" [[package]] -name = "patricia_trie" +name = "patricia-trie" version = "0.1.0" dependencies = [ "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.2.1", "ethcore-bytes 0.1.0", "ethcore-logger 1.9.0", - "hash 0.1.0", - "hashdb 0.1.0", + "hashdb 0.1.1", + "keccak-hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memorydb 0.1.0", + "memorydb 0.1.1", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "triehash 0.1.0", ] @@ -2474,6 +2488,22 @@ dependencies = [ "getopts 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "pwasm-run-test" +version = "0.1.0" +dependencies = [ + "clap 2.26.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethcore-bigint 0.2.1", + "ethcore-logger 1.9.0", + "ethjson 0.1.0", + "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "vm 0.1.0", + "wasm 0.1.0", +] + [[package]] name = "quasi" version = "0.32.0" @@ -2551,7 +2581,7 @@ dependencies = [ "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2617,7 +2647,7 @@ dependencies = [ [[package]] name = "rlp" -version = "0.2.0" +version = "0.2.1" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2631,14 +2661,14 @@ name = "rlp_derive" version = "0.1.0" dependencies = [ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "rlp 0.2.0", + "rlp 0.2.1", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rocksdb" version = "0.4.5" -source = "git+https://github.com/paritytech/rust-rocksdb#4364caec4dd5da1a1d78c39276774ee65bf55c7d" +source = "git+https://github.com/paritytech/rust-rocksdb#8c4ad5411c141abc63d562d411053f7ebc1aa00c" dependencies = [ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2648,10 +2678,11 @@ dependencies = [ [[package]] name = "rocksdb-sys" version = "0.3.0" -source = "git+https://github.com/paritytech/rust-rocksdb#4364caec4dd5da1a1d78c39276774ee65bf55c7d" +source = "git+https://github.com/paritytech/rust-rocksdb#8c4ad5411c141abc63d562d411053f7ebc1aa00c" dependencies = [ "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "snappy-sys 0.1.0 (git+https://github.com/paritytech/rust-snappy)", ] [[package]] @@ -2938,8 +2969,19 @@ dependencies = [ [[package]] name = "snappy" version = "0.1.0" +source = "git+https://github.com/paritytech/rust-snappy#858eac97192ea25d18d3f3626a8cc13ca0b175bb" dependencies = [ "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", + "snappy-sys 0.1.0 (git+https://github.com/paritytech/rust-snappy)", +] + +[[package]] +name = "snappy-sys" +version = "0.1.0" +source = "git+https://github.com/paritytech/rust-snappy#858eac97192ea25d18d3f3626a8cc13ca0b175bb" +dependencies = [ + "gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3091,6 +3133,14 @@ dependencies = [ "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "threadpool" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "time" version = "0.1.38" @@ -3247,8 +3297,8 @@ name = "triehash" version = "0.1.0" dependencies = [ "ethcore-bigint 0.2.1", - "hash 0.1.0", - "rlp 0.2.0", + "keccak-hash 0.1.0", + "rlp 0.2.1", ] [[package]] @@ -3351,7 +3401,7 @@ dependencies = [ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.2.1", "kvdb 0.1.0", - "rlp 0.2.0", + "rlp 0.2.1", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3398,10 +3448,10 @@ dependencies = [ "ethcore-bytes 0.1.0", "ethcore-util 1.9.0", "ethjson 0.1.0", - "hash 0.1.0", + "keccak-hash 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "patricia_trie 0.1.0", - "rlp 0.2.0", + "patricia-trie 0.1.0", + "rlp 0.2.1", ] [[package]] @@ -3510,7 +3560,7 @@ dependencies = [ "checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" "checksum app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7d1c0d48a81bbb13043847f957971f4d87c81542d80ece5e84ba3cba4058fd4" -"checksum arrayvec 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "699e63a93b79d717e8c3b5eb1b28b7780d0d6d9e59a72eb769291c83b0c8dc67" +"checksum arrayvec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1c0250693b17316353df525fb088da32a8c18f84eb65d113dde31f5a76ed17b6" "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" "checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159" "checksum backtrace 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "99f2ce94e22b8e664d95c57fff45b98a966c2252b60691d0b7aeeccd88d70983" @@ -3551,11 +3601,12 @@ dependencies = [ "checksum difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8" "checksum docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b5b93718f8b3e5544fcc914c43de828ca6c6ace23e0332c6080a2977b49787a" "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" +"checksum edit-distance 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6a34f5204fbc13582de418611cf3a7dcdd07c6d312a5b631597ba72c06b9d9c9" "checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" "checksum elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "258ff6a9a94f648d0379dbd79110e057edbb53eb85cc237e33eadf8e5a30df85" "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" -"checksum eth-secp256k1 0.5.6 (git+https://github.com/paritytech/rust-secp256k1)" = "" +"checksum eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)" = "" "checksum ethabi 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c819a3adef0413a2519cbd9a19a35dd1c20c7a0110705beaba8aa4aa87eda95f" "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" "checksum flate2 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "e6234dd4468ae5d1e2dbb06fe2b058696fdc50a339c68a393aefbf00bc81e423" @@ -3581,6 +3632,7 @@ dependencies = [ "checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d" "checksum igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "356a0dc23a4fa0f8ce4777258085d00a01ea4923b2efd93538fc44bf5e1bda76" "checksum integer-encoding 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a053c9c7dcb7db1f2aa012c37dc176c62e4cdf14898dee0eecc606de835b8acb" +"checksum interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77" "checksum iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29d062ee61fccdf25be172e70f34c9f6efc597e1fb8f6526e8437b2046ab26be" "checksum ipnetwork 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)" = "2134e210e2a024b5684f90e1556d5f71a1ce7f8b12e9ac9924c67fb36f63b336" "checksum isatty 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fa500db770a99afe2a0f2229be2a3d09c7ed9d7e4e8440bf71253141994e240f" @@ -3635,7 +3687,7 @@ dependencies = [ "checksum num-iter 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "7485fcc84f85b4ecd0ea527b14189281cf27d60e583ae65ebc9c088b13dffe01" "checksum num-rational 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "288629c76fac4b33556f4b7ab57ba21ae202da65ba8b77466e6d598e31990790" "checksum num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "99843c856d68d8b4313b03a17e33c4bb42ae8f6610ea81b28abe076ac721b9b0" -"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584" +"checksum num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "514f0d73e64be53ff320680ca671b64fe3fb91da01e1ae2ddc99eb51d453b20d" "checksum number_prefix 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "59a14be9c211cb9c602bad35ac99f41e9a84b44d71b8cbd3040e3bd02a214902" "checksum odds 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "c3df9b730298cea3a1c3faa90b7e2f9df3a9c400d0936d6015e6165734eefcba" "checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c" @@ -3646,10 +3698,10 @@ dependencies = [ "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "261c025c67ba416e9fe63aa9b3236520ce3c74cfbe43590c9cdcec4ccc8180e4" "checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "" -"checksum parity-ui-old-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git?branch=v1)" = "" -"checksum parity-ui-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git)" = "" +"checksum parity-ui-old-precompiled 1.9.0 (git+https://github.com/js-dist-paritytech/parity-master-1-9-v1.git)" = "" +"checksum parity-ui-precompiled 1.9.0 (git+https://github.com/js-dist-paritytech/parity-master-1-9-shell.git)" = "" "checksum parity-wasm 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8431a184ad88cfbcd71a792aaca319cc7203a94300c26b8dce2d0df0681ea87d" -"checksum parity-wordlist 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81451bfab101d186f8fc4a0aa13cb5539b31b02c4ed96425a0842e2a413daba6" +"checksum parity-wordlist 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d0dec124478845b142f68b446cbee953d14d4b41f1bc0425024417720dce693" "checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" "checksum parking_lot_core 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4f610cb9664da38e417ea3225f23051f589851999535290e077939838ab7a595" "checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" @@ -3720,6 +3772,8 @@ dependencies = [ "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" "checksum smallvec 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8fcd03faf178110ab0334d74ca9631d77f94c8c11cc77fcb59538abf0025695d" +"checksum snappy 0.1.0 (git+https://github.com/paritytech/rust-snappy)" = "" +"checksum snappy-sys 0.1.0 (git+https://github.com/paritytech/rust-snappy)" = "" "checksum spmc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cd1f11d1fb5fd41834e55ce0b85a186efbf2f2afd9fdb09e2c8d72f9bff1ad1a" "checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" @@ -3737,6 +3791,7 @@ dependencies = [ "checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209" "checksum textwrap 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df8e08afc40ae3459e4838f303e465aa50d823df8d7f83ca88108f6d3afe7edd" "checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" +"checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" "checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520" "checksum tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52d12ad79e4063e0cb0ca5efa202ed7244b6ce4d25f4d3abe410b2a66128292" "checksum tokio-core 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e85d419699ec4b71bfe35bbc25bb8771e52eff0471a7f75c853ad06e200b4f86" diff --git a/Cargo.toml b/Cargo.toml index f20872a40bc..17250c32c8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,7 +58,7 @@ parity-updater = { path = "updater" } parity-whisper = { path = "whisper" } path = { path = "util/path" } panic_hook = { path = "panic_hook" } -hash = { path = "util/hash" } +keccak-hash = { path = "util/hash" } migration = { path = "util/migration" } kvdb = { path = "util/kvdb" } kvdb-rocksdb = { path = "util/kvdb-rocksdb" } @@ -116,4 +116,4 @@ lto = false panic = "abort" [workspace] -members = ["ethstore/cli", "ethkey/cli", "evmbin", "whisper", "chainspec", "dapps/js-glue"] +members = ["ethstore/cli", "ethkey/cli", "evmbin", "whisper", "chainspec", "dapps/js-glue", "ethcore/wasm/run"] diff --git a/dapps/Cargo.toml b/dapps/Cargo.toml index 8abbfe27dc9..f3e02826dbc 100644 --- a/dapps/Cargo.toml +++ b/dapps/Cargo.toml @@ -36,7 +36,7 @@ node-health = { path = "./node-health" } parity-hash-fetch = { path = "../hash-fetch" } parity-reactor = { path = "../util/reactor" } parity-ui = { path = "./ui" } -hash = { path = "../util/hash" } +keccak-hash = { path = "../util/hash" } clippy = { version = "0.0.103", optional = true} diff --git a/dapps/src/apps/app.rs b/dapps/src/apps/app.rs index 1d2c9dca6a9..3b674aa152a 100644 --- a/dapps/src/apps/app.rs +++ b/dapps/src/apps/app.rs @@ -26,6 +26,8 @@ pub struct App { pub author: String, #[serde(rename="iconUrl")] pub icon_url: String, + #[serde(rename="localUrl")] + pub local_url: Option, } impl App { @@ -38,6 +40,7 @@ impl App { version: info.version.to_owned(), author: info.author.to_owned(), icon_url: info.icon_url.to_owned(), + local_url: info.local_url.to_owned(), } } } @@ -50,6 +53,7 @@ impl Into for App { version: self.version, author: self.author, icon_url: self.icon_url, + local_url: self.local_url, } } } diff --git a/dapps/src/apps/fetcher/mod.rs b/dapps/src/apps/fetcher/mod.rs index effcc19cd4a..c75569c51b6 100644 --- a/dapps/src/apps/fetcher/mod.rs +++ b/dapps/src/apps/fetcher/mod.rs @@ -306,6 +306,7 @@ mod tests { version: "".into(), author: "".into(), icon_url: "".into(), + local_url: Some("".into()), }, Default::default(), None); // when diff --git a/dapps/src/apps/fs.rs b/dapps/src/apps/fs.rs index 8be2dcf58a1..c581c2a8af5 100644 --- a/dapps/src/apps/fs.rs +++ b/dapps/src/apps/fs.rs @@ -56,6 +56,7 @@ fn read_manifest(name: &str, mut path: PathBuf) -> EndpointInfo { version: "0.0.0".into(), author: "?".into(), icon_url: "icon.png".into(), + local_url: None, } }) } diff --git a/dapps/src/endpoint.rs b/dapps/src/endpoint.rs index 2dbcf209fd8..5491b76deea 100644 --- a/dapps/src/endpoint.rs +++ b/dapps/src/endpoint.rs @@ -44,6 +44,7 @@ pub struct EndpointInfo { pub version: String, pub author: String, pub icon_url: String, + pub local_url: Option, } pub type Endpoints = BTreeMap>; diff --git a/dapps/src/lib.rs b/dapps/src/lib.rs index e63f30c2399..85087242b3c 100644 --- a/dapps/src/lib.rs +++ b/dapps/src/lib.rs @@ -42,7 +42,7 @@ extern crate node_health; extern crate parity_dapps_glue as parity_dapps; extern crate parity_hash_fetch as hash_fetch; extern crate parity_ui; -extern crate hash; +extern crate keccak_hash as hash; #[macro_use] extern crate futures; diff --git a/dapps/src/page/builtin.rs b/dapps/src/page/builtin.rs index f1ea50d4271..0e93b1c6890 100644 --- a/dapps/src/page/builtin.rs +++ b/dapps/src/page/builtin.rs @@ -132,6 +132,7 @@ impl From for EndpointInfo { description: info.description.into(), author: info.author.into(), icon_url: info.icon_url.into(), + local_url: None, version: info.version.into(), } } diff --git a/dapps/src/tests/fetch.rs b/dapps/src/tests/fetch.rs index 9f181d364f2..69e407dfa1e 100644 --- a/dapps/src/tests/fetch.rs +++ b/dapps/src/tests/fetch.rs @@ -180,14 +180,15 @@ fn should_return_fetched_dapp_content() { assert_security_headers_for_embed(&response2.headers); assert_eq!( response2.body, - r#"BE + r#"D2 { "id": "9c94e154dab8acf859b30ee80fc828fb1d38359d938751b65db71d460588d82a", "name": "Gavcoin", "description": "Gavcoin", "version": "1.0.0", "author": "", - "iconUrl": "icon.png" + "iconUrl": "icon.png", + "localUrl": null } 0 diff --git a/dapps/ui/Cargo.toml b/dapps/ui/Cargo.toml index 8d254b177c6..5cfe559f62d 100644 --- a/dapps/ui/Cargo.toml +++ b/dapps/ui/Cargo.toml @@ -13,8 +13,8 @@ rustc_version = "0.1" parity-ui-dev = { path = "../../js", optional = true } parity-ui-old-dev = { path = "../../js-old", optional = true } # This is managed by the js/scripts/release.sh script on CI - keep it in a single line -parity-ui-old-precompiled = { git = "https://github.com/paritytech/js-precompiled.git", optional = true, branch = "v1" } -parity-ui-precompiled = { git = "https://github.com/paritytech/js-precompiled.git", optional = true, branch = "master" } +parity-ui-old-precompiled = { git = "https://github.com/js-dist-paritytech/parity-master-1-9-v1.git", optional = true } +parity-ui-precompiled = { git = "https://github.com/js-dist-paritytech/parity-master-1-9-shell.git", optional = true } [features] no-precompiled-js = ["parity-ui-dev", "parity-ui-old-dev"] diff --git a/docs/CHANGELOG-1.7.md b/docs/CHANGELOG-1.7.md index fc28e6a4596..25ebcd82e90 100644 --- a/docs/CHANGELOG-1.7.md +++ b/docs/CHANGELOG-1.7.md @@ -1,23 +1,26 @@ -### Parity [v1.7.8](https://github.com/paritytech/parity/releases/tag/v1.7.8) (2017-10-27) - -- [stable] Refactor static context check in CREATE ([#6889](https://github.com/paritytech/parity/pull/6889)) -- Fix #6228: do not display eth price in cli for etc ([#6877](https://github.com/paritytech/parity/pull/6877)) -- Fix mining help ([#6885](https://github.com/paritytech/parity/pull/6885)) -- [stable] v1.7.8 ([#6890](https://github.com/paritytech/parity/pull/6890)) -- Refactor static context check in CREATE. ([#6886](https://github.com/paritytech/parity/pull/6886)) -- Cleanup some configuration options ([#6878](https://github.com/paritytech/parity/pull/6878)) -- Fix serialization of non-localized transactions ([#6868](https://github.com/paritytech/parity/pull/6868)) -- Updated NTP to version 0.3 ([#6854](https://github.com/paritytech/parity/pull/6854)) -- Align README with 1.8 and prepare CHANGELOG with 1.8.1 ([#6833](https://github.com/paritytech/parity/pull/6833)) -- Return error on timed unlock ([#6777](https://github.com/paritytech/parity/pull/6777)) -- Fix dapps tests in master ([#6866](https://github.com/paritytech/parity/pull/6866)) -- [Beta] Add ECIP1017 to Morden config (#6810) ([#6845](https://github.com/paritytech/parity/pull/6845)) +### Parity [v1.7.9](https://github.com/paritytech/parity/releases/tag/v1.7.9) (2017-11-14) + +Parity 1.7.9 removes the ability to deploy built-in multi-signature wallets. + +The full list of included changes: + +- Bump to v1.7.9 ([#7047](https://github.com/paritytech/parity/pull/7047)) +- Disallow built-in multi-sig deploy (only watch) ([#7017](https://github.com/paritytech/parity/pull/7017)) + +### Parity [v1.7.8](https://github.com/paritytech/parity/releases/tag/v1.7.8) (2017-10-26) + +Parity 1.7.8 fixes a critical Byzantium consensus issue. Update is highly recommended. + +The full list of included changes: + +- Refactor static context check in CREATE ([#6889](https://github.com/paritytech/parity/pull/6889)) +- Bump to v1.7.8 ([#6890](https://github.com/paritytech/parity/pull/6890)) ## Parity [v1.7.7](https://github.com/paritytech/parity/releases/tag/v1.7.7) (2017-10-15) -Parity 1.7.7 Fixes an issue with auto-update system. Updating is recommended, but not required for Byzantium. +Parity 1.7.7 fixes an issue with auto-update system. Updating is recommended, but not required for Byzantium. -Full list of included changes: +The full list of included changes: - Fix auto-update ([#6769](https://github.com/paritytech/parity/pull/6759)) - Bump to v1.7.7 @@ -28,7 +31,7 @@ Full list of included changes: Parity 1.7.6 includes a critical consensus-relevant fix for the Byzantium hard-fork. Please upgrade your Ethereum client before block number `4_370_000`. -Full list of included changes: +The full list of included changes: - Fixed modexp gas calculation overflow ([#6746](https://github.com/paritytech/parity/pull/6746)) - Fixed modexp gas calculation overflow ([#6741](https://github.com/paritytech/parity/pull/6741)) @@ -40,7 +43,7 @@ Parity 1.7.5 includes a critical consensus-relevant fix for the Byzantium hard-f Parity 1.7.5 is the first stable release of the 1.7 branch. With this release the support for 1.6 releases ends. Please upgrade your stable nodes to 1.7.5. -Full list of included changes: +The full list of included changes: - Backport stable - Fixes Badges ([#6731](https://github.com/paritytech/parity/pull/6731)) - Fix badges not showing up ([#6730](https://github.com/paritytech/parity/pull/6730)) @@ -67,7 +70,7 @@ Full list of included changes: Parity 1.7.4 includes a critical consensus-relevant fix for the Byzantium hard-fork. Please upgrade your Ethereum client before block number `4_370_000`. -Full list of included changes: +The full list of included changes: - Backport ([#6715](https://github.com/paritytech/parity/pull/6715)) - Fix estimate gas if from is not provided. ([#6714](https://github.com/paritytech/parity/pull/6714)) @@ -95,7 +98,7 @@ Parity 1.7.3 enables the Byzantium fork for Ethereum main network on Block 4_370 - Revised timeout and batch size constants for bigger blocks. - Renamed RPC receipt `statusCode` field to `status`. -Full list of included changes: +The full list of included changes: - Backporting ([#6676](https://github.com/paritytech/parity/pull/6676)) - Fix wallet view ([#6597](https://github.com/paritytech/parity/pull/6597)) @@ -143,7 +146,7 @@ Parity 1.7.2 is a bug-fix release to improve performance and stability. Among ot - Tweaked warp-sync to quickly catch up with chains fallen back more than 10,000 blocks. - Fixes to the Chrome extension and macOS installer upgrades. -Full list of included changes: +The full list of included changes: - Fix output from eth_call. ([#6538](https://github.com/paritytech/parity/pull/6538)) - Ropsten fork ([#6532](https://github.com/paritytech/parity/pull/6532)) @@ -294,7 +297,7 @@ Parity 1.7.0 is a major release introducing several important features: - **PubSub API**. https://github.com/paritytech/parity/wiki/JSONRPC-Parity-Pub-Sub-module - **Signer apps for IOS and Android**. -Full list of included changes: +The full list of included changes: - Backports [#6163](https://github.com/paritytech/parity/pull/6163) - Light client improvements ([#6156](https://github.com/paritytech/parity/pull/6156)) diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index e60d63c22b5..b6986af83da 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Parity Technologies "] [dependencies] log = "0.3" -hash = { path = "../util/hash" } +keccak-hash = { path = "../util/hash" } primal = "0.2.3" parking_lot = "0.4" crunchy = "0.1.0" diff --git a/ethash/src/keccak.rs b/ethash/src/keccak.rs index 752b0230b5d..8ca4f543844 100644 --- a/ethash/src/keccak.rs +++ b/ethash/src/keccak.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate hash; +extern crate keccak_hash as hash; pub type H256 = [u8; 32]; diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 2f77b8cb3c5..8d7301438ba 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -19,7 +19,7 @@ ethcore-bloom-journal = { path = "../util/bloom" } ethcore-bytes = { path = "../util/bytes" } hashdb = { path = "../util/hashdb" } memorydb = { path = "../util/memorydb" } -patricia_trie = { path = "../util/patricia_trie" } +patricia-trie = { path = "../util/patricia_trie" } ethcore-devtools = { path = "../devtools" } ethcore-io = { path = "../util/io" } ethcore-logger = { path = "../logger" } @@ -54,7 +54,7 @@ kvdb = { path = "../util/kvdb" } kvdb-rocksdb = { path = "../util/kvdb-rocksdb" } kvdb-memorydb = { path = "../util/kvdb-memorydb" } util-error = { path = "../util/error" } -snappy = { path = "../util/snappy" } +snappy = { git = "https://github.com/paritytech/rust-snappy" } migration = { path = "../util/migration" } macros = { path = "../util/macros" } rust-crypto = "0.2.34" @@ -67,7 +67,7 @@ table = { path = "../util/table" } bloomable = { path = "../util/bloomable" } vm = { path = "vm" } wasm = { path = "wasm" } -hash = { path = "../util/hash" } +keccak-hash = { path = "../util/hash" } triehash = { path = "../util/triehash" } semantic_version = { path = "../util/semantic_version" } unexpected = { path = "../util/unexpected" } diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index 5cef517f447..b57e599bb03 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -12,7 +12,7 @@ heapsize = "0.4" lazy_static = "0.2" log = "0.3" vm = { path = "../vm" } -hash = { path = "../../util/hash" } +keccak-hash = { path = "../../util/hash" } parking_lot = "0.4" memory-cache = { path = "../../util/memory_cache" } diff --git a/ethcore/evm/src/lib.rs b/ethcore/evm/src/lib.rs index 7ddbed19e62..8a250f84709 100644 --- a/ethcore/evm/src/lib.rs +++ b/ethcore/evm/src/lib.rs @@ -22,7 +22,7 @@ extern crate ethcore_bigint as bigint; extern crate parking_lot; extern crate heapsize; extern crate vm; -extern crate hash; +extern crate keccak_hash as hash; extern crate memory_cache; #[macro_use] diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index 2b56a30bd4a..8e366289bf1 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -13,10 +13,9 @@ ethcore-util = { path = "../../util" } ethcore-bigint = { path = "../../util/bigint" } ethcore-bytes = { path = "../../util/bytes" } memorydb = { path = "../../util/memorydb" } -patricia_trie = { path = "../../util/patricia_trie" } +patricia-trie = { path = "../../util/patricia_trie" } ethcore-network = { path = "../../util/network" } ethcore-io = { path = "../../util/io" } -ethcore-devtools = { path = "../../devtools" } evm = { path = "../evm" } heapsize = "0.4" vm = { path = "../vm" } @@ -32,12 +31,15 @@ serde = "1.0" serde_derive = "1.0" parking_lot = "0.4" stats = { path = "../../util/stats" } -hash = { path = "../../util/hash" } +keccak-hash = { path = "../../util/hash" } triehash = { path = "../../util/triehash" } kvdb = { path = "../../util/kvdb" } kvdb-rocksdb = { path = "../../util/kvdb-rocksdb" } kvdb-memorydb = { path = "../../util/kvdb-memorydb" } memory-cache = { path = "../../util/memory_cache" } +[dev-dependencies] +tempdir = "0.3" + [features] default = [] diff --git a/ethcore/light/src/client/service.rs b/ethcore/light/src/client/service.rs index b05c7dacbd4..b28169c5d77 100644 --- a/ethcore/light/src/client/service.rs +++ b/ethcore/light/src/client/service.rs @@ -120,7 +120,6 @@ impl IoHandler for ImportBlocks { #[cfg(test)] mod tests { use super::Service; - use devtools::RandomTempPath; use ethcore::spec::Spec; use std::sync::Arc; @@ -128,13 +127,14 @@ mod tests { use client::fetch; use time::Duration; use parking_lot::Mutex; + use tempdir::TempDir; #[test] fn it_works() { + let tempdir = TempDir::new("").unwrap(); let spec = Spec::new_test(); - let temp_path = RandomTempPath::new(); let cache = Arc::new(Mutex::new(Cache::new(Default::default(), Duration::hours(6)))); - Service::start(Default::default(), &spec, fetch::unavailable(), temp_path.as_path(), cache).unwrap(); + Service::start(Default::default(), &spec, fetch::unavailable(), tempdir.path(), cache).unwrap(); } } diff --git a/ethcore/light/src/lib.rs b/ethcore/light/src/lib.rs index f9c3d89b824..cceb124295e 100644 --- a/ethcore/light/src/lib.rs +++ b/ethcore/light/src/lib.rs @@ -76,7 +76,7 @@ extern crate smallvec; extern crate stats; extern crate time; extern crate vm; -extern crate hash; +extern crate keccak_hash as hash; extern crate triehash; extern crate kvdb; extern crate kvdb_memorydb; @@ -84,4 +84,4 @@ extern crate kvdb_rocksdb; extern crate memory_cache; #[cfg(test)] -extern crate ethcore_devtools as devtools; +extern crate tempdir; diff --git a/ethcore/light/src/net/error.rs b/ethcore/light/src/net/error.rs index 57897834871..35349c55392 100644 --- a/ethcore/light/src/net/error.rs +++ b/ethcore/light/src/net/error.rs @@ -17,10 +17,8 @@ //! Defines error types and levels of punishment to use upon //! encountering. -use rlp::DecoderError; -use network::NetworkError; - use std::fmt; +use {rlp, network}; /// Levels of punishment. /// @@ -41,9 +39,9 @@ pub enum Punishment { #[derive(Debug)] pub enum Error { /// An RLP decoding error. - Rlp(DecoderError), + Rlp(rlp::DecoderError), /// A network error. - Network(NetworkError), + Network(network::Error), /// Out of credits. NoCredits, /// Unrecognized packet code. @@ -92,14 +90,14 @@ impl Error { } } -impl From for Error { - fn from(err: DecoderError) -> Self { +impl From for Error { + fn from(err: rlp::DecoderError) -> Self { Error::Rlp(err) } } -impl From for Error { - fn from(err: NetworkError) -> Self { +impl From for Error { + fn from(err: network::Error) -> Self { Error::Network(err) } } diff --git a/ethcore/light/src/net/load_timer.rs b/ethcore/light/src/net/load_timer.rs index 8df8fdf178d..6b522f92081 100644 --- a/ethcore/light/src/net/load_timer.rs +++ b/ethcore/light/src/net/load_timer.rs @@ -264,8 +264,9 @@ mod tests { #[test] fn file_store() { - let path = ::devtools::RandomTempPath::new(); - let store = FileStore(path.as_path().clone()); + let tempdir = ::tempdir::TempDir::new("").unwrap(); + let path = tempdir.path().join("file"); + let store = FileStore(path); let mut samples = store.load(); assert!(samples.is_empty()); diff --git a/ethcore/res/ethereum/kovan.json b/ethcore/res/ethereum/kovan.json index 325b7cdf6a6..7ce019ee833 100644 --- a/ethcore/res/ethereum/kovan.json +++ b/ethcore/res/ethereum/kovan.json @@ -23,7 +23,9 @@ ] }, "validateScoreTransition": 1000000, - "validateStepTransition": 1500000 + "validateStepTransition": 1500000, + "maximumUncleCountTransition": 10000000, + "maximumUncleCount": 2 } } }, diff --git a/ethcore/res/wasm-tests b/ethcore/res/wasm-tests index 9a1fcbf0d4e..d6185ea16ea 160000 --- a/ethcore/res/wasm-tests +++ b/ethcore/res/wasm-tests @@ -1 +1 @@ -Subproject commit 9a1fcbf0d4e73bea437577e807bc38c7ba243d80 +Subproject commit d6185ea16eaba7ff685c069c2064819f9549c4d7 diff --git a/ethcore/src/block.rs b/ethcore/src/block.rs index d701a17eb64..ddf72be2c55 100644 --- a/ethcore/src/block.rs +++ b/ethcore/src/block.rs @@ -380,8 +380,13 @@ impl<'x> OpenBlock<'x> { /// NOTE Will check chain constraints and the uncle number but will NOT check /// that the header itself is actually valid. pub fn push_uncle(&mut self, valid_uncle_header: Header) -> Result<(), BlockError> { - if self.block.uncles.len() + 1 > self.engine.maximum_uncle_count() { - return Err(BlockError::TooManyUncles(OutOfBounds{min: None, max: Some(self.engine.maximum_uncle_count()), found: self.block.uncles.len() + 1})); + let max_uncles = self.engine.maximum_uncle_count(self.block.header().number()); + if self.block.uncles.len() + 1 > max_uncles { + return Err(BlockError::TooManyUncles(OutOfBounds{ + min: None, + max: Some(max_uncles), + found: self.block.uncles.len() + 1, + })); } // TODO: check number // TODO: check not a direct ancestor (use last_hashes for that) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 22e727ff0da..6b5dbe59caa 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -1231,12 +1231,12 @@ impl BlockChainClient for Client { } fn estimate_gas(&self, t: &SignedTransaction, block: BlockId) -> Result { - const UPPER_CEILING: u64 = 1_000_000_000_000u64; - let (mut upper, env_info) = { + let (mut upper, max_upper, env_info) = { let mut env_info = self.env_info(block).ok_or(CallError::StatePruned)?; - let initial_upper = env_info.gas_limit; - env_info.gas_limit = UPPER_CEILING.into(); - (initial_upper, env_info) + let init = env_info.gas_limit; + let max = init * U256::from(10); + env_info.gas_limit = max; + (init, max, env_info) }; // that's just a copy of the state. @@ -1257,9 +1257,7 @@ impl BlockChainClient for Client { }; if !cond(upper)? { - // impossible at block gas limit - try `UPPER_CEILING` instead. - // TODO: consider raising limit by powers of two. - upper = UPPER_CEILING.into(); + upper = max_upper; if !cond(upper)? { trace!(target: "estimate_gas", "estimate_gas failed with {}", upper); let err = ExecutionError::Internal(format!("Requires higher than upper limit of {}", upper)); @@ -1872,7 +1870,7 @@ impl MiningBlockChainClient for Client { .find_uncle_headers(&h, engine.maximum_uncle_age()) .unwrap_or_else(Vec::new) .into_iter() - .take(engine.maximum_uncle_count()) + .take(engine.maximum_uncle_count(open_block.header().number())) .foreach(|h| { open_block.push_uncle(h).expect("pushing maximum_uncle_count; open_block was just created; @@ -1887,7 +1885,7 @@ impl MiningBlockChainClient for Client { fn reopen_block(&self, block: ClosedBlock) -> OpenBlock { let engine = &*self.engine; let mut block = block.reopen(engine); - let max_uncles = engine.maximum_uncle_count(); + let max_uncles = engine.maximum_uncle_count(block.header().number()); if block.uncles().len() < max_uncles { let chain = self.chain.read(); let h = chain.best_block_hash(); diff --git a/ethcore/src/engines/authority_round/mod.rs b/ethcore/src/engines/authority_round/mod.rs index 27bd678a9d2..975246c6c1f 100644 --- a/ethcore/src/engines/authority_round/mod.rs +++ b/ethcore/src/engines/authority_round/mod.rs @@ -65,6 +65,10 @@ pub struct AuthorityRoundParams { pub immediate_transitions: bool, /// Block reward in base units. pub block_reward: U256, + /// Number of accepted uncles transition block. + pub maximum_uncle_count_transition: u64, + /// Number of accepted uncles. + pub maximum_uncle_count: usize, } impl From for AuthorityRoundParams { @@ -77,6 +81,8 @@ impl From for AuthorityRoundParams { validate_step_transition: p.validate_step_transition.map_or(0, Into::into), immediate_transitions: p.immediate_transitions.unwrap_or(false), block_reward: p.block_reward.map_or_else(Default::default, Into::into), + maximum_uncle_count_transition: p.maximum_uncle_count_transition.map_or(0, Into::into), + maximum_uncle_count: p.maximum_uncle_count.map_or(0, Into::into), } } } @@ -218,6 +224,8 @@ pub struct AuthorityRound { epoch_manager: Mutex, immediate_transitions: bool, block_reward: U256, + maximum_uncle_count_transition: u64, + maximum_uncle_count: usize, machine: EthereumMachine, } @@ -365,6 +373,8 @@ impl AuthorityRound { epoch_manager: Mutex::new(EpochManager::blank()), immediate_transitions: our_params.immediate_transitions, block_reward: our_params.block_reward, + maximum_uncle_count_transition: our_params.maximum_uncle_count_transition, + maximum_uncle_count: our_params.maximum_uncle_count, machine: machine, }); @@ -436,8 +446,16 @@ impl Engine for AuthorityRound { ] } + fn maximum_uncle_count(&self, block: BlockNumber) -> usize { + if block >= self.maximum_uncle_count_transition { + self.maximum_uncle_count + } else { + // fallback to default value + 2 + } + } + fn populate_from_parent(&self, header: &mut Header, parent: &Header) { - // Chain scoring: total weight is sqrt(U256::max_value())*height - step let new_difficulty = U256::from(U128::max_value()) + header_step(parent).expect("Header has been verified; qed").into() - self.step.load().into(); header.set_difficulty(new_difficulty); } @@ -949,6 +967,8 @@ mod tests { validate_score_transition: 0, validate_step_transition: 0, immediate_transitions: true, + maximum_uncle_count_transition: 0, + maximum_uncle_count: 0, block_reward: Default::default(), }; @@ -976,4 +996,31 @@ mod tests { assert!(aura.verify_block_family(&header, &parent_header).is_ok()); assert_eq!(last_benign.load(AtomicOrdering::SeqCst), 1); } + + #[test] + fn test_uncles_transition() { + let last_benign = Arc::new(AtomicUsize::new(0)); + let params = AuthorityRoundParams { + step_duration: Default::default(), + start_step: Some(1), + validators: Box::new(TestSet::new(Default::default(), last_benign.clone())), + validate_score_transition: 0, + validate_step_transition: 0, + immediate_transitions: true, + maximum_uncle_count_transition: 1, + maximum_uncle_count: 0, + block_reward: Default::default(), + }; + + let aura = { + let mut c_params = ::spec::CommonParams::default(); + c_params.gas_limit_bound_divisor = 5.into(); + let machine = ::machine::EthereumMachine::regular(c_params, Default::default()); + AuthorityRound::new(params, machine).unwrap() + }; + + assert_eq!(aura.maximum_uncle_count(0), 2); + assert_eq!(aura.maximum_uncle_count(1), 0); + assert_eq!(aura.maximum_uncle_count(100), 0); + } } diff --git a/ethcore/src/engines/mod.rs b/ethcore/src/engines/mod.rs index 802b4ab88c4..7c12e138e52 100644 --- a/ethcore/src/engines/mod.rs +++ b/ethcore/src/engines/mod.rs @@ -192,7 +192,8 @@ pub trait Engine: Sync + Send { fn extra_info(&self, _header: &M::Header) -> BTreeMap { BTreeMap::new() } /// Maximum number of uncles a block is allowed to declare. - fn maximum_uncle_count(&self) -> usize { 2 } + fn maximum_uncle_count(&self, _block: BlockNumber) -> usize { 0 } + /// The number of generations back that uncles can be. fn maximum_uncle_age(&self) -> usize { 6 } @@ -363,7 +364,7 @@ pub trait EthEngine: Engine<::machine::EthereumMachine> { } /// The nonce with which accounts begin at given block. - fn account_start_nonce(&self, block: u64) -> U256 { + fn account_start_nonce(&self, block: BlockNumber) -> U256 { self.machine().account_start_nonce(block) } diff --git a/ethcore/src/engines/null_engine.rs b/ethcore/src/engines/null_engine.rs index 1c7edc99b35..cc48a225ad4 100644 --- a/ethcore/src/engines/null_engine.rs +++ b/ethcore/src/engines/null_engine.rs @@ -16,6 +16,7 @@ use bigint::prelude::U256; use engines::Engine; +use header::BlockNumber; use parity_machine::{Header, LiveBlock, WithBalances}; /// Params for a null engine. @@ -95,6 +96,8 @@ impl Engine for NullEngine { self.machine.note_rewards(block, &[(author, result_block_reward)], &uncle_rewards) } + fn maximum_uncle_count(&self, _block: BlockNumber) -> usize { 2 } + fn verify_local_seal(&self, _header: &M::Header) -> Result<(), M::Error> { Ok(()) } diff --git a/ethcore/src/engines/tendermint/mod.rs b/ethcore/src/engines/tendermint/mod.rs index 97cc18c03d4..7fe1f68bfe2 100644 --- a/ethcore/src/engines/tendermint/mod.rs +++ b/ethcore/src/engines/tendermint/mod.rs @@ -450,7 +450,7 @@ impl Engine for Tendermint { fn machine(&self) -> &EthereumMachine { &self.machine } - fn maximum_uncle_count(&self) -> usize { 0 } + fn maximum_uncle_count(&self, _block: BlockNumber) -> usize { 0 } fn maximum_uncle_age(&self) -> usize { 0 } diff --git a/ethcore/src/ethereum/ethash.rs b/ethcore/src/ethereum/ethash.rs index a49ba2e2ae9..55f0d58de3a 100644 --- a/ethcore/src/ethereum/ethash.rs +++ b/ethcore/src/ethereum/ethash.rs @@ -26,7 +26,7 @@ use util::Address; use unexpected::{OutOfBounds, Mismatch}; use block::*; use error::{BlockError, Error}; -use header::Header; +use header::{Header, BlockNumber}; use engines::{self, Engine}; use ethjson; use rlp::{self, UntrustedRlp}; @@ -181,6 +181,8 @@ impl Engine for Arc { } } + fn maximum_uncle_count(&self, _block: BlockNumber) -> usize { 2 } + fn populate_from_parent(&self, header: &mut Header, parent: &Header) { let difficulty = self.calculate_difficulty(header, parent); header.set_difficulty(difficulty); @@ -447,9 +449,12 @@ fn ecip1017_eras_block_reward(era_rounds: u64, mut reward: U256, block_number:u6 } else { block_number / era_rounds }; + let mut divi = U256::from(1); for _ in 0..eras { - reward = reward / U256::from(5) * U256::from(4); + reward = reward * U256::from(4); + divi = divi * U256::from(5); } + reward = reward / divi; (eras, reward) } @@ -515,6 +520,11 @@ mod tests { let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, start_reward, block_number); assert_eq!(15, eras); assert_eq!(U256::from_str("271000000000000").unwrap(), reward); + + let block_number = 250000000; + let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, start_reward, block_number); + assert_eq!(49, eras); + assert_eq!(U256::from_str("51212FFBAF0A").unwrap(), reward); } #[test] diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 4620cc8928e..b969a39dd3e 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -103,7 +103,7 @@ extern crate price_info; extern crate rand; extern crate rayon; extern crate rlp; -extern crate hash; +extern crate keccak_hash as hash; extern crate heapsize; extern crate memorydb; extern crate patricia_trie as trie; diff --git a/ethcore/src/verification/verification.rs b/ethcore/src/verification/verification.rs index c566419165e..2978774b0a0 100644 --- a/ethcore/src/verification/verification.rs +++ b/ethcore/src/verification/verification.rs @@ -137,9 +137,14 @@ pub fn verify_block_family(header: &Header, parent: &Header, engine: &EthEngine, fn verify_uncles(header: &Header, bytes: &[u8], bc: &BlockProvider, engine: &EthEngine) -> Result<(), Error> { let num_uncles = UntrustedRlp::new(bytes).at(2)?.item_count()?; + let max_uncles = engine.maximum_uncle_count(header.number()); if num_uncles != 0 { - if num_uncles > engine.maximum_uncle_count() { - return Err(From::from(BlockError::TooManyUncles(OutOfBounds { min: None, max: Some(engine.maximum_uncle_count()), found: num_uncles }))); + if num_uncles > max_uncles { + return Err(From::from(BlockError::TooManyUncles(OutOfBounds { + min: None, + max: Some(max_uncles), + found: num_uncles, + }))); } let mut excluded = HashSet::new(); @@ -653,7 +658,7 @@ mod tests { let mut bad_uncles = good_uncles.clone(); bad_uncles.push(good_uncle1.clone()); check_fail(family_test(&create_test_block_with_data(&header, &good_transactions, &bad_uncles), engine, &bc), - TooManyUncles(OutOfBounds { max: Some(engine.maximum_uncle_count()), min: None, found: bad_uncles.len() })); + TooManyUncles(OutOfBounds { max: Some(engine.maximum_uncle_count(header.number())), min: None, found: bad_uncles.len() })); header = good.clone(); bad_uncles = vec![ good_uncle1.clone(), good_uncle1.clone() ]; diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index 73d7b29323a..5e037c2a41c 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -12,7 +12,7 @@ ethcore-util = { path = "../../util" } ethcore-bigint = { path = "../../util/bigint" } ethjson = { path = "../../json" } bloomable = { path = "../../util/bloomable" } -hash = { path = "../../util/hash" } +keccak-hash = { path = "../../util/hash" } heapsize = "0.4" [dev-dependencies] diff --git a/ethcore/types/src/lib.rs b/ethcore/types/src/lib.rs index 85d36b200d6..51e2890d481 100644 --- a/ethcore/types/src/lib.rs +++ b/ethcore/types/src/lib.rs @@ -24,7 +24,7 @@ extern crate rlp; #[macro_use] extern crate rlp_derive; extern crate bloomable; -extern crate hash; +extern crate keccak_hash as hash; extern crate heapsize; #[cfg(test)] diff --git a/ethcore/vm/Cargo.toml b/ethcore/vm/Cargo.toml index 7f497a64282..24e75be2e0c 100644 --- a/ethcore/vm/Cargo.toml +++ b/ethcore/vm/Cargo.toml @@ -8,9 +8,9 @@ byteorder = "1.0" ethcore-util = { path = "../../util" } ethcore-bytes = { path = "../../util/bytes" } ethcore-bigint = { path = "../../util/bigint" } -patricia_trie = { path = "../../util/patricia_trie" } +patricia-trie = { path = "../../util/patricia_trie" } log = "0.3" common-types = { path = "../types" } ethjson = { path = "../../json" } rlp = { path = "../../util/rlp" } -hash = { path = "../../util/hash" } +keccak-hash = { path = "../../util/hash" } diff --git a/ethcore/vm/src/lib.rs b/ethcore/vm/src/lib.rs index 1f88bf625ab..08f0aa639f3 100644 --- a/ethcore/vm/src/lib.rs +++ b/ethcore/vm/src/lib.rs @@ -22,7 +22,7 @@ extern crate ethcore_bytes as bytes; extern crate common_types as types; extern crate ethjson; extern crate rlp; -extern crate hash; +extern crate keccak_hash as hash; extern crate patricia_trie as trie; mod action_params; diff --git a/ethcore/wasm/run/Cargo.toml b/ethcore/wasm/run/Cargo.toml new file mode 100644 index 00000000000..a739d72e2b7 --- /dev/null +++ b/ethcore/wasm/run/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "pwasm-run-test" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +serde = "1" +serde_json = "1" +serde_derive = "1" +ethcore-bigint = { path = "../../../util/bigint" } +ethjson = { path = "../../../json" } +vm = { path = "../../vm" } +wasm = { path = "../" } +clap = "2.24" +ethcore-logger = { path = "../../../logger" } +rustc-hex = "1" + +[features] +default = ["ethcore-bigint/std"] \ No newline at end of file diff --git a/ethcore/wasm/run/res/sample-fixture.json b/ethcore/wasm/run/res/sample-fixture.json new file mode 100644 index 00000000000..7be3e04be03 --- /dev/null +++ b/ethcore/wasm/run/res/sample-fixture.json @@ -0,0 +1,45 @@ +[ + { + "caption": "Sample test", + "source": "./res/sample1.wasm", + "address": "0x1000000000000000000000000000000000000001", + "sender": "0x1000000000000000000000000000000000000002", + "value": "0x0000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": 100000, + "payload": "0x", + "asserts": [ + { "Return": "0x01" }, + { "UsedGas": 17 }, + { "HasCall": { "codeAddress": "0x1000000000000000000000000000000000000002" }}, + { "HasStorage": + { + "key": "0x0000000000000000000000000000000000000000000000000000000000000001", + "value": "0x0000000000000000000000000000000000000000000000000000000000000002" + } + } + ] + }, + { + "caption": "Keccak test", + "source": "./res/sample2.wasm", + "payload": "0x736f6d657468696e67", + "gasLimit": 100000, + "asserts": [ + { "Return": "0x68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87" } + ] + }, + { + "caption": "Token total supply", + "source": { + "constructor": "./res/sample3.wasm", + "sender": "0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f", + "at": "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "arguments": "0x0000000000000000000000000000000000000000000000000000000010000000" + }, + "payload": "0x18160ddd", + "gasLimit": 100000, + "asserts": [ + { "Return": "0x0000000000000000000000000000000000000000000000000000000010000000" } + ] + } +] \ No newline at end of file diff --git a/ethcore/wasm/run/res/sample1.wasm b/ethcore/wasm/run/res/sample1.wasm new file mode 100644 index 0000000000000000000000000000000000000000..6ea0c58cc77bec3f6ccec1a8d3616e28d48df29c GIT binary patch literal 125 zcmW-YK@Ng26b0Y=4QOdX+_?7y-hqYZfKnSbEfA{nL-{7x0(pYN9dJ=*qckFEHlHgH8L0 NOWJR4p3-Vv`T}Mx8bkm9 literal 0 HcmV?d00001 diff --git a/ethcore/wasm/run/res/sample2.wasm b/ethcore/wasm/run/res/sample2.wasm new file mode 100644 index 0000000000000000000000000000000000000000..baf9d17aa98fd185167448c58cc0388993dfab0a GIT binary patch literal 15410 zcmd6O3v^u7dG6WgHD~6`jEnM@Hm|#)@B!pne@&F#$l06zb zxNXqLcpURI+(+Y;+z@ha8Xkp)WVK03XrOBq0%-!Ks}!21ft5>c)3xper%Bs1O>n<& zpBX)jA?;mvt=j?3-v8eF-+TX${r~^|_gI^pJ0LVo6We1G#{B%en4i$qx0u%^L8!iEGq>b- zADG;~e|AbUmbGLK%w_VL8gK7DI61R#N;BCVRR}lcGMR9K*zW!Nj~v*Y&rKfGtQGiE z2alHU4`dF^=8o#3pcmAlR(^8N{){*%YHHM!3LKrB%W#8hQo3!Lx-d;k*M!hbTbL2u z)Eps%7S-{k3)==C)@W`dDy-d8*t`~rHVAEvaBJ38uJ_ujs^e={wZ&UnrEJG1_VRV9 zFGobv{2JX)tkHwBMz&3tiQu%J^=+B(qo~Vl$_l*zPFQ$hQLm3ktz9=$!c-N_uK@0InAej6bL~L0@GE77UnM=? z3^YFpIAWm^MV&6L#s|!Ksaw);Q>!tr zyIx~lxH85qVtJNctpzHoL0$vMYXokMjQLHj ztd=#qFs2%$H-Pj;-;^~Vy~&TnO;^^)YOm3C$%RV%Rh3w#*aJ9%tyalo){jY3Mr5T- zPNxKEk6<-7WuRvHkeRQ8cJPX{gMwwW>!cmh79iIk?a~CjSkIM_ED5$#0*k&XJi9^K z?fP>9I`EvpmV=Wq2o99hxzeVBq=@N9q%Bb|EoN_mZYVZKf_b!-P=6j>LR}gi6z0`X z+jF5ToGqoK4E8vFT_F8c7QRT1xu^z?G_!srkkXuntUv{o0i;khu$7b{^^~Rd4vC_B z8kCygK*|i{2Nb!1gtQhLpTK-N5PvE}Y#zHaaq=lH19hN6PqdUdEd|ayzqC|j zI%QGKVF5Hqz=jMgrCyLmHl;yS6jBAW5A7*X1alBPS?R4&atTB}1(j1rTBLM0&@M&y z>rt=4mB!Mnkl-bNbnrNe6CrSFA%4nI_aQc%S}+2_5}qlezHq@YPoR`y%p3tTZP#Dby8!o9!+O7aE`!c06zy{64(mh0h|hpKs$hLFp2d} z)WNU_>s_e73JhwJ-vOWij3|K=fQJCY2wVhU2=aPPmL0}DllfXz4 z=mGFJfC>UF0G`G$kH7{1_1RP<>%FM|7#&pv`T*PulxhNv0KN{OhCmyD=P<06KtBMP zP1UhJfcjZvJYGx<%JoHmo9vR!vb!kP6lG6QwiHv6LnMdDbr>Nx7vY z^|uuL5!on*i>b!Z+7q&IbmPh6saCm04zXn;TWZk~jLsKt0~u+yZenW{V;AC;) zia3mdUS0(CG>_|Hu9~1F9k5ExFh)K&(*moq3A@^W#U<8g^_$=cX%L$j&gpVJ3qx*Z zVag5`mTYDbkzFio*~!9@K8vVKv53hQ7IE3l!j+p?B;*7;oz4nusZKv@Fj&>;O?2s8qM}$6#vMB|;Uf^LnqmCR z32Vj@5E3SOJcfW?V+d!!$zlN`IEPPUCqjQC@ODVB%^W)f|0tvUa(n}^5}Yz(E)79B zd@MsIBlO5iEHdDOE#-K@1o&dhcNw{W)FnhtBVC3Tx{NVS0XYnI;$`|KZt%84 zchcxmH7~7uG9Ek~mA2;x=foj6?+OdL8YzuO4N~S*3~t=t4x=Rv(T(COqssfM)w)5S zijU~S5F4r}CqS@+pam{VB0xb@7MKjZl$(Yd!$zT90mdS(3eEy#bOsPZ7+`rJRDbv6#Rn`w zdBRdL+Eb(=WL^w$B@dS#+5&Z_Q-=mfi|SKWH`S)p&7itzp6`Q?z}DPTLPScICA_HM zbOa`&dsLRik|x!MoCXu~sTJo$2@_GZ)M=L0i7A;8-e1_{<61&9LUmA4D=u@88M?4D z5)17?q3#5~wM3xOa-GpB>>Y>c!6v0wVI2WqIiwG8Q&7qtYC0eszToTOp$wHANdcwg zkgMtqm0UqkwBR`xO8%SS+D7?=8C)Clay^4T38}Tp-_oQ-{m?df$fc4F0Ef8AZkUuqJM!n1m~^h089RjfiNE;a;N#;;w9P zAgmjV77l?`##hbDaou3OG^U|BaolN@xK&|-5im2jE0Lkfmm~t%%6X;Aiz(MTDX!3pslz+Ag`kz0UoxXkLWN9u&jX?r-5kK<4`c2mtz<19P;*7bHm7t zps$`AW~B+^FhQlJ@s^zk9PR;D6?dDUTkVavA-EDA_46mf{J7U+W%ZwoA%OuZ4Xhu4 z-KHBDhmxiybYXx{p8{~Wis3V3;)JeA9AO8@3{Z2(X2p^y?WV3QDJ>c;4d+CQvVZ!L z{fh?7Kb7sDvY5&U>MM+(LMR!*C`QLt7(tyzkkTw$L4{m4X#&f_+%96nWiGRV;Bu7A zK|n?IEF{5Y0*%BT3Z_xs+v$ z+x`j}BQEh{p^T%THnu2Z1}veBV~a9|`kBaH(pyr-R!PQaQ8KocWDKSDq3SpVIBMvJ zR}4{B$XFqiq~u_90x|}MIzpKKd>LCrE{hA&SSDi!mQMMvA$f!D~}uFJ2e4C{*DRg-?XxFLFBPz zB7e_iOR7~8xkc?VU3?=LTzT4|g%>m%t_!0Sr`LrWMG4gZstbo!pB@Jp7xV#DqxXcs zc^F`&V8T$u8Pmf5XeH;aYATjgwX$h7L^#ZVfh$l&|+i7kU5yH9w9l3COAGA zN-k`wLjnbmraB}(GRSCC$HZKDOlaJYuT%ZuF=2IiJg5+s9g`@O9T@7EaO?_GSVAsq zJPgQr$0UklLTq(RaK+>?v1Bxhfn_9(**&^QcZJe}W}Es_fk+Z&MWcqZfr>;fgvDHFt}4KQ8!c#&aLhauFg6z!zN_#ht4Uyh}zFe%GVz{ev( zCB`EcSN`}l!62K!Peqn3r-*gL*-({aQs_~<8h_NXvXew%**Ehhu3OTdee-c zOzGgsLzy2=iecbF++>X6!GH0U$sEIIeH?V*a?S%MbtcI{dVqPnW@s&LHJ~YYYM#4P zgO+-^WF@y+;;0IGFT_#!Lux9t5RW>bBr=wA6fcoQ5IzRF-`*Dm&sRH zrZAg;xNusUr7S)r_^#{8|BKlXAY*noD19XSPihPVj4%+;z_#-Ofh71@!9YOwlc1o2 zfdDpq1dnIjH)}ZNc4*!}zlp#x30@DN2X{f=t&4pfCIR%&&It4ROPQjEF^dSnWffoH-VIT*?rS0He zU?OuyFwXdaV->`)zl_7CV{Mghz^mAbMH1m6>SnH%TwFvgSsyOhglX==Q0QBL$+_gC z3R8j0mP99)d@{);BYdm!6VxSGc2Yl{V;ozSqoR%?|8il%t_)6mRG;mUj3czZp0B|Av!9dCW;^v_eTBUvl9oRB* zQ@Ft((u0i;zLR8@n5{fyMtEb52FiR#>2Q3SGVC1Eg&PY1slnI++PT#BLoPx;j7;H> zAOnZ1v7OKPaF5IVRe1)3GthfsEqcEtbX@R(2bGEi@n!gB|7GXVQH4i>!ddN5uCygi zwsI3#nB0mWWx*$ArPUhksIo$c4}F?|&`JgdUYr@M3ot?lVmXzI)J=F{M-!8sCOnU%O(~uX6|W7-^hPpNJasIfhd2q;b)~Y4x(mHMuX0}o&34jb(Mtz=I8vaK|sv)LFj$Atw zM5mJ<(sa|rPjcS*G1#QO-r4uwEr#ii;xZHbO!GycLx&ag_aS72(3>HohY)XdAmiLQ z1Nw!Ek_T*AP^b?&fYsZE_0QF_`hy>$nq=*5#h?4n#>N3W z{FTGmpo7hSb{}f)jvPOMm_z2iv>C=v=oh)00;HQFbB~P{@HwL$XD%5kMeZAmQXqsa zm+}H&R~-4aFpyD6h415r90<5LT{)|=@PK5G%99Tw8J)C|G%`%fcH>bu_!Y*Zi!UFi zCT{a>HJ!8{MCw4#2Tg~V>PAWe*}3_k+X`M$Y77($oTGbr49MK?!P~IkIO2xIxm2^K zTAA|rmlX@CPRULrvi{+nUESM%l5vI0)7#yK2?GY=Y6otG;bl{Us2FgHMCQ#+cFyiW3U z3T)uXR|OJ~c#Nwks}*~k6l@*{LNy+=?Pva!SpY=;>hTRf&q7KZzjQNk!}IMjri!Bw za*ZbtO3RAzM3fg;@S*etONiRa@Qp80Z3vUWT+GjxQzkpO!7AQyr6OBpKG3$bkdEC! zUdztRD1VNogl9mDR1F3`Nh*z92}^pa2K@%Hh@Jx%E=%FS(S&W>riBAs4ei0ZAoNiE z@W+q|ba1rl!fAkVIM5s<1y@dlVaulA9LkAjU|fl1R^ZxfMTc; z8?}}AD_mCs#}o-&m34dFlW^-^9c{^C9eGv8DqwSP7H=vzd37$LY1Eu?-Vvyd=C4;r z{0b7A!VZ*Zmpe~91C&&h(uY*I7b=OGTKw9n8K^H_PIz0utpSSmRRgI%%uHVwI7g7d z!l}b!3SPLO<2rb$TsM-du$smQ+TcTZ5XELq;Fp`IBTW?4=Y#sgDk+o_yuxD|hF6zD z;o^uy5q0=Dm`Il*?8E~cd}I(&336VL_@WdIAy_0nZ^g2H63i1a$;nj86F)%Ptl{Sl zj0!bB8dLxQ_w5*p@b=G@z@+j*yq1U{q7nr%;x*DcM+sp;_3P1~LQREa7M-Pyi@&nz z&<=1n5ZG_X6<o2o-9GIjje*x&&9iQis|<_b8)yj>oGn*HZB?<(3WI%VH)CzvC;r z7bI1o!OVSuo61b^V#6kt1udXo18o=1!QxuO{24m==Kg3UV!RK8OY!H7>a7=tqaNWZ ziYAc6A2hyaHkik0*-LMOM$G!)jx_+#uv=`jw4mU)FAJfC zpJRovydx|N8voO@!kruYS|L`dl<*7X^$MkN<$XBeyan#xEd8<0KUl5TqwdF^bTkdmdfInU`Y6AxYZ|KB zWl^Xc%I$`xB~iYK#_LgD1YC4!`|(A*PoP|m_xFG$+K*sdH6qfOTeQ!j4by5bp=?EY z2j=8<`mukB@%9v?b{%WqW=L(iPFU!;K(9;4)e6* zXTO#1C#$#wKT>^Pc!@GQv%uqarX~+gPVLJdm9s}Oxf}P-e!Oey=FHUe?BRUZTyCms z|GquyAH#IzCO^LWNM@=tH`jIbTn66YSR)-89>k%iOeYE}uK9&~Dn7 zzxnW<&Z*f0n|m@-Q-i(3!+ZA(XQqaF`?~V`W{z&2M(gDC=AO>J&Yto@ocsL6r)G1R zuDSjDrZQazX7^&mzkk1z^2XWRfyq49y-DI9=IqPMeFqNi&m73iYz>Np;rCnaQe>oldX7*-okzli&y;1I&Jv_4) z)8=o^$o-iaxo=L&J?J7F4n#|LcXv;BZ+BmJfA>K5V0XHEsC&4lyQin8x2LbCzh|Il zuqWL!)HB@M-P_aK+uPUM-#gGd*qiPh>K*Ru?(6C6?d$97?;GeF>`V6z^$quT_xJSo z_V@Mo_Yd?B_NV)Y`iBR)2YLp22l@v32L=WP2hsyW1H*&egFS=2gMEYjg9C$ugXzJc z!Qpgwx+mS6?o0Ql2hxM-bb2T~Jk&kZGt@iOH`G5gFf=%n9vT`N9>x}jvHUQm9tPSl znnHrgq~|7QZpu(XQgMge00(Z$-&}&j(R2C9Tz*bY=0m<@z%2q3AMNby{MfrNJD)2F zW6#linT_P^%xqpx%BhLkKJz)(M(i!jP1A<@ZI-4jN#8b|JoZrI*Zn^9eXo{ zh2vj&@|#b+{L0y%+*Uks`<-{4e&7pVeCXjvpZMle&wT5J7r*z{m!AIP?>_s&i#x8^ zb?rxP*nRswr@s8vuRZlA&wlHb%DPn_z5XBn>Fslc#DPOUcr97cIy2kUy!#Wk{{EMK zQMan4b^MYmc76D|>u&?1{5zj|zH9fo&aMZ)^tGqH_2Mh9 zeR||mr@OjOwVwOZ+vi?5cg3#jJ{oZ>dYa)82HgTo-K4Y^X%u2f=zQt@_o3JmJ2h8l+ z!gJQK$BhR2*sqL_L~7kt(VBQoJZs172K&R#Mr%B_$&8!A=y5lh4Yq3(9z|DcaJjkJ z$U7Gq6~;wr$Jt;XJ6BonbX9IP@Q=eP3U`^uKDFAd{p58<-D=Y-{LJdIwnp@1eYEh% zU_M^>%Z9jBIA;~UYPH2b^K9(TH`X4%+ek+juCFP4-6?#1`+ymtXjVm)TK_;)guW|dW4RioGH4MvmIY_^H4F|9wTzoh>~{N?Ch>aXbE6R%r8*58z8 z&7X*W7V-64FTP^esr&E$oE?b{ZoBxJpPqTitf{}|+CLt6;livk!d!e|+J=haP+4$v;KXuC{s0 z_OTCs@xkwW_kqajhSb_;o;Br~wd>mZhPGUK+2vPWb@esWt%<43jni|td}98NFFf+4 z$Dcmawf%}0(Noc6wnba4jn@0kJM)EYGkCcixb?)QJ_octdK;joFFnAtyH2V8Bo; zOk5Qg3)-d5Rn5Z-k?~lwamkLfk#u6mzIfZGZ#?W4{`8I~k9VDV>DVQo|D$8WkqxFk zu`V_qYqzRzJ2>Wcd6gr2%cuTN^|7D+ZepSJg9~@vZcbYXBO3Ak^F-kvV{^{Ts`0`T z*G8)f_bgmu6h|v+i&t*^!u7h-|TecjY z`8fU^Y5w148J>|& Tf_{90=6Z$qRJMAI-uqtxfELf` literal 0 HcmV?d00001 diff --git a/ethcore/wasm/run/res/sample3.wasm b/ethcore/wasm/run/res/sample3.wasm new file mode 100644 index 0000000000000000000000000000000000000000..1811215b40f3e84c572712a6fbcec5a2830cdf4e GIT binary patch literal 9736 zcmeHMOKe=%c|P|wuRB9tQm+w3N&mf)ZPB7gNtQ{8vTR++vMf>*^`K;L3VJk}$Q<#Z z3`cTQNTyIESvUybO&T_p$*BtAG;=Pr8dhR@+b;|uMD<=WEHYTal`-@;mZwN<;>Sa_$k*lrk? z#c~U`Yb%R&`;cE)YpmR8w2a5BqFVS|tI@E}{R>M=cb6Bguf0>dy|6fO#P}>#vZ?J> z?Y0SeUffu&-@a!YeaCWRd9`)VbsoA8^`$|(c73Vg+{TxB#e(PMT-WpRxg5TDj|uZd zCs?SX;ikXz*X2Uqqz?;GCH!XI&8_?I?s4K^kCQ%hntL5F`&>V9&-f=(FDir*q#u}O z>;R88V-HYm#yJUMp9M{9#7*U#EgXn*%1nC3Lcv00p(?OEYIaW5?6Su8DU-9TI%V?Wq=jbUGGiN!D%(n<%C^v`vduKAY!i(t8>CTX z12n2EvPPrKXn)seU)N}*YqZ=o8g`AAx<-p#qXlcUni57jIJK>qPR$?#-%5RAvF^&h9U9PEl3`}c!!j9RHexBj-VRMNq*9+ra!{lA`B!3o+F!@;|4`iG!YqT*i7)M5u=&P z3X{kO+h?K)6A6Yp%T=bi%A!e|yU$c7OqJ!v%kTW6nT!Q{}$(tP9T%yZzaK; zf6|5p2R-LYfJV?N>Ke&Q5aoyZLrsU{`ivUiEFucQ|Gd;`C(fL|E-t)1al_QSj_eN# zQC}$DhETRx@HPEoxu@~UALF%x1-EPJ(qSsi{ z&^ghl6h0H-gU~y9#UNt&9DmW(+N+Tpo^|{u+f|MczTm+K&VbDb%nnJxcD;QQhnJq~ zPq=0DO(on4i%}6n`QPOUI%N9Zu?bTS!{40nxio}7cE95rv)dT+o@WfG`8j@e0{;zo z75FPA;@`c%m_guIfMwtz{4whrc&>g(`uCAOfb>Ve82Ik5T5IFA8_SC;<74$&>*gwI-dtR3x9+LAo2Y!}`dEE+ z`M{w@y*_dH*s&Yek2UH?55F*eeevevO8dZ(vBP5rweTH0;*G9>BZrP>(%+WC-#X`3 z?$(wTZ%FO>qAaf5UA@&{JKMk&6z=4rg>SFkkhR5|E4B8WR-<0KU8^s)?`<^o$J=rAf`PJL(Vl;?zD}3*m>8P*$g~!yF4-p3K_2DAS{U@hF zmGip=Sg_DoTD@td){|mP6<4LJ&{~b!4Xe630!<5a1)55)9)YIMPYE>DW4!_`_lX3W z@8>U>C1;Rjn*IjYScZq-cOBIMl^cg?P@fi8tprU2q6OgZV(3iRD-Hb zE2keg6mI48hd>WVAr}B4lEAi8R{?-SNoC}C$ ze)_jx{HrhJ5tm*4j|9!T)#n%|EIVQPNE_490+a*@Is_{MO(qwx?2N+s5$H#agQfsn zYM4>uQEiMGpHgPjP>ld`aUUU%SPv+~{e)s%A(Ud69yMV+Kq$w9gi5@L&=+qe^v7EW z5d-6>8Hl$M2IFmnO)+%osM#EECv1taaEzL*@eabac$iQ{zXG<$I|)PaF2as@H(@vy z!p=A*?1~evz?sPPB%#FfB&NReL@4e&fdKXaP`?2H(l-Zy$jghT3yDAjQ_MmDQ^`X8 zQpQ61Qo};`Qous*QoTa#Qo2GlvNCk5FHpUZ2Lj2yR*#fakR(k_hBHNmY=^HO!>KHLSeX=?}Zp zQ0L{7(=gxJmz41GZ2ZMd2Oz~qtRO`PXHpSt%tXgIPgxc{HYoVQtei5Hlwesou&f-` zc6J;9ma~tvGT5~;7~MT($|z9bE+Cf~Ri;M4GNWLb(U0*V!3aRg_rKQnM9xBy*`&+DB>hTNVhTxt@hT@(_hUA_{ z4b8NS@4<_@A==+aW60`xMDO%IGIaOk!g%i^LwQdwLwe7nhW3pYWg-5tBLA;1*CULc z_WkK!o^?6~G}}EZ)7`T&-90Pg?iukl$N1`uIA+pe>%a<=4%ZT}Xwuwix6; zg`<(j)}-#y2z;UY7BD>;L0Wb+0+t<(fOU>W?0Tl307vChN6PgsLl9CY-`Y$j$&Z3>YbM9Yr@-Me$H_78((TRU zCGr#CL(Sx6@>jrjG?SC$Dfn>rWCmc#yGIcPcTACxi6VSkKblJ?Qy5u@hE`DqXDIMrVB$U zWT8Nrh61o`jRgC{bYUp!ixp8f91!)uO`^`XMbz)MiMrf&QE%HJ>S#MfeQcMgdx@xL zC8AEXSJa=L6?LV3qF(g8r~{3P`pyASw;31pm_wq@@`9+JyeR4-lcL^nOw=)si~7V% zqVDjrs3)8hb%Il(^Z!-Rss9?LerML7lh-&XXXRDG897BbEhh=7yi9mSULu^3;{;cZ z5vF94a8zC-Ovnp_BXWpvSjGtlV@3wK5i^oaE!|7KY4=j|QsiE0R!W3R zPoC*>L9(IPtGd{mBQ8iZ0QKa@u6xq{_fCp?rqYo#sXtfYv8l3Ko*9 z53o0!maFrKf#**-53of9%*Pe%gHY<4ZWxm{=5f3*jgl3dTjLZWt=@@U?Ap@*bv}kYXb7o$UzEP8fkioQ2 z-*_^8Uk@^Ja!uZNkX+-^AIf<`QLYe5a+xqMSMQ@?^ZdH$Q_g+#&Ge~vui>QOO?l&f zGB0oP!_dp!kCK^qdgH@pW$u1*A^WiV$&6fJ(`GlCrUhn@vhhim%-TH*o5Mk1g9%nob)6U^1NlNp=;}q1GQCIw%cLY$e|QZoDEp|3Bq-az zU{ndx77v1g^dGR^xWMnN^E4+&^>#H#uk$n~NMGk^PLO^JnYg1#{{w{!Kt$Cd;0H*? zT9y7gl6f0^->zARq!m1U6}f%D?*jXQUjs%!tnLGVZ{u+g`1vWb3GlD5u^EWCy#??$ z$lVIWGQ16dAWId0XUc2`{03!*fWHRru*t&!$bg-IzeCksz||?U8vqfGvCjHNnf8q` zU6z$)%km>`9qmA1F7QxESK{-q^J`{xm*S6|1@>?Y?%kPIu!w%sC+sx%#DlGiorA5p z&cW8z&cW6j_FyYW8KDIie{O`k%(y?maT#um5O~Az_c%hsC-6<2)x!jKjLU<)-GY_x z@iVhea;?}Wm~6aE0`y!f_Q@x_R_y!quN8|Qa;=DqMhyB#UMnIZ{-M{3MP4iBQvx_@ie;wMxV3WctW`h43JjEai$LJ{n)*(z*p4vd64B_$s|3(3zeB<), + Constructor { + #[serde(rename="constructor")] + source: Cow<'static, String>, + arguments: Bytes, + sender: Address, + at: Address, + }, +} + +impl Source { + pub fn as_ref(&self) -> &str { + match *self { + Source::Raw(ref r) => r.as_ref(), + Source::Constructor { ref source, .. } => source.as_ref(), + } + } +} + +#[derive(Deserialize)] +pub struct Fixture { + pub caption: Cow<'static, String>, + pub source: Source, + pub address: Option
, + pub sender: Option
, + pub value: Option, + #[serde(rename="gasLimit")] + pub gas_limit: Option, + pub payload: Option, + pub storage: Option>, + pub asserts: Vec, +} + +#[derive(Deserialize, Debug)] +pub struct StorageEntry { + pub key: Uint, + pub value: Uint, +} + +#[derive(Deserialize, Debug, Clone)] +pub struct CallLocator { + pub sender: Option
, + pub receiver: Option
, + pub value: Option, + pub data: Option, + #[serde(rename="codeAddress")] + pub code_address: Option
, +} + +#[derive(Deserialize, Debug)] +pub struct StorageAssert { + pub key: H256, + pub value: H256, +} + +#[derive(Deserialize, Debug)] +pub enum Assert { + HasCall(CallLocator), + HasStorage(StorageAssert), + UsedGas(u64), + Return(Bytes), +} \ No newline at end of file diff --git a/ethcore/wasm/run/src/main.rs b/ethcore/wasm/run/src/main.rs new file mode 100644 index 00000000000..1cb38cdf9ba --- /dev/null +++ b/ethcore/wasm/run/src/main.rs @@ -0,0 +1,46 @@ +extern crate serde; +extern crate serde_json; +#[macro_use] extern crate serde_derive; +extern crate ethcore_bigint; +extern crate ethjson; +extern crate wasm; +extern crate vm; +extern crate clap; +extern crate ethcore_logger; +extern crate rustc_hex; + +mod fixture; +mod runner; + +use fixture::Fixture; +use clap::{App, Arg}; +use std::fs; + +fn main() { + ::ethcore_logger::init_log(); + + let matches = App::new("pwasm-run-test") + .arg(Arg::with_name("target") + .index(1) + .required(true) + .multiple(true) + .help("JSON fixture")) + .get_matches(); + + let mut exit_code = 0; + + for target in matches.values_of("target").expect("No target parameter") { + let mut f = fs::File::open(target).expect("Failed to open file"); + let fixtures: Vec = serde_json::from_reader(&mut f).expect("Failed to deserialize json"); + + for fixture in fixtures.into_iter() { + let fails = runner::run_fixture(&fixture); + for fail in fails.iter() { + exit_code = 1; + println!("Failed assert in test \"{}\" ('{}'): {}", fixture.caption.as_ref(), target, fail); + } + } + } + + std::process::exit(exit_code); +} \ No newline at end of file diff --git a/ethcore/wasm/run/src/runner.rs b/ethcore/wasm/run/src/runner.rs new file mode 100644 index 00000000000..06a6b046906 --- /dev/null +++ b/ethcore/wasm/run/src/runner.rs @@ -0,0 +1,261 @@ +use fixture::{Fixture, Assert, CallLocator, Source}; +use wasm::WasmInterpreter; +use vm::{self, Vm, GasLeft, ActionParams, ActionValue, ParamsType}; +use vm::tests::FakeExt; +use std::io::{self, Read}; +use std::{fs, path, fmt}; +use std::sync::Arc; +use ethcore_bigint::prelude::{U256, H256, H160}; +use rustc_hex::ToHex; + +fn load_code>(p: P) -> io::Result> { + let mut result = Vec::new(); + let mut f = fs::File::open(p)?; + f.read_to_end(&mut result)?; + Ok(result) +} + +fn wasm_interpreter() -> WasmInterpreter { + WasmInterpreter::new().expect("wasm interpreter to create without errors") +} + +#[derive(Debug)] +pub enum SpecNonconformity { + Address, +} + +#[derive(Debug)] +pub enum Fail { + Return { expected: Vec, actual: Vec }, + UsedGas { expected: u64, actual: u64 }, + Runtime(String), + Load(io::Error), + NoCall(CallLocator), + StorageMismatch { key: H256, expected: H256, actual: Option }, + Nonconformity(SpecNonconformity) +} + +impl Fail { + fn runtime(err: vm::Error) -> Vec { + vec![Fail::Runtime(format!("{}", err))] + } + + fn load(err: io::Error) -> Vec { + vec![Fail::Load(err)] + } + + fn nononformity(kind: SpecNonconformity) -> Vec { + vec![Fail::Nonconformity(kind)] + } +} + +impl fmt::Display for Fail { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use self::Fail::*; + match *self { + Return { ref expected, ref actual } => + write!( + f, + "Expected to return result: 0x{} ({} bytes), but got 0x{} ({} bytes)", + expected.to_hex(), + expected.len(), + actual.to_hex(), + actual.len() + ), + + UsedGas { expected, actual } => + write!(f, "Expected to use gas: {}, but got actual gas used: {}", expected, actual), + + Runtime(ref s) => + write!(f, "WASM Runtime error: {}", s), + + Load(ref e) => + write!(f, "Load i/o error: {}", e), + + NoCall(ref call) => + write!(f, "Call not found: {:?}", call), + + StorageMismatch { ref key, ref expected, actual: Some(ref actual)} => + write!( + f, + "Storage key {} value mismatch, expected {}, got: {}", + key.as_ref().to_vec().to_hex(), + expected.as_ref().to_vec().to_hex(), + actual.as_ref().to_vec().to_hex(), + ), + + StorageMismatch { ref key, ref expected, actual: None} => + write!( + f, + "No expected storage value for key {} found, expected {}", + key.as_ref().to_vec().to_hex(), + expected.as_ref().to_vec().to_hex(), + ), + + Nonconformity(SpecNonconformity::Address) => + write!(f, "Cannot use address when constructor is specified!"), + } + } +} + +pub fn construct( + ext: &mut vm::Ext, + source: Vec, + arguments: Vec, + sender: H160, + at: H160, +) -> Result, vm::Error> { + + let mut params = ActionParams::default(); + params.sender = sender; + params.address = at; + params.gas = U256::from(100_000_000); + params.data = Some(arguments); + params.code = Some(Arc::new(source)); + params.params_type = ParamsType::Separate; + + Ok( + match wasm_interpreter().exec(params, ext)? { + GasLeft::Known(_) => Vec::new(), + GasLeft::NeedsReturn { data, .. } => data.to_vec(), + } + ) +} + +pub fn run_fixture(fixture: &Fixture) -> Vec { + let mut params = ActionParams::default(); + + let source = match load_code(fixture.source.as_ref()) { + Ok(code) => code, + Err(e) => { return Fail::load(e); }, + }; + + let mut ext = FakeExt::new(); + params.code = Some(Arc::new( + if let Source::Constructor { ref arguments, ref sender, ref at, .. } = fixture.source { + match construct(&mut ext, source, arguments.clone().into(), sender.clone().into(), at.clone().into()) { + Ok(code) => code, + Err(e) => { return Fail::runtime(e); } + } + } else { + source + } + )); + + if let Some(ref sender) = fixture.sender { + params.sender = sender.clone().into(); + } + + if let Some(ref address) = fixture.address { + if let Source::Constructor { .. } = fixture.source { + return Fail::nononformity(SpecNonconformity::Address); + } + + params.address = address.clone().into(); + } else if let Source::Constructor { ref at, .. } = fixture.source { + params.address = at.clone().into(); + } + + if let Some(gas_limit) = fixture.gas_limit { + params.gas = U256::from(gas_limit); + } + + if let Some(ref data) = fixture.payload { + params.data = Some(data.clone().into()) + } + + if let Some(value) = fixture.value { + params.value = ActionValue::Transfer(value.clone().into()) + } + + if let Some(ref storage) = fixture.storage { + for storage_entry in storage.iter() { + let key: U256 = storage_entry.key.into(); + let val: U256 = storage_entry.value.into(); + ext.store.insert(key.into(), val.into()); + } + } + + let mut interpreter = wasm_interpreter(); + + let interpreter_return = match interpreter.exec(params, &mut ext) { + Ok(ret) => ret, + Err(e) => { return Fail::runtime(e); } + }; + let (gas_left, result) = match interpreter_return { + GasLeft::Known(gas) => { (gas, Vec::new()) }, + GasLeft::NeedsReturn { gas_left: gas, data: result, apply_state: _apply } => (gas, result.to_vec()), + }; + + let mut fails = Vec::new(); + + for assert in fixture.asserts.iter() { + match *assert { + Assert::Return(ref data) => { + if &data[..] != &result[..] { + fails.push(Fail::Return { expected: (&data[..]).to_vec(), actual: (&result[..]).to_vec() }) + } + }, + Assert::UsedGas(gas) => { + let used_gas = fixture.gas_limit.unwrap_or(0) - gas_left.low_u64(); + if gas != used_gas { + fails.push(Fail::UsedGas { expected: gas, actual: used_gas }); + } + }, + Assert::HasCall(ref locator) => { + let mut found = false; + + for fake_call in ext.calls.iter() { + let mut match_ = true; + if let Some(ref data) = locator.data { + if data.as_ref() != &fake_call.data[..] { match_ = false; } + } + + if let Some(ref code_addr) = locator.code_address { + if fake_call.code_address.unwrap_or(H160::zero()) != code_addr.clone().into() { match_ = false } + } + + if let Some(ref sender) = locator.sender { + if fake_call.sender_address.unwrap_or(H160::zero()) != sender.clone().into() { match_ = false } + } + + if let Some(ref receiver) = locator.receiver { + if fake_call.receive_address.unwrap_or(H160::zero()) != receiver.clone().into() { match_ = false } + } + + if match_ { + found = true; + break; + } + } + + if !found { + fails.push(Fail::NoCall(locator.clone())) + } + }, + Assert::HasStorage(ref storage_entry) => { + let expected_storage_key: H256 = storage_entry.key.clone().into(); + let expected_storage_value: H256 = storage_entry.value.clone().into(); + let val = ext.store.get(&expected_storage_key); + + if let Some(val) = val { + if val != &expected_storage_value { + fails.push(Fail::StorageMismatch { + key: expected_storage_key, + expected: expected_storage_value, + actual: Some(val.clone()) + }) + } + } else { + fails.push(Fail::StorageMismatch { + key: expected_storage_key, + expected: expected_storage_value, + actual: None, + }) + } + + }, + } + } + fails +} \ No newline at end of file diff --git a/ethcore/wasm/src/env.rs b/ethcore/wasm/src/env.rs index 1a2f5fd3bf1..ed4bda68b21 100644 --- a/ethcore/wasm/src/env.rs +++ b/ethcore/wasm/src/env.rs @@ -25,12 +25,12 @@ pub const SIGNATURES: &'static [UserFunctionDescriptor] = &[ Static( "_storage_read", &[I32; 2], - Some(I32), + None, ), Static( "_storage_write", &[I32; 2], - Some(I32), + None, ), Static( "_balance", @@ -115,7 +115,7 @@ pub const SIGNATURES: &'static [UserFunctionDescriptor] = &[ Static( "_blockhash", &[I64, I32], - Some(I32), + None, ), Static( "_coinbase", diff --git a/ethcore/wasm/src/lib.rs b/ethcore/wasm/src/lib.rs index 70601144d03..30ce03665d5 100644 --- a/ethcore/wasm/src/lib.rs +++ b/ethcore/wasm/src/lib.rs @@ -31,6 +31,7 @@ mod result; #[cfg(test)] mod tests; mod env; +mod panic_payload; const DEFAULT_STACK_SPACE: u32 = 5 * 1024 * 1024; diff --git a/ethcore/wasm/src/panic_payload.rs b/ethcore/wasm/src/panic_payload.rs new file mode 100644 index 00000000000..dc95f53fbfc --- /dev/null +++ b/ethcore/wasm/src/panic_payload.rs @@ -0,0 +1,168 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +use byteorder::{LittleEndian, ReadBytesExt}; +use std::io::{self, Read}; + +#[derive(Debug, PartialEq, Eq)] +pub struct PanicPayload { + pub msg: Option, + pub file: Option, + pub line: Option, + pub col: Option, +} + +fn read_string(rdr: &mut io::Cursor<&[u8]>) -> io::Result> { + let string_len = rdr.read_u32::()?; + let string = if string_len == 0 { + None + } else { + let mut content = vec![0; string_len as usize]; + rdr.read_exact(&mut content)?; + Some(String::from_utf8_lossy(&content).into_owned()) + }; + Ok(string) +} + +pub fn decode(raw: &[u8]) -> PanicPayload { + let mut rdr = io::Cursor::new(raw); + let msg = read_string(&mut rdr).ok().and_then(|x| x); + let file = read_string(&mut rdr).ok().and_then(|x| x); + let line = rdr.read_u32::().ok(); + let col = rdr.read_u32::().ok(); + PanicPayload { + msg: msg, + file: file, + line: line, + col: col, + } +} + +#[cfg(test)] +mod tests { + use super::*; + use byteorder::WriteBytesExt; + + fn write_u32(payload: &mut Vec, val: u32) { + payload.write_u32::(val).unwrap(); + } + + fn write_bytes(payload: &mut Vec, bytes: &[u8]) { + write_u32(payload, bytes.len() as u32); + payload.extend(bytes); + } + + #[test] + fn it_works() { + let mut raw = Vec::new(); + write_bytes(&mut raw, b"msg"); + write_bytes(&mut raw, b"file"); + write_u32(&mut raw, 1); + write_u32(&mut raw, 2); + + let payload = decode(&raw); + + assert_eq!( + payload, + PanicPayload { + msg: Some("msg".to_string()), + file: Some("file".to_string()), + line: Some(1), + col: Some(2), + } + ); + } + + #[test] + fn only_msg() { + let mut raw = Vec::new(); + write_bytes(&mut raw, b"msg"); + + let payload = decode(&raw); + + assert_eq!( + payload, + PanicPayload { + msg: Some("msg".to_string()), + file: None, + line: None, + col: None, + } + ); + } + + #[test] + fn invalid_utf8() { + let mut raw = Vec::new(); + write_bytes(&mut raw, b"\xF0\x90\x80msg"); + write_bytes(&mut raw, b"file"); + write_u32(&mut raw, 1); + write_u32(&mut raw, 2); + + let payload = decode(&raw); + + assert_eq!( + payload, + PanicPayload { + msg: Some("�msg".to_string()), + file: Some("file".to_string()), + line: Some(1), + col: Some(2), + } + ); + } + + #[test] + fn trailing_data() { + let mut raw = Vec::new(); + write_bytes(&mut raw, b"msg"); + write_bytes(&mut raw, b"file"); + write_u32(&mut raw, 1); + write_u32(&mut raw, 2); + write_u32(&mut raw, 0xdeadbeef); + + let payload = decode(&raw); + + assert_eq!( + payload, + PanicPayload { + msg: Some("msg".to_string()), + file: Some("file".to_string()), + line: Some(1), + col: Some(2), + } + ); + } + + #[test] + fn empty_str_is_none() { + let mut raw = Vec::new(); + write_bytes(&mut raw, b"msg"); + write_bytes(&mut raw, b""); + + let payload = decode(&raw); + + assert_eq!( + payload, + PanicPayload { + msg: Some("msg".to_string()), + file: None, + line: None, + col: None, + } + ); + } +} diff --git a/ethcore/wasm/src/runtime.rs b/ethcore/wasm/src/runtime.rs index e5a6dc910be..bad325fbf98 100644 --- a/ethcore/wasm/src/runtime.rs +++ b/ethcore/wasm/src/runtime.rs @@ -21,6 +21,7 @@ use std::sync::Arc; use byteorder::{LittleEndian, ByteOrder}; use vm; +use panic_payload; use parity_wasm::interpreter; use wasm_utils::rules; use bigint::prelude::U256; @@ -167,7 +168,7 @@ impl<'a, 'b> Runtime<'a, 'b> { self.ext.set_storage(key, val).map_err(|_| UserTrap::StorageUpdateError)?; - Ok(Some(0i32.into())) + Ok(None) } /// Read from the storage to wasm memory @@ -183,7 +184,7 @@ impl<'a, 'b> Runtime<'a, 'b> { self.memory.set(val_ptr as u32, &*val)?; - Ok(Some(0.into())) + Ok(None) } /// Fetches balance for address @@ -626,12 +627,26 @@ impl<'a, 'b> Runtime<'a, 'b> { fn user_panic(&mut self, context: InterpreterCallerContext) -> Result, InterpreterError> { - let msg_len = context.value_stack.pop_as::()? as u32; - let msg_ptr = context.value_stack.pop_as::()? as u32; - - let msg = String::from_utf8(self.memory.get(msg_ptr, msg_len as usize)?) - .map_err(|_| UserTrap::BadUtf8)?; - + let payload_len = context.value_stack.pop_as::()? as u32; + let payload_ptr = context.value_stack.pop_as::()? as u32; + + let raw_payload = self.memory.get(payload_ptr, payload_len as usize)?; + let payload = panic_payload::decode(&raw_payload); + let msg = format!( + "{msg}, {file}:{line}:{col}", + msg = payload + .msg + .as_ref() + .map(String::as_ref) + .unwrap_or(""), + file = payload + .file + .as_ref() + .map(String::as_ref) + .unwrap_or(""), + line = payload.line.unwrap_or(0), + col = payload.col.unwrap_or(0) + ); trace!(target: "wasm", "Contract custom panic message: {}", msg); Err(UserTrap::Panic(msg).into()) @@ -650,7 +665,7 @@ impl<'a, 'b> Runtime<'a, 'b> { self.memory.set(return_ptr, &*hash)?; - Ok(Some(0i32.into())) + Ok(None) } fn return_address_ptr(&mut self, ptr: u32, val: Address) -> Result<(), InterpreterError> diff --git a/ethcore/wasm/src/tests.rs b/ethcore/wasm/src/tests.rs index 0a93be11cd8..a387f929266 100644 --- a/ethcore/wasm/src/tests.rs +++ b/ethcore/wasm/src/tests.rs @@ -112,7 +112,7 @@ fn logger() { U256::from(1_000_000_000), "Logger sets 0x04 key to the trasferred value" ); - assert_eq!(gas_left, U256::from(19_143)); + assert_eq!(gas_left, U256::from(19_147)); } // This test checks if the contract can allocate memory and pass pointer to the result stream properly. @@ -180,7 +180,7 @@ fn dispersion() { result, vec![0u8, 0, 125, 11, 197, 7, 255, 8, 19, 0] ); - assert_eq!(gas_left, U256::from(99_469)); + assert_eq!(gas_left, U256::from(96_393)); } #[test] @@ -208,7 +208,7 @@ fn suicide_not() { result, vec![0u8] ); - assert_eq!(gas_left, U256::from(99_724)); + assert_eq!(gas_left, U256::from(96_725)); } #[test] @@ -240,7 +240,7 @@ fn suicide() { }; assert!(ext.suicides.contains(&refund)); - assert_eq!(gas_left, U256::from(99_663)); + assert_eq!(gas_left, U256::from(96_687)); } #[test] @@ -270,7 +270,7 @@ fn create() { assert!(ext.calls.contains( &FakeCall { call_type: FakeCallType::Create, - gas: U256::from(65_903), + gas: U256::from(65_899), sender_address: None, receive_address: None, value: Some(1_000_000_000.into()), @@ -278,7 +278,7 @@ fn create() { code_address: None, } )); - assert_eq!(gas_left, U256::from(65_896)); + assert_eq!(gas_left, U256::from(65_892)); } @@ -312,7 +312,7 @@ fn call_code() { assert!(ext.calls.contains( &FakeCall { call_type: FakeCallType::Call, - gas: U256::from(98_709), + gas: U256::from(98_713), sender_address: Some(sender), receive_address: Some(receiver), value: None, @@ -324,7 +324,7 @@ fn call_code() { // siphash result let res = LittleEndian::read_u32(&result[..]); assert_eq!(res, 4198595614); - assert_eq!(gas_left, U256::from(93_851)); + assert_eq!(gas_left, U256::from(93_855)); } #[test] @@ -357,7 +357,7 @@ fn call_static() { assert!(ext.calls.contains( &FakeCall { call_type: FakeCallType::Call, - gas: U256::from(98_709), + gas: U256::from(98_713), sender_address: Some(sender), receive_address: Some(receiver), value: None, @@ -370,7 +370,7 @@ fn call_static() { let res = LittleEndian::read_u32(&result[..]); assert_eq!(res, 317632590); - assert_eq!(gas_left, U256::from(93_851)); + assert_eq!(gas_left, U256::from(93_855)); } // Realloc test @@ -393,7 +393,7 @@ fn realloc() { } }; assert_eq!(result, vec![0u8; 2]); - assert_eq!(gas_left, U256::from(99_787)); + assert_eq!(gas_left, U256::from(96_723)); } // Tests that contract's ability to read from a storage @@ -419,7 +419,7 @@ fn storage_read() { }; assert_eq!(Address::from(&result[12..32]), address); - assert_eq!(gas_left, U256::from(99_702)); + assert_eq!(gas_left, U256::from(99_767)); } // Tests keccak calculation @@ -445,7 +445,7 @@ fn keccak() { }; assert_eq!(H256::from_slice(&result), H256::from("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87")); - assert_eq!(gas_left, U256::from(84_520)); + assert_eq!(gas_left, U256::from(81_446)); } // memcpy test. @@ -477,7 +477,7 @@ fn memcpy() { }; assert_eq!(result, test_payload); - assert_eq!(gas_left, U256::from(75_324)); + assert_eq!(gas_left, U256::from(72_216)); } // memmove test. @@ -509,7 +509,7 @@ fn memmove() { }; assert_eq!(result, test_payload); - assert_eq!(gas_left, U256::from(75_324)); + assert_eq!(gas_left, U256::from(72_216)); } // memset test @@ -534,7 +534,7 @@ fn memset() { }; assert_eq!(result, vec![228u8; 8192]); - assert_eq!(gas_left, U256::from(75_324)); + assert_eq!(gas_left, U256::from(72_196)); } macro_rules! reqrep_test { @@ -591,7 +591,7 @@ fn math_add() { U256::from_dec_str("1888888888888888888888888888887").unwrap(), (&result[..]).into() ); - assert_eq!(gas_left, U256::from(98_576)); + assert_eq!(gas_left, U256::from(95_524)); } // multiplication @@ -613,7 +613,7 @@ fn math_mul() { U256::from_dec_str("888888888888888888888888888887111111111111111111111111111112").unwrap(), (&result[..]).into() ); - assert_eq!(gas_left, U256::from(97_726)); + assert_eq!(gas_left, U256::from(94_674)); } // subtraction @@ -635,7 +635,7 @@ fn math_sub() { U256::from_dec_str("111111111111111111111111111111").unwrap(), (&result[..]).into() ); - assert_eq!(gas_left, U256::from(98_568)); + assert_eq!(gas_left, U256::from(95_516)); } // subtraction with overflow @@ -677,7 +677,7 @@ fn math_div() { U256::from_dec_str("1125000").unwrap(), (&result[..]).into() ); - assert_eq!(gas_left, U256::from(91_564)); + assert_eq!(gas_left, U256::from(88_514)); } // This test checks the ability of wasm contract to invoke @@ -765,7 +765,7 @@ fn externs() { "Gas limit requested and returned does not match" ); - assert_eq!(gas_left, U256::from(97_740)); + assert_eq!(gas_left, U256::from(94_858)); } #[test] @@ -791,7 +791,7 @@ fn embedded_keccak() { }; assert_eq!(H256::from_slice(&result), H256::from("68371d7e884c168ae2022c82bd837d51837718a7f7dfb7aa3f753074a35e1d87")); - assert_eq!(gas_left, U256::from(84_520)); + assert_eq!(gas_left, U256::from(81_446)); } /// This test checks the correctness of log extern @@ -826,5 +826,5 @@ fn events() { assert_eq!(&log_entry.data, b"gnihtemos"); assert_eq!(&result, b"gnihtemos"); - assert_eq!(gas_left, U256::from(82_721)); + assert_eq!(gas_left, U256::from(79_637)); } diff --git a/ethkey/Cargo.toml b/ethkey/Cargo.toml index 519accadfe1..7307fe0e9f5 100644 --- a/ethkey/Cargo.toml +++ b/ethkey/Cargo.toml @@ -1,14 +1,17 @@ [package] name = "ethkey" -version = "0.2.0" +version = "0.3.0" authors = ["Parity Technologies "] [dependencies] -rand = "0.3.14" -lazy_static = "0.2" -tiny-keccak = "1.3" +byteorder = "1.0" +edit-distance = "2.0" eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" } -rustc-hex = "1.0" ethcore-bigint = { path = "../util/bigint" } +lazy_static = "0.2" +log = "0.3" +parity-wordlist = "1.2" +rand = "0.3.14" rust-crypto = "0.2" -byteorder = "1.0" +rustc-hex = "1.0" +tiny-keccak = "1.3" diff --git a/ethkey/README.md b/ethkey/README.md index 3886338ea83..12161b3770d 100644 --- a/ethkey/README.md +++ b/ethkey/README.md @@ -16,13 +16,13 @@ Ethereum keys generator. Copyright 2016, 2017 Parity Technologies (UK) Ltd Usage: - ethkey info [options] + ethkey info [options] ethkey generate random [options] - ethkey generate prefix [options] - ethkey generate brain [options] + ethkey generate prefix [options] ethkey sign ethkey verify public ethkey verify address
+ ethkey recover
ethkey [-h | --help] Options: @@ -30,15 +30,15 @@ Options: -s, --secret Display only the secret. -p, --public Display only the public. -a, --address Display only the address. + -b, --brain Use parity brain wallet algorithm. Commands: info Display public and address of the secret. - generate Generates new ethereum key. - random Random generation. - prefix Random generation, but address must start with a prefix - brain Generate new key from string seed. + generate random Generates new random ethereum key. + generate prefix Random generation, but address must start with a prefix. sign Sign message using secret. verify Verify signer of the signature. + recover Try to find brain phrase matching given address from partial phrase. ``` ### Examples @@ -60,20 +60,22 @@ address: 26d1ec50b4e62c1d1a40d16e7cacc6a6580757d5 -- -#### `generate brain ` -*Generate new brain-wallet keypair using 16384 iterations.* -- `` - brain-wallet seed, any string +#### `info --brain ` +*Display info about private key generate from brain wallet recovery phrase.* +- `` - Parity recovery phrase, 12 words ``` -ethkey generate brain "this is sparta" +ethkey info --brain "this is sparta" ``` ``` -secret: 17d08f5fe8c77af811caa0c9a187e668ce3b74a99acc3f6d976f075fa8e0be55 -public: 689268c0ff57a20cd299fa60d3fb374862aff565b20b5f1767906a99e6e09f3ff04ca2b2a5cd22f62941db103c0356df1a8ed20ce322cab2483db67685afd124 -address: 26d1ec50b4e62c1d1a40d16e7cacc6a6580757d5 +The recover phrase was not generated by Parity: The word 'this' does not come from the dictionary. + +secret: aa22b54c0cb43ee30a014afe5ef3664b1cde299feabca46cd3167a85a57c39f2 +public: c4c5398da6843632c123f543d714d2d2277716c11ff612b2a2f23c6bda4d6f0327c31cd58c55a9572c3cc141dade0c32747a13b7ef34c241b26c84adbb28fcf4 +address: 006e27b6a72e1f34c626762f3c4761547aff1421 ``` -- @@ -93,14 +95,30 @@ address: a8fa5dd30a87bb9e3288d604eb74949c515ab66e -- -#### `generate prefix ` +#### `generate random --brain` +*Generate new keypair with recovery phrase randomly.* + +``` +ethkey generate random --brain +``` + +``` +recovery phrase: thwarting scandal creamer nuzzle asparagus blast crouch trusting anytime elixir frenzied octagon +secret: 001ce488d50d2f7579dc190c4655f32918d505cee3de63bddc7101bc91c0c2f0 +public: 4e19a5fdae82596e1485c69b687c9cc52b5078e5b0668ef3ce8543cd90e712cb00df822489bc1f1dcb3623538a54476c7b3def44e1a51dc174e86448b63f42d0 +address: 00cf3711cbd3a1512570639280758118ba0b2bcb +``` + + +-- + +#### `generate prefix ` *Generate new keypair randomly with address starting with prefix.* - `` - desired address prefix, 0 - 32 bytes long. -- `` - maximum number of tries before generation is assumed to be a failure. ``` -ethkey generate prefix ff 1000 +ethkey generate prefix ff ``` ``` @@ -111,6 +129,24 @@ address: fff7e25dff2aa60f61f9d98130c8646a01f31649 -- +#### `generate prefix --brain ` +*Generate new keypair with recovery phrase randomly with address starting with prefix.* + +- `` - desired address prefix, 0 - 32 bytes long. + +``` +ethkey generate prefix --brain 00cf +``` + +``` +recovery phrase: thwarting scandal creamer nuzzle asparagus blast crouch trusting anytime elixir frenzied octagon +secret: 001ce488d50d2f7579dc190c4655f32918d505cee3de63bddc7101bc91c0c2f0 +public: 4e19a5fdae82596e1485c69b687c9cc52b5078e5b0668ef3ce8543cd90e712cb00df822489bc1f1dcb3623538a54476c7b3def44e1a51dc174e86448b63f42d0 +address: 00cf3711cbd3a1512570639280758118ba0b2bcb +``` + +-- + #### `sign ` *Sign a message with a secret.* @@ -159,9 +195,32 @@ ethkey verify address 689268c0ff57a20cd299fa60d3fb374862aff565b20b5f1767906a99e6 true ``` +-- + +#### `recover
` +*Try to recover an account given expected address and partial (too short or with invalid words) recovery phrase.* + +- `
` - ethereum address, 20 bytes long +- `` - known phrase, can be in a form of `thwarting * creamer` + +``` +RUST_LOG="info" ethkey recover "00cf3711cbd3a1512570639280758118ba0b2bcb" "thwarting scandal creamer nuzzle asparagus blast crouch trusting anytime elixir frenzied octag" +``` + +``` +INFO:ethkey::brain_recover: Invalid word 'octag', looking for potential substitutions. +INFO:ethkey::brain_recover: Closest words: ["ocean", "octagon", "octane", "outage", "tag", "acting", "acts", "aorta", "cage", "chug"] +INFO:ethkey::brain_recover: Starting to test 7776 possible combinations. + +thwarting scandal creamer nuzzle asparagus blast crouch trusting anytime elixir frenzied octagon +secret: 001ce488d50d2f7579dc190c4655f32918d505cee3de63bddc7101bc91c0c2f0 +public: 4e19a5fdae82596e1485c69b687c9cc52b5078e5b0668ef3ce8543cd90e712cb00df822489bc1f1dcb3623538a54476c7b3def44e1a51dc174e86448b63f42d0 +address: 00cf3711cbd3a1512570639280758118ba0b2bcb +``` + -# Ethcore toolchain -*this project is a part of the ethcore toolchain* +# Parity toolchain +*this project is a part of the parity toolchain* - [**ethkey**](https://github.com/paritytech/ethkey) - Ethereum keys generator and signer. - [**ethstore**](https://github.com/paritytech/ethstore) - Ethereum key management. diff --git a/ethkey/cli/Cargo.toml b/ethkey/cli/Cargo.toml index 6921af745f4..67c784f0848 100644 --- a/ethkey/cli/Cargo.toml +++ b/ethkey/cli/Cargo.toml @@ -4,12 +4,15 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] +docopt = "0.8" +env_logger = "0.4" ethkey = { path = "../" } +panic_hook = { path = "../../panic_hook" } +parity-wordlist="1.2" +rustc-hex = "1.0" serde = "1.0" serde_derive = "1.0" -rustc-hex = "1.0" -docopt = "0.8" -panic_hook = { path = "../../panic_hook" } +threadpool = "1.7" [[bin]] name = "ethkey" diff --git a/ethkey/cli/src/main.rs b/ethkey/cli/src/main.rs index e60b4583aeb..1c9b748a926 100644 --- a/ethkey/cli/src/main.rs +++ b/ethkey/cli/src/main.rs @@ -15,32 +15,36 @@ // along with Parity. If not, see . extern crate docopt; +extern crate env_logger; +extern crate ethkey; +extern crate panic_hook; +extern crate parity_wordlist; extern crate rustc_hex; extern crate serde; +extern crate threadpool; + #[macro_use] extern crate serde_derive; -extern crate ethkey; -extern crate panic_hook; -use std::{env, fmt, process}; use std::num::ParseIntError; +use std::{env, fmt, process, io, sync}; + use docopt::Docopt; +use ethkey::{KeyPair, Random, Brain, BrainPrefix, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address, brain_recover}; use rustc_hex::{ToHex, FromHex, FromHexError}; -use ethkey::{KeyPair, Random, Brain, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address}; -use std::io; pub const USAGE: &'static str = r#" Ethereum keys generator. Copyright 2016, 2017 Parity Technologies (UK) Ltd Usage: - ethkey info [options] + ethkey info [options] ethkey generate random [options] - ethkey generate prefix [options] - ethkey generate brain [options] + ethkey generate prefix [options] ethkey sign ethkey verify public ethkey verify address
+ ethkey recover
ethkey [-h | --help] Options: @@ -48,15 +52,15 @@ Options: -s, --secret Display only the secret. -p, --public Display only the public. -a, --address Display only the address. + -b, --brain Use parity brain wallet algorithm. Commands: info Display public and address of the secret. - generate Generates new ethereum key. - random Random generation. - prefix Random generation, but address must start with a prefix - brain Generate new key from string seed. + generate random Generates new random ethereum key. + generate prefix Random generation, but address must start with a prefix. sign Sign message using secret. verify Verify signer of the signature. + recover Try to find brain phrase matching given address from partial phrase. "#; #[derive(Debug, Deserialize)] @@ -65,15 +69,15 @@ struct Args { cmd_generate: bool, cmd_random: bool, cmd_prefix: bool, - cmd_brain: bool, cmd_sign: bool, cmd_verify: bool, cmd_public: bool, cmd_address: bool, + cmd_recover: bool, arg_prefix: String, - arg_iterations: String, - arg_seed: String, arg_secret: String, + arg_secret_or_phrase: String, + arg_known_phrase: String, arg_message: String, arg_public: String, arg_address: String, @@ -81,6 +85,7 @@ struct Args { flag_secret: bool, flag_public: bool, flag_address: bool, + flag_brain: bool, } #[derive(Debug)] @@ -157,6 +162,7 @@ impl DisplayMode { fn main() { panic_hook::set(); + env_logger::init().expect("Logger initialized only once."); match execute(env::args()) { Ok(ok) => println!("{}", ok), @@ -167,9 +173,13 @@ fn main() { } } -fn display(keypair: KeyPair, mode: DisplayMode) -> String { +fn display(result: (KeyPair, Option), mode: DisplayMode) -> String { + let keypair = result.0; match mode { - DisplayMode::KeyPair => format!("{}", keypair), + DisplayMode::KeyPair => match result.1 { + Some(extra_data) => format!("{}\n{}", extra_data, keypair), + None => format!("{}", keypair) + }, DisplayMode::Secret => format!("{}", keypair.secret().to_hex()), DisplayMode::Public => format!("{:?}", keypair.public()), DisplayMode::Address => format!("{:?}", keypair.address()), @@ -182,23 +192,53 @@ fn execute(command: I) -> Result where I: IntoIterator(command: I) -> Result where I: IntoIterator= 1024 { + return Ok(None) + } + } + + Err(EthkeyError::Custom("Couldn't find any results.".into())) + } + })?; + Ok(display((keypair, Some(phrase)), display_mode)) } else { - unreachable!(); + Ok(format!("{}", USAGE)) } } +const BRAIN_WORDS: usize = 12; + +fn validate_phrase(phrase: &str) -> String { + match Brain::validate_phrase(phrase, BRAIN_WORDS) { + Ok(()) => format!("The recovery phrase looks correct.\n"), + Err(err) => format!("The recover phrase was not generated by Parity: {}", err) + } +} + +fn in_threads(prepare: F) -> Result where + O: Send + 'static, + X: Send + 'static, + F: Fn() -> X, + X: FnMut() -> Result, EthkeyError>, +{ + let pool = threadpool::Builder::new().build(); + + let (tx, rx) = sync::mpsc::sync_channel(1); + let is_done = sync::Arc::new(sync::atomic::AtomicBool::default()); + + for _ in 0..pool.max_count() { + let is_done = is_done.clone(); + let tx = tx.clone(); + let mut task = prepare(); + pool.execute(move || { + loop { + if is_done.load(sync::atomic::Ordering::SeqCst) { + return; + } + + let res = match task() { + Ok(None) => continue, + Ok(Some(v)) => Ok(v), + Err(err) => Err(err), + }; + + // We are interested only in the first response. + let _ = tx.send(res); + } + }); + } + + if let Ok(solution) = rx.recv() { + is_done.store(true, sync::atomic::Ordering::SeqCst); + return solution; + } + + Err(EthkeyError::Custom("No results found.".into())) +} + #[cfg(test)] mod tests { use super::execute; @@ -242,13 +357,15 @@ address: 26d1ec50b4e62c1d1a40d16e7cacc6a6580757d5".to_owned(); #[test] fn brain() { - let command = vec!["ethkey", "generate", "brain", "this is sparta"] + let command = vec!["ethkey", "info", "--brain", "this is sparta"] .into_iter() .map(Into::into) .collect::>(); let expected = -"secret: aa22b54c0cb43ee30a014afe5ef3664b1cde299feabca46cd3167a85a57c39f2 +"The recover phrase was not generated by Parity: The word 'this' does not come from the dictionary. + +secret: aa22b54c0cb43ee30a014afe5ef3664b1cde299feabca46cd3167a85a57c39f2 public: c4c5398da6843632c123f543d714d2d2277716c11ff612b2a2f23c6bda4d6f0327c31cd58c55a9572c3cc141dade0c32747a13b7ef34c241b26c84adbb28fcf4 address: 006e27b6a72e1f34c626762f3c4761547aff1421".to_owned(); assert_eq!(execute(command).unwrap(), expected); @@ -256,7 +373,7 @@ address: 006e27b6a72e1f34c626762f3c4761547aff1421".to_owned(); #[test] fn secret() { - let command = vec!["ethkey", "generate", "brain", "this is sparta", "--secret"] + let command = vec!["ethkey", "info", "--brain", "this is sparta", "--secret"] .into_iter() .map(Into::into) .collect::>(); @@ -267,7 +384,7 @@ address: 006e27b6a72e1f34c626762f3c4761547aff1421".to_owned(); #[test] fn public() { - let command = vec!["ethkey", "generate", "brain", "this is sparta", "--public"] + let command = vec!["ethkey", "info", "--brain", "this is sparta", "--public"] .into_iter() .map(Into::into) .collect::>(); @@ -278,7 +395,7 @@ address: 006e27b6a72e1f34c626762f3c4761547aff1421".to_owned(); #[test] fn address() { - let command = vec!["ethkey", "generate", "brain", "this is sparta", "--address"] + let command = vec!["ethkey", "info", "-b", "this is sparta", "--address"] .into_iter() .map(Into::into) .collect::>(); diff --git a/ethkey/src/brain.rs b/ethkey/src/brain.rs index 8bc9d2cd77c..fffae0bed8e 100644 --- a/ethkey/src/brain.rs +++ b/ethkey/src/brain.rs @@ -16,6 +16,7 @@ use keccak::Keccak256; use super::{KeyPair, Generator, Secret}; +use parity_wordlist; /// Simple brainwallet. pub struct Brain(String); @@ -24,13 +25,17 @@ impl Brain { pub fn new(s: String) -> Self { Brain(s) } + + pub fn validate_phrase(phrase: &str, expected_words: usize) -> Result<(), ::WordlistError> { + parity_wordlist::validate_phrase(phrase, expected_words) + } } impl Generator for Brain { type Error = ::Void; - fn generate(self) -> Result { - let seed = self.0; + fn generate(&mut self) -> Result { + let seed = self.0.clone(); let mut secret = seed.into_bytes().keccak256(); let mut i = 0; @@ -43,7 +48,10 @@ impl Generator for Brain { if let Ok(pair) = Secret::from_unsafe_slice(&secret) .and_then(KeyPair::from_secret) { - if pair.address()[0] == 0 { return Ok(pair) } + if pair.address()[0] == 0 { + trace!("Testing: {}, got: {:?}", self.0, pair.address()); + return Ok(pair) + } } }, } diff --git a/ethkey/src/brain_prefix.rs b/ethkey/src/brain_prefix.rs new file mode 100644 index 00000000000..a4e31e989c9 --- /dev/null +++ b/ethkey/src/brain_prefix.rs @@ -0,0 +1,70 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +use super::{Generator, KeyPair, Error, Brain}; +use parity_wordlist as wordlist; + +/// Tries to find brain-seed keypair with address starting with given prefix. +pub struct BrainPrefix { + prefix: Vec, + iterations: usize, + no_of_words: usize, + last_phrase: String, +} + +impl BrainPrefix { + pub fn new(prefix: Vec, iterations: usize, no_of_words: usize) -> Self { + BrainPrefix { + prefix, + iterations, + no_of_words, + last_phrase: String::new(), + } + } + + pub fn phrase(&self) -> &str { + &self.last_phrase + } +} + +impl Generator for BrainPrefix { + type Error = Error; + + fn generate(&mut self) -> Result { + for _ in 0..self.iterations { + let phrase = wordlist::random_phrase(self.no_of_words); + let keypair = Brain::new(phrase.clone()).generate().unwrap(); + if keypair.address().starts_with(&self.prefix) { + self.last_phrase = phrase; + return Ok(keypair) + } + } + + Err(Error::Custom("Could not find keypair".into())) + } +} + +#[cfg(test)] +mod tests { + use {Generator, BrainPrefix}; + + #[test] + fn prefix_generator() { + let prefix = vec![0x00u8]; + let keypair = BrainPrefix::new(prefix.clone(), usize::max_value(), 12).generate().unwrap(); + assert!(keypair.address().starts_with(&prefix)); + } +} diff --git a/ethkey/src/brain_recover.rs b/ethkey/src/brain_recover.rs new file mode 100644 index 00000000000..f064c6fd0e1 --- /dev/null +++ b/ethkey/src/brain_recover.rs @@ -0,0 +1,175 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +use std::collections::HashSet; + +use edit_distance::edit_distance; +use parity_wordlist; + +use super::{Address, Brain, Generator}; + + +/// Tries to find a phrase for address, given the number +/// of expected words and a partial phrase. +/// +/// Returns `None` if phrase couldn't be found. +pub fn brain_recover( + address: &Address, + known_phrase: &str, + expected_words: usize, +) -> Option { + let it = PhrasesIterator::from_known_phrase(known_phrase, expected_words); + for phrase in it { + let keypair = Brain::new(phrase.clone()).generate().expect("Brain wallets are infallible; qed"); + trace!("Testing: {}, got: {:?}", phrase, keypair.address()); + if &keypair.address() == address { + return Some(phrase); + } + } + + None +} + +fn generate_substitutions(word: &str) -> Vec<&'static str> { + let mut words = parity_wordlist::WORDS.iter().cloned() + .map(|w| (edit_distance(w, word), w)) + .collect::>(); + words.sort_by(|a, b| a.0.cmp(&b.0)); + + words.into_iter() + .map(|pair| pair.1) + .collect() +} + +/// Iterator over possible +pub struct PhrasesIterator { + words: Vec>, + combinations: u64, + indexes: Vec, + has_next: bool, +} + +impl PhrasesIterator { + pub fn from_known_phrase(known_phrase: &str, expected_words: usize) -> Self { + let known_words = parity_wordlist::WORDS.iter().cloned().collect::>(); + let mut words = known_phrase.split(' ') + .map(|word| match known_words.get(word) { + None => { + info!("Invalid word '{}', looking for potential substitutions.", word); + let substitutions = generate_substitutions(word); + info!("Closest words: {:?}", &substitutions[..10]); + substitutions + }, + Some(word) => vec![*word], + }) + .collect::>(); + + // add missing words + if words.len() < expected_words { + let to_add = expected_words - words.len(); + info!("Number of words is insuficcient adding {} more.", to_add); + for _ in 0..to_add { + words.push(parity_wordlist::WORDS.iter().cloned().collect()); + } + } + + // start searching + PhrasesIterator::new(words) + } + + pub fn new(words: Vec>) -> Self { + let combinations = words.iter().fold(1u64, |acc, x| acc * x.len() as u64); + let indexes = words.iter().map(|_| 0).collect(); + info!("Starting to test {} possible combinations.", combinations); + + PhrasesIterator { + words, + combinations, + indexes, + has_next: combinations > 0, + } + } + + pub fn combinations(&self) -> u64 { + self.combinations + } + + fn current(&self) -> String { + let mut s = self.words[0][self.indexes[0]].to_owned(); + for i in 1..self.indexes.len() { + s.push(' '); + s.push_str(self.words[i][self.indexes[i]]); + } + s + } + + fn next_index(&mut self) -> bool { + let mut pos = self.indexes.len(); + while pos > 0 { + pos -= 1; + self.indexes[pos] += 1; + if self.indexes[pos] >= self.words[pos].len() { + self.indexes[pos] = 0; + } else { + return true; + } + } + + false + } +} + +impl Iterator for PhrasesIterator { + type Item = String; + + fn next(&mut self) -> Option { + if !self.has_next { + return None; + } + + let phrase = self.current(); + self.has_next = self.next_index(); + Some(phrase) + } +} + +#[cfg(test)] +mod tests { + use super::PhrasesIterator; + + + #[test] + fn should_generate_possible_combinations() { + let mut it = PhrasesIterator::new(vec![ + vec!["1", "2", "3"], + vec!["test"], + vec!["a", "b", "c"], + ]); + + assert_eq!(it.combinations(), 9); + assert_eq!(it.next(), Some("1 test a".to_owned())); + assert_eq!(it.next(), Some("1 test b".to_owned())); + assert_eq!(it.next(), Some("1 test c".to_owned())); + assert_eq!(it.next(), Some("2 test a".to_owned())); + assert_eq!(it.next(), Some("2 test b".to_owned())); + assert_eq!(it.next(), Some("2 test c".to_owned())); + assert_eq!(it.next(), Some("3 test a".to_owned())); + assert_eq!(it.next(), Some("3 test b".to_owned())); + assert_eq!(it.next(), Some("3 test c".to_owned())); + assert_eq!(it.next(), None); + } + +} diff --git a/ethkey/src/lib.rs b/ethkey/src/lib.rs index 271a5f166c3..8753c01773d 100644 --- a/ethkey/src/lib.rs +++ b/ethkey/src/lib.rs @@ -14,18 +14,25 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +// #![warn(missing_docs)] + +extern crate byteorder; +extern crate crypto as rcrypto; +extern crate edit_distance; +extern crate ethcore_bigint as bigint; +extern crate parity_wordlist; extern crate rand; -extern crate tiny_keccak; -extern crate secp256k1; extern crate rustc_hex; -extern crate ethcore_bigint as bigint; -extern crate crypto as rcrypto; -extern crate byteorder; +extern crate secp256k1; +extern crate tiny_keccak; #[macro_use] extern crate lazy_static; +#[macro_use] +extern crate log; mod brain; +mod brain_prefix; mod error; mod keypair; mod keccak; @@ -35,9 +42,12 @@ mod signature; mod secret; mod extended; +pub mod brain_recover; pub mod math; +pub use self::parity_wordlist::Error as WordlistError; pub use self::brain::Brain; +pub use self::brain_prefix::BrainPrefix; pub use self::error::Error; pub use self::keypair::{KeyPair, public_to_address}; pub use self::math::public_is_valid; @@ -62,7 +72,7 @@ pub trait Generator { type Error; /// Should be called to generate new keypair. - fn generate(self) -> Result; + fn generate(&mut self) -> Result; } pub type Address = H160; diff --git a/ethkey/src/prefix.rs b/ethkey/src/prefix.rs index 25b1ab3f767..f2ef0f0ffb4 100644 --- a/ethkey/src/prefix.rs +++ b/ethkey/src/prefix.rs @@ -34,7 +34,7 @@ impl Prefix { impl Generator for Prefix { type Error = Error; - fn generate(self) -> Result { + fn generate(&mut self) -> Result { for _ in 0..self.iterations { let keypair = Random.generate()?; if keypair.address().starts_with(&self.prefix) { diff --git a/ethkey/src/random.rs b/ethkey/src/random.rs index 715dd3cb583..b44a4b2ca80 100644 --- a/ethkey/src/random.rs +++ b/ethkey/src/random.rs @@ -23,7 +23,7 @@ pub struct Random; impl Generator for Random { type Error = ::std::io::Error; - fn generate(self) -> Result { + fn generate(&mut self) -> Result { let mut rng = OsRng::new()?; match rng.generate() { Ok(pair) => Ok(pair), @@ -32,10 +32,10 @@ impl Generator for Random { } } -impl<'a> Generator for &'a mut OsRng { +impl Generator for OsRng { type Error = ::Void; - fn generate(self) -> Result { + fn generate(&mut self) -> Result { let (sec, publ) = SECP256K1.generate_keypair(self) .expect("context always created with full capabilities; qed"); diff --git a/ethstore/Cargo.toml b/ethstore/Cargo.toml index 200dec36687..23c02973f6a 100755 --- a/ethstore/Cargo.toml +++ b/ethstore/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethstore" -version = "0.1.0" +version = "0.2.0" authors = ["Parity Technologies "] [dependencies] diff --git a/ethstore/README.md b/ethstore/README.md index 4f7daf4e26d..c56a24a9314 100644 --- a/ethstore/README.md +++ b/ethstore/README.md @@ -21,6 +21,7 @@ Usage: ethstore list [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] ethstore import [--src DIR] [--dir DIR] ethstore import-wallet [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] + ethstore find-wallet-pass ethstore remove
[--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] ethstore sign
[--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] ethstore public
[--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] @@ -50,6 +51,7 @@ Commands: list List accounts. import Import accounts from src. import-wallet Import presale wallet. + find-wallet-pass Tries to open a wallet with list of passwords given. remove Remove account. sign Sign message. public Displays public key for an address. @@ -164,6 +166,25 @@ ethstore import-wallet ethwallet.json password.txt e6a3d25a7cb7cd21cb720df5b5e8afd154af1bbb ``` + +-- + +#### `find-wallet-pass ` +Try to open presale wallet given a list of passwords from a file. +The list of passwords can be generated using e.g. [Phildo/brutedist](https://github.com/Phildo/brutedist). + +- `` - presale wallet path +- `` - possible passwords, file path + +``` +ethstore find-wallet-pass ethwallet.json passwords.txt +``` + +``` +Found password: test +``` + + -- #### `remove
[--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]` @@ -318,8 +339,8 @@ OK -- -# Ethcore toolchain -*this project is a part of the ethcore toolchain* +# Parity toolchain +*this project is a part of the parity toolchain* - [**ethkey**](https://github.com/paritytech/ethkey) - Ethereum keys generator and signer. - [**ethstore**](https://github.com/paritytech/ethstore) - Ethereum key management. diff --git a/ethstore/cli/Cargo.toml b/ethstore/cli/Cargo.toml index 71215fefefc..24d1c9a8f1f 100644 --- a/ethstore/cli/Cargo.toml +++ b/ethstore/cli/Cargo.toml @@ -4,10 +4,12 @@ version = "0.1.0" authors = ["Parity Technologies "] [dependencies] +docopt = "0.8" +num_cpus = "1.6" rustc-hex = "1.0" serde = "1.0" serde_derive = "1.0" -docopt = "0.8" +parking_lot = "0.4" ethstore = { path = "../" } panic_hook = { path = "../../panic_hook" } diff --git a/ethstore/cli/src/crack.rs b/ethstore/cli/src/crack.rs new file mode 100644 index 00000000000..64eda66e56e --- /dev/null +++ b/ethstore/cli/src/crack.rs @@ -0,0 +1,50 @@ +use std::{cmp, thread}; +use std::sync::Arc; +use std::collections::VecDeque; +use parking_lot::Mutex; + +use ethstore::{PresaleWallet, Error}; +use num_cpus; + +pub fn run(passwords: VecDeque, wallet_path: &str) -> Result<(), Error> { + let passwords = Arc::new(Mutex::new(passwords)); + + let mut handles = Vec::new(); + + for _ in 0..num_cpus::get() { + let passwords = passwords.clone(); + let wallet = PresaleWallet::open(&wallet_path)?; + handles.push(thread::spawn(move || { + look_for_password(passwords, wallet); + })); + } + + for handle in handles { + handle.join().map_err(|err| Error::Custom(format!("Error finishing thread: {:?}", err)))?; + } + + Ok(()) +} + +fn look_for_password(passwords: Arc>>, wallet: PresaleWallet) { + let mut counter = 0; + while !passwords.lock().is_empty() { + let package = { + let mut passwords = passwords.lock(); + let len = passwords.len(); + passwords.split_off(cmp::min(len, 32)) + }; + for pass in package { + counter += 1; + match wallet.decrypt(&pass) { + Ok(_) => { + println!("Found password: {}", &pass); + passwords.lock().clear(); + return; + }, + _ if counter % 100 == 0 => print!("."), + _ => {}, + } + } + } +} diff --git a/ethstore/cli/src/main.rs b/ethstore/cli/src/main.rs index 8499851677f..798c7e599ac 100644 --- a/ethstore/cli/src/main.rs +++ b/ethstore/cli/src/main.rs @@ -14,21 +14,27 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate rustc_hex; extern crate docopt; +extern crate ethstore; +extern crate num_cpus; +extern crate panic_hook; +extern crate parking_lot; +extern crate rustc_hex; extern crate serde; + #[macro_use] extern crate serde_derive; -extern crate ethstore; -extern crate panic_hook; -use std::{env, process, fs, fmt}; +use std::collections::VecDeque; use std::io::Read; +use std::{env, process, fs, fmt}; + use docopt::Docopt; -use ethstore::ethkey::Address; use ethstore::dir::{paths, KeyDirectory, RootDiskDirectory}; -use ethstore::{EthStore, SimpleSecretStore, SecretStore, import_accounts, PresaleWallet, - SecretVaultRef, StoreAccountRef}; +use ethstore::ethkey::Address; +use ethstore::{EthStore, SimpleSecretStore, SecretStore, import_accounts, PresaleWallet, SecretVaultRef, StoreAccountRef}; + +mod crack; pub const USAGE: &'static str = r#" Ethereum key management. @@ -40,6 +46,7 @@ Usage: ethstore list [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] ethstore import [--src DIR] [--dir DIR] ethstore import-wallet [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] + ethstore find-wallet-pass ethstore remove
[--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] ethstore sign
[--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] ethstore public
[--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD] @@ -69,6 +76,7 @@ Commands: list List accounts. import Import accounts from src. import-wallet Import presale wallet. + find-wallet-pass Tries to open a wallet with list of passwords given. remove Remove account. sign Sign message. public Displays public key for an address. @@ -86,6 +94,7 @@ struct Args { cmd_list: bool, cmd_import: bool, cmd_import_wallet: bool, + cmd_find_wallet_pass: bool, cmd_remove: bool, cmd_sign: bool, cmd_public: bool, @@ -239,6 +248,11 @@ fn execute(command: I) -> Result where I: IntoIterator>(); + crack::run(passwords, &args.arg_path)?; + Ok(format!("Password not found.")) } else if args.cmd_remove { let address = args.arg_address.parse().map_err(|_| ethstore::Error::InvalidAccount)?; let password = load_password(&args.arg_password)?; diff --git a/hash-fetch/Cargo.toml b/hash-fetch/Cargo.toml index 7b0e8b7cd77..312aa028c66 100644 --- a/hash-fetch/Cargo.toml +++ b/hash-fetch/Cargo.toml @@ -19,7 +19,7 @@ ethcore-bigint = { path = "../util/bigint" } ethcore-bytes = { path = "../util/bytes" } parity-reactor = { path = "../util/reactor" } native-contracts = { path = "../ethcore/native_contracts" } -hash = { path = "../util/hash" } +keccak-hash = { path = "../util/hash" } [dev-dependencies] ethabi = "4.0" diff --git a/hash-fetch/src/lib.rs b/hash-fetch/src/lib.rs index 858a04ea557..0610459ee1f 100644 --- a/hash-fetch/src/lib.rs +++ b/hash-fetch/src/lib.rs @@ -25,7 +25,7 @@ extern crate ethcore_util as util; extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; extern crate futures; -extern crate hash; +extern crate keccak_hash as hash; extern crate mime; extern crate mime_guess; extern crate native_contracts; diff --git a/ipfs/Cargo.toml b/ipfs/Cargo.toml index 0e8b21c151d..da3b48eef35 100644 --- a/ipfs/Cargo.toml +++ b/ipfs/Cargo.toml @@ -7,7 +7,6 @@ authors = ["Parity Technologies "] [dependencies] ethcore = { path = "../ethcore" } -ethcore-util = { path = "../util" } ethcore-bigint = { path = "../util/bigint" } ethcore-bytes = { path = "../util/bytes" } jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-1.9" } diff --git a/ipfs/src/lib.rs b/ipfs/src/lib.rs index ef6184b1b67..b92108b52d6 100644 --- a/ipfs/src/lib.rs +++ b/ipfs/src/lib.rs @@ -20,7 +20,6 @@ extern crate unicase; extern crate rlp; extern crate ethcore; -extern crate ethcore_util as util; extern crate ethcore_bigint as bigint; extern crate ethcore_bytes as bytes; extern crate jsonrpc_core as core; diff --git a/js-old/npm/etherscan/README.md b/js-old/npm/etherscan/README.md deleted file mode 100644 index 730cb7e1d0e..00000000000 --- a/js-old/npm/etherscan/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# @parity/etherscan - -A thin, lightweight promise wrapper for the api.etherscan.io/apis service, exposing a common endpoint for use in JavaScript applications. - -[https://github.com/paritytech/parity/tree/master/js/src/3rdparty/etherscan](https://github.com/paritytech/parity/tree/master/js/src/3rdparty/etherscan) - -## usage - -installation - - -``` -npm install --save @parity/etherscan -``` - -Usage - - -``` -const etherscan = require('@parity/etherscan'); - -// api calls goes here -``` - -## api - -account (exposed on etherscan.account) - - -- `balance(address)` -- `balances(addresses)` (array or addresses) -- `transactions(address, page)` (page offset starts at 0, returns 25) - -stats (exposed on etherscan.stats) - - -- `price()` -- `supply()` diff --git a/js-old/npm/etherscan/package.json b/js-old/npm/etherscan/package.json deleted file mode 100644 index 1aed97171dd..00000000000 --- a/js-old/npm/etherscan/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@parity/etherscan", - "description": "The Parity Promise-based library for interfacing with Etherscan over HTTP", - "version": "0.0.0", - "main": "library.js", - "author": "Parity Team ", - "maintainers": [ - "Jaco Greeff" - ], - "contributors": [], - "license": "GPL-3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/paritytech/parity.git" - }, - "keywords": [ - "Ethereum", - "ABI", - "API", - "RPC", - "Parity", - "Promise" - ], - "scripts": { - }, - "devDependencies": { - "chai": "3.5.0", - "mocha": "3.2.0" - }, - "dependencies": { - "node-fetch": "~1.6.3" - } -} diff --git a/js-old/npm/jsonrpc/README.md b/js-old/npm/jsonrpc/README.md deleted file mode 100644 index e9678864b4d..00000000000 --- a/js-old/npm/jsonrpc/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# @parity/jsonrpc - -JSON and JS interface defintions for RPC calls. - -[https://github.com/paritytech/parity/tree/master/js/src/jsonrpc](https://github.com/paritytech/parity/tree/master/js/src/jsonrpc) diff --git a/js-old/npm/jsonrpc/package.json b/js-old/npm/jsonrpc/package.json deleted file mode 100644 index 90ebe1577b7..00000000000 --- a/js-old/npm/jsonrpc/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@parity/jsonrpc", - "description": "JSON and JS interface defintions for RPC", - "version": "0.0.0", - "main": "library.js", - "author": "Parity Team ", - "maintainers": [ - "Jaco Greeff" - ], - "contributors": [], - "license": "GPL-3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/paritytech/parity.git" - }, - "keywords": [ - "Ethereum", - "ABI", - "API", - "RPC", - "Parity" - ], - "scripts": { - }, - "devDependencies": { - }, - "dependencies": { - } -} diff --git a/js-old/npm/parity/README.md b/js-old/npm/parity/README.md deleted file mode 100644 index 2c5396e2d6b..00000000000 --- a/js-old/npm/parity/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# @parity/parity.js - -Parity.js is a thin, fast, Promise-based wrapper around the Ethereum APIs. - -[https://github.com/paritytech/parity/tree/master/js/src/api](https://github.com/paritytech/parity/tree/master/js/src/api) - -## installation - -Install the package with `npm install --save @parity/parity.js` - -## usage - -### initialisation - -```javascript -// import the actual Api class -import { Api } from '@parity/parity.js'; - -// do the setup -const transport = new Api.Transport.Http('http://localhost:8545'); -const api = new Api(transport); -``` - -### making calls - -perform a call - -```javascript -api.eth - .coinbase() - .then((coinbase) => { - console.log(`The coinbase is ${coinbase}`); - }); -``` - -multiple promises - -```javascript -Promise - .all([ - api.eth.coinbase(), - api.net.listening() - ]) - .then(([coinbase, listening]) => { - // do stuff here - }); -``` - -chaining promises - -```javascript -api.eth - .newFilter({...}) - .then((filterId) => api.eth.getFilterChanges(filterId)) - .then((changes) => { - console.log(changes); - }); -``` - -### contracts - -attach contract - -```javascript -const abi = [{ name: 'callMe', inputs: [{ type: 'bool', ...}, { type: 'string', ...}]}, ...abi...]; -const address = '0x123456...9abc'; -const contract = new api.newContract(abi, address); -``` - -find & call a function - -```javascript -contract.instance - .callMe - .call({ gas: 21000 }, [true, 'someString']) // or estimateGas or postTransaction - .then((result) => { - console.log(`the result was ${result}`); - }); -``` - -## apis - -APIs implement the calls as exposed in the [Ethcore JSON Ethereum RPC](https://github.com/paritytech/ethereum-rpc-json/) definitions. Mapping follows the naming conventions of the originals, i.e. `eth_call` becomes `eth.call`, `personal_accounts` becomes `personal.accounts`, etc. diff --git a/js-old/npm/parity/package.json b/js-old/npm/parity/package.json deleted file mode 100644 index c43da096d3e..00000000000 --- a/js-old/npm/parity/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@parity/parity.js", - "description": "The Parity Promise-based API & ABI library for interfacing with Ethereum over RPC", - "version": "0.0.0", - "main": "library.js", - "author": "Parity Team ", - "maintainers": [ - "Jaco Greeff" - ], - "contributors": [], - "license": "GPL-3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/paritytech/parity.git" - }, - "keywords": [ - "Ethereum", - "ABI", - "API", - "RPC", - "Parity", - "Promise" - ], - "scripts": { - }, - "devDependencies": { - }, - "dependencies": { - "bignumber.js": "~2.3.0", - "js-sha3": "~0.5.2", - "node-fetch": "~1.6.3" - } -} diff --git a/js-old/npm/parity/test/smoke.spec.js b/js-old/npm/parity/test/smoke.spec.js deleted file mode 100644 index fb1ae0d4d52..00000000000 --- a/js-old/npm/parity/test/smoke.spec.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -const parity = require('../'); - -describe('load the Parity library', function () { - it('should no throw any error', () => { - expect(parity).to.be.ok; - - expect(parity.Api).to.be.ok; - expect(parity.Abi).to.be.ok; - }); -}); diff --git a/js-old/npm/shapeshift/README.md b/js-old/npm/shapeshift/README.md deleted file mode 100644 index 0f9a190abc1..00000000000 --- a/js-old/npm/shapeshift/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# @parity/shapeshift - -A thin ES6 promise wrapper around the shapeshift.io APIs as documented at https://shapeshift.io/api - -[https://github.com/paritytech/parity/tree/master/js/src/3rdparty/shapeshift](https://github.com/paritytech/parity/tree/master/js/src/3rdparty/shapeshift) - -## usage - -installation - - -``` -npm install --save @parity/shapeshift -``` - -Usage - - -``` -const APIKEY = 'private affiliate key or undefined'; -const shapeshift = require('@parity/shapeshift')(APIKEY); - -// api calls goes here -``` - -## api - -queries - - -- `getCoins()` [https://shapeshift.io/api#api-104](https://shapeshift.io/api#api-104) -- `getMarketInfo(pair)` [https://shapeshift.io/api#api-103](https://shapeshift.io/api#api-103) -- `getStatus(depositAddress)` [https://shapeshift.io/api#api-5](https://shapeshift.io/api#api-5) - -transactions - - -- `shift(toAddress, returnAddress, pair)` [https://shapeshift.io/api#api-7](https://shapeshift.io/api#api-7) diff --git a/js-old/npm/shapeshift/package.json b/js-old/npm/shapeshift/package.json deleted file mode 100644 index 1aa2d38f315..00000000000 --- a/js-old/npm/shapeshift/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@parity/shapeshift", - "description": "The Parity Promise-based library for interfacing with ShapeShift over HTTP", - "version": "0.0.0", - "main": "library.js", - "author": "Parity Team ", - "maintainers": [ - "Jaco Greeff" - ], - "contributors": [], - "license": "GPL-3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/paritytech/parity.git" - }, - "keywords": [ - "Ethereum", - "ABI", - "API", - "RPC", - "Parity", - "Promise" - ], - "scripts": { - }, - "devDependencies": { - }, - "dependencies": { - "node-fetch": "~1.6.3" - } -} diff --git a/js-old/npm/test/mocha.config.js b/js-old/npm/test/mocha.config.js deleted file mode 100644 index fc21631b0a8..00000000000 --- a/js-old/npm/test/mocha.config.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -const chai = require('chai'); -// const chaiAsPromised from 'chai-as-promised'; -// const chaiEnzyme from 'chai-enzyme'; -// const sinonChai from 'sinon-chai'; - -// chai.use(chaiAsPromised); -// chai.use(chaiEnzyme()); -// chai.use(sinonChai); - -// expose expect to global so we won't have to manually import & define it in every test -global.expect = chai.expect; - -module.exports = {}; diff --git a/js-old/npm/test/mocha.opts b/js-old/npm/test/mocha.opts deleted file mode 100644 index 0ed8269b4ff..00000000000 --- a/js-old/npm/test/mocha.opts +++ /dev/null @@ -1 +0,0 @@ --r ./test/mocha.config diff --git a/js-old/package-lock.json b/js-old/package-lock.json index 7677b6335ea..fded97d5ade 100644 --- a/js-old/package-lock.json +++ b/js-old/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@parity/abi": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@parity/abi/-/abi-2.1.1.tgz", - "integrity": "sha512-AWd1Lnsau8DvEihzoGg3xCSOIHFqf1tsn14wHVCRv7O5BcCI+6Ww/g4iLjdYKGLjtMKtxdQiUblCcIhaZrqmpQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@parity/abi/-/abi-2.1.2.tgz", + "integrity": "sha512-DVH7aEZrSc0seimtehO6pCkkJ/oqXZanAXJXKqgk6x1vSc276pAk7xOcMNe3RKio7VfnIi9c05tqqTX8hUG5hw==", "requires": { "bignumber.js": "3.0.1", "js-sha3": "0.5.5", @@ -15,12 +15,12 @@ } }, "@parity/api": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@parity/api/-/api-2.1.3.tgz", - "integrity": "sha512-M+/9mGQ6Th6LRIXetUHQQqsqSE//XAd/p5I/jrhKqV9dW73dwTIKW/xlPWPi/JwbRiTehbliJKmrt8vsOtvkww==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@parity/api/-/api-2.1.5.tgz", + "integrity": "sha512-HkvMIhIwDMEIyTmXqEjWn1C2qes0qJO270bQldRfCZf0XiOGXG726EzV3FUpUbVONCVQ9riDviAl3fw6D+N6nA==", "requires": { - "@parity/abi": "2.1.1", - "@parity/jsonrpc": "2.1.2", + "@parity/abi": "2.1.2", + "@parity/jsonrpc": "2.1.4", "@parity/wordlist": "1.1.0", "bignumber.js": "3.0.1", "blockies": "0.0.2", @@ -51,9 +51,9 @@ } }, "@parity/jsonrpc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@parity/jsonrpc/-/jsonrpc-2.1.2.tgz", - "integrity": "sha512-JN5MTZO9d27ZMLuibnYWri2Is0p5ZM7dAXafJNWBKGe1sMBDqQA44Sz6La4Baem2PTgjWAlWYjeD78SXx+9mYA==" + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@parity/jsonrpc/-/jsonrpc-2.1.4.tgz", + "integrity": "sha512-gGX1LMGxF6Ma4fAbpY3awK0IpB+ARjCH87m/fq8vvUr+5/Z/ywXjjmauPqA435vyjnW4STd2l9FVREVz4wv08A==" }, "@parity/wordlist": { "version": "1.1.0", @@ -150,9 +150,9 @@ } }, "ajv": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.3.0.tgz", - "integrity": "sha1-RBT/dKUIecII7l/cgm4ywwNUnto=", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz", + "integrity": "sha1-s4u4h22ehr7plJVqBOch6IskjrI=", "requires": { "co": "4.6.0", "fast-deep-equal": "1.0.0", @@ -247,11 +247,6 @@ "default-require-extensions": "1.0.0" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, "archive-type": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/archive-type/-/archive-type-3.2.0.tgz", @@ -339,7 +334,7 @@ "dev": true, "requires": { "define-properties": "1.1.2", - "es-abstract": "1.9.0" + "es-abstract": "1.10.0" } }, "arrify": { @@ -427,7 +422,7 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000760", + "caniuse-db": "1.0.30000778", "normalize-range": "0.1.2", "num2fraction": "1.2.2", "postcss": "5.2.18", @@ -458,8 +453,8 @@ "babel-runtime": "6.23.0", "chokidar": "1.7.0", "commander": "2.8.1", - "convert-source-map": "1.5.0", - "fs-readdir-recursive": "1.0.0", + "convert-source-map": "1.5.1", + "fs-readdir-recursive": "1.1.0", "glob": "7.1.2", "lodash": "4.17.2", "output-file-sync": "1.1.2", @@ -511,7 +506,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "convert-source-map": "1.5.0", + "convert-source-map": "1.5.1", "debug": "2.6.9", "json5": "0.5.1", "lodash": "4.17.2", @@ -2170,6 +2165,7 @@ "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", "integrity": "sha1-CpSJ8UTecO+zzkMArM2zKeL8VDs=", + "dev": true, "requires": { "core-js": "2.4.1", "regenerator-runtime": "0.10.5" @@ -2178,7 +2174,8 @@ "regenerator-runtime": { "version": "0.10.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true } } }, @@ -2308,7 +2305,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "convert-source-map": "1.5.0", + "convert-source-map": "1.5.1", "debug": "2.6.9", "json5": "0.5.1", "lodash": "4.17.4", @@ -2406,9 +2403,9 @@ "integrity": "sha1-gHZS0Q453jfp40lyR+3HmLt0b3Y=" }, "binary-extensions": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", - "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", "dev": true }, "bindings": { @@ -2575,12 +2572,12 @@ } }, "browserify-zlib": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { - "pako": "0.2.9" + "pako": "1.0.6" } }, "browserslist": { @@ -2589,7 +2586,7 @@ "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", "dev": true, "requires": { - "caniuse-db": "1.0.30000760", + "caniuse-db": "1.0.30000778", "electron-to-chromium": "1.3.27" } }, @@ -2694,15 +2691,15 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000760", + "caniuse-db": "1.0.30000778", "lodash.memoize": "4.1.2", "lodash.uniq": "4.5.0" } }, "caniuse-db": { - "version": "1.0.30000760", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000760.tgz", - "integrity": "sha1-PqKUc+t4psywny63Osnh3r/sUo0=", + "version": "1.0.30000778", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000778.tgz", + "integrity": "sha1-Fnxg6VQqKqYFN8RG+ziB2FOjByo=", "dev": true }, "capture-stack-trace": { @@ -2731,11 +2728,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" - }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=" } } }, @@ -2870,7 +2862,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.1.2", + "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -2905,11 +2897,6 @@ } } }, - "chownr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", - "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=" - }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -3019,9 +3006,9 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "codemirror": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.31.0.tgz", - "integrity": "sha512-LKbMZKoAz7pMmWuSEl253G6yyloSulj1kXfvYv+3n3I8wMiI7QwnCHwKM3Zw5S9ItNV28Layq0/ihQXWmn9T9w==" + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.32.0.tgz", + "integrity": "sha512-95OxAlYiigW0g4n4ixFdavG07clJGILp3MvHh2pKR3FvyrTuHHvqtKSVbrV3/Jz6o0YqGvyCDLDTbH4h6ciaSw==" }, "collapse-white-space": { "version": "1.0.3", @@ -3158,11 +3145,10 @@ } }, "commonmark-react-renderer": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/commonmark-react-renderer/-/commonmark-react-renderer-4.3.3.tgz", - "integrity": "sha1-nEvKE4vIMoe655LM8TNzi+nLxvo=", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/commonmark-react-renderer/-/commonmark-react-renderer-4.3.4.tgz", + "integrity": "sha512-+/Rzo3sI37NR8LaVdkUiqBH3+CEW75hc86shwY4E9eEERg78VCy4rSkaP/p7OG5bTvosUMkvhn5d1ZJ5iyt/ag==", "requires": { - "in-publish": "2.0.0", "lodash.assign": "4.2.0", "lodash.isplainobject": "4.0.6", "pascalcase": "0.1.1", @@ -3201,11 +3187,6 @@ } } }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, "constants-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", @@ -3231,9 +3212,9 @@ "dev": true }, "convert-source-map": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", - "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=" + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=" }, "cookie": { "version": "0.3.1", @@ -3301,7 +3282,8 @@ "core-js": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", - "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=" + "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=", + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -3692,7 +3674,7 @@ "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "0.10.35" + "es5-ext": "0.10.37" } }, "d3-array": { @@ -3711,14 +3693,14 @@ "integrity": "sha1-vHZD/KjlOoNH4vva/6I2eWtYUJs=" }, "d3-format": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.2.0.tgz", - "integrity": "sha1-a0gLqohohdRlHcJIqPSsnaFtsHo=" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.2.1.tgz", + "integrity": "sha512-U4zRVLDXW61bmqoo+OJ/V687e1T5nVd3TAKAJKgtpZ/P1JsMgyod0y9br+mlQOryTAACdiXI3wCjuERHFNp91w==" }, "d3-interpolate": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.1.5.tgz", - "integrity": "sha1-aeCZ/zkhRxblY8muw+qdHqS4p58=", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.1.6.tgz", + "integrity": "sha512-mOnv5a+pZzkNIHtw/V6I+w9Lqm9L5bG3OTXPM5A+QO0yyVMQ4W1uZhR+VOJmazaOZXri2ppbiZ5BUNWT0pFM9A==", "requires": { "d3-color": "1.0.3" } @@ -3736,10 +3718,10 @@ "d3-array": "1.2.1", "d3-collection": "1.0.4", "d3-color": "1.0.3", - "d3-format": "1.2.0", - "d3-interpolate": "1.1.5", - "d3-time": "1.0.7", - "d3-time-format": "2.1.0" + "d3-format": "1.2.1", + "d3-interpolate": "1.1.6", + "d3-time": "1.0.8", + "d3-time-format": "2.1.1" } }, "d3-shape": { @@ -3751,16 +3733,16 @@ } }, "d3-time": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.0.7.tgz", - "integrity": "sha1-lMr27bt4ebuAnQ0fdXK8SEgvcnA=" + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.0.8.tgz", + "integrity": "sha512-YRZkNhphZh3KcnBfitvF3c6E0JOFGikHZ4YqD+Lzv83ZHn1/u6yGenRU1m+KAk9J1GnZMnKcrtfvSktlA1DXNQ==" }, "d3-time-format": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.1.0.tgz", - "integrity": "sha512-mqTsfDTylgwE3YE/VNs9oB2OGX274fO0B5j1irbgLQI+X3FPoJg25pesNxrcdZ2nBeRx/6sHDJlDyMIjWL0BGQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.1.1.tgz", + "integrity": "sha512-8kAkymq2WMfzW7e+s/IUNAtN/y3gZXGRrdGfo6R8NKPAA85UBTxZg5E61bR6nLwjPjj4d3zywSQe1CkYLPFyrw==", "requires": { - "d3-time": "1.0.7" + "d3-time": "1.0.8" } }, "dashdash": { @@ -3844,7 +3826,7 @@ "is-tar": "1.0.0", "object-assign": "2.1.1", "strip-dirs": "1.1.1", - "tar-stream": "1.5.4", + "tar-stream": "1.5.5", "through2": "0.6.5", "vinyl": "0.4.6" }, @@ -3879,7 +3861,7 @@ "object-assign": "2.1.1", "seek-bzip": "1.0.5", "strip-dirs": "1.1.1", - "tar-stream": "1.5.4", + "tar-stream": "1.5.5", "through2": "0.6.5", "vinyl": "0.4.6" }, @@ -3913,7 +3895,7 @@ "is-gzip": "1.0.0", "object-assign": "2.1.1", "strip-dirs": "1.1.1", - "tar-stream": "1.5.4", + "tar-stream": "1.5.5", "through2": "0.6.5", "vinyl": "0.4.6" }, @@ -4113,7 +4095,7 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000760", + "caniuse-db": "1.0.30000778", "css-rule-stream": "1.1.0", "duplexer2": "0.0.2", "jsonfilter": "1.1.2", @@ -4355,12 +4337,6 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, - "ejs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-1.0.0.tgz", - "integrity": "sha1-ycYKSKRu5FL7MqccMXuV5aofyz0=", - "dev": true - }, "ejs-loader": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/ejs-loader/-/ejs-loader-0.3.0.tgz", @@ -4391,16 +4367,6 @@ } } }, - "ejsify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ejsify/-/ejsify-1.0.0.tgz", - "integrity": "sha1-NxlPWoXBKuQ4QpOVeZ7Ee0O8RT8=", - "dev": true, - "requires": { - "ejs": "1.0.0", - "through": "2.3.8" - } - }, "electron-to-chromium": { "version": "1.3.27", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", @@ -4531,9 +4497,9 @@ } }, "es-abstract": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.9.0.tgz", - "integrity": "sha512-kk3IJoKo7A3pWJc0OV8yZ/VEX2oSUytfekrJiqoxBlKJMFAJVJVpGdHClCCTdv+Fn2zHfpDHHIelMFhZVfef3Q==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.10.0.tgz", + "integrity": "sha512-/uh/DhdqIOSkAWifU+8nG78vlQxdLckUdI/sPgy0VhuXi2qJ7T8czBmqIYtLQVpCIFYafChnsRsB5pyb1JdmCQ==", "dev": true, "requires": { "es-to-primitive": "1.1.1", @@ -4555,9 +4521,9 @@ } }, "es5-ext": { - "version": "0.10.35", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.35.tgz", - "integrity": "sha1-GO6FjOajxFx9eekcFfzKnsVoSU8=", + "version": "0.10.37", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.37.tgz", + "integrity": "sha1-DudB0Ui4AGm6J9AgOTdWryV978M=", "dev": true, "requires": { "es6-iterator": "2.0.3", @@ -4576,7 +4542,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.37", "es6-symbol": "3.1.1" } }, @@ -4587,7 +4553,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.37", "es6-iterator": "2.0.3", "es6-set": "0.1.5", "es6-symbol": "3.1.1", @@ -4606,7 +4572,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.37", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1", "event-emitter": "0.3.5" @@ -4619,7 +4585,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35" + "es5-ext": "0.10.37" } }, "es6-templates": { @@ -4639,7 +4605,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35", + "es5-ext": "0.10.37", "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" } @@ -4700,7 +4666,7 @@ "debug": "2.6.9", "doctrine": "1.5.0", "escope": "3.6.0", - "espree": "3.5.1", + "espree": "3.5.2", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", @@ -4814,9 +4780,9 @@ "dev": true }, "espree": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.1.tgz", - "integrity": "sha1-DJiLirRttTEAoZVK5LqZXd0n2H4=", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", "dev": true, "requires": { "acorn": "5.2.1", @@ -4880,9 +4846,9 @@ "bn.js": "4.11.8", "create-hash": "1.1.3", "ethjs-util": "0.1.4", - "keccak": "1.3.0", + "keccak": "1.4.0", "rlp": "2.0.0", - "secp256k1": "3.3.1" + "secp256k1": "3.4.0" }, "dependencies": { "babel-plugin-transform-es2015-modules-commonjs": { @@ -4959,7 +4925,7 @@ "dev": true, "requires": { "d": "1.0.0", - "es5-ext": "0.10.35" + "es5-ext": "0.10.37" } }, "eventemitter3": { @@ -5013,11 +4979,6 @@ "fill-range": "2.2.3" } }, - "expand-template": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.0.tgz", - "integrity": "sha512-kkjwkMqj0h4w/sb32ERCDxCQkREMCAgS39DscDnSwDsbxnwwM1BTZySdC3Bn1lhY7vL08n9GoO/fVTynjDgRyQ==" - }, "express": { "version": "4.14.1", "resolved": "https://registry.npmjs.org/express/-/express-4.14.1.tgz", @@ -5502,9 +5463,9 @@ } }, "fs-readdir-recursive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz", - "integrity": "sha1-jNF0XItPiinIyuw5JHaSG6GV9WA=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", "dev": true }, "fs.realpath": { @@ -5513,14 +5474,14 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", "dev": true, "optional": true, "requires": { - "nan": "2.7.0", - "node-pre-gyp": "0.6.36" + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" }, "dependencies": { "abbrev": { @@ -5678,7 +5639,6 @@ "version": "2.0.5", "bundled": true, "dev": true, - "optional": true, "requires": { "boom": "2.10.1" } @@ -5726,6 +5686,12 @@ "dev": true, "optional": true }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, "ecc-jsbn": { "version": "0.1.1", "bundled": true, @@ -5867,7 +5833,6 @@ "version": "3.1.3", "bundled": true, "dev": true, - "optional": true, "requires": { "boom": "2.10.1", "cryptiles": "2.0.5", @@ -6039,11 +6004,13 @@ "optional": true }, "node-pre-gyp": { - "version": "0.6.36", + "version": "0.6.39", "bundled": true, "dev": true, "optional": true, "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", "mkdirp": "0.5.1", "nopt": "4.0.1", "npmlog": "4.1.0", @@ -6251,7 +6218,6 @@ "version": "1.0.9", "bundled": true, "dev": true, - "optional": true, "requires": { "hoek": "2.16.3" } @@ -6456,18 +6422,15 @@ "dev": true }, "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", + "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", + "ansi": "0.3.1", "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" + "lodash.pad": "4.5.1", + "lodash.padend": "4.6.1", + "lodash.padstart": "4.6.1" } }, "generate-function": { @@ -6533,11 +6496,6 @@ } } }, - "github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" - }, "glob": { "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", @@ -6731,7 +6689,7 @@ "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz", "integrity": "sha1-uG/zSdgBzrVuHZ59x7vLS33uYAw=", "requires": { - "convert-source-map": "1.5.0", + "convert-source-map": "1.5.1", "graceful-fs": "4.1.11", "strip-bom": "2.0.0", "through2": "2.0.3", @@ -6870,15 +6828,15 @@ "dev": true, "requires": { "chalk": "1.1.3", - "commander": "2.11.0", + "commander": "2.12.2", "is-my-json-valid": "2.16.1", "pinkie-promise": "2.0.1" }, "dependencies": { "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", + "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==", "dev": true } } @@ -7038,7 +6996,7 @@ "requires": { "es6-templates": "0.2.3", "fastparse": "1.1.1", - "html-minifier": "3.5.6", + "html-minifier": "3.5.7", "loader-utils": "0.2.17", "object-assign": "4.1.1" }, @@ -7058,25 +7016,25 @@ } }, "html-minifier": { - "version": "3.5.6", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.6.tgz", - "integrity": "sha512-88FjtKrlak2XjczhxrBomgzV4jmGzM3UnHRBScRkJcmcRum0kb+IwhVAETJ8AVp7j0p3xugjSaw9L+RmI5/QOA==", + "version": "3.5.7", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.7.tgz", + "integrity": "sha512-GISXn6oKDo7+gVpKOgZJTbHMCUI2TSGfpg/8jgencWhWJsvEmsvp3M8emX7QocsXsYznWloLib3OeSfeyb/ewg==", "dev": true, "requires": { "camel-case": "3.0.0", "clean-css": "4.1.9", - "commander": "2.11.0", + "commander": "2.12.2", "he": "1.1.1", "ncname": "1.0.0", "param-case": "2.1.1", "relateurl": "0.2.7", - "uglify-js": "3.1.8" + "uglify-js": "3.2.1" }, "dependencies": { "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", + "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==", "dev": true }, "source-map": { @@ -7086,12 +7044,12 @@ "dev": true }, "uglify-js": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.1.8.tgz", - "integrity": "sha512-1lnTkrJWw6LJ7n43ZyYVXx0eN2PQh0c3Inb0nY/vj5fNfwykXQFif2kvNgm/Bf0ClLA8R6SKaMHFzo9io4Q+vg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.2.1.tgz", + "integrity": "sha512-BhZTJPmOKPSUcjnx2nlfaOQKHLyjjT4HFyzFWF1BUErx9knJNpdW94ql5o8qVxeNL+8IAWjEjnPvASH2yZnkMg==", "dev": true, "requires": { - "commander": "2.11.0", + "commander": "2.12.2", "source-map": "0.6.1" } } @@ -7110,7 +7068,7 @@ "dev": true, "requires": { "bluebird": "3.5.1", - "html-minifier": "3.5.6", + "html-minifier": "3.5.7", "loader-utils": "0.2.17", "lodash": "4.17.4", "pretty-error": "2.1.1", @@ -7210,9 +7168,9 @@ } }, "https-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, "humanize": { @@ -7249,12 +7207,6 @@ "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", "dev": true }, - "ignore-styles": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ignore-styles/-/ignore-styles-5.0.1.tgz", - "integrity": "sha1-tJ7yJ0va/NikiAqWa/440aC/RnE=", - "dev": true - }, "immediate": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", @@ -7305,9 +7257,9 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "inline-style-prefixer": { "version": "2.0.5", @@ -7340,9 +7292,9 @@ } }, "interpret": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.4.tgz", - "integrity": "sha1-ggzdWIuGj/sZGoCVBtbJyPISsbA=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", "dev": true }, "intl-format-cache": { @@ -7421,7 +7373,7 @@ "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "1.10.0" + "binary-extensions": "1.11.0" } }, "is-buffer": { @@ -7564,13 +7516,13 @@ "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", "dev": true, "requires": { - "is-path-inside": "1.0.0" + "is-path-inside": "1.0.1" } }, "is-path-inside": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", - "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { "path-is-inside": "1.0.2" @@ -7915,9 +7867,9 @@ } }, "js-base64": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.3.2.tgz", - "integrity": "sha512-Y2/+DnfJJXT1/FCwUebUhLWb3QihxiSC42+ctHLGogmW2jPY6LCapMdFZXRvVP2z6qyKW7s6qncE/9gSqZiArw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.0.tgz", + "integrity": "sha512-Wehd+7Pf9tFvGb+ydPm9TjYjV8X1YHOVyG8QyELZxEMqOhemVwGRmoG8iQ/soqI3n8v4xn59zaLxiCJiaaRzKA==", "dev": true }, "js-sha3": { @@ -8097,14 +8049,13 @@ "dev": true }, "keccak": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.3.0.tgz", - "integrity": "sha512-JgsKPxYhcJxKrV+TrCyg/GwZbOjhpRPrz2kG8xbAsUaIDelUlKjm08YcwBO9Fm8sqf/Kg8ZWkk6nWujhLykfvw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "requires": { "bindings": "1.3.0", "inherits": "2.0.3", - "nan": "2.7.0", - "prebuild-install": "2.3.0", + "nan": "2.8.0", "safe-buffer": "5.1.1" } }, @@ -8133,9 +8084,9 @@ "bn.js": "4.11.8", "create-hash": "1.1.3", "ethjs-util": "0.1.4", - "keccak": "1.3.0", + "keccak": "1.4.0", "rlp": "2.0.0", - "secp256k1": "3.3.1" + "secp256k1": "3.4.0" } }, "validator": { @@ -9112,9 +9063,9 @@ "dev": true }, "nan": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", - "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=" + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=" }, "napa": { "version": "2.3.0", @@ -9137,28 +9088,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" - }, - "gauge": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", - "integrity": "sha1-6c7FSD09TuDvRLYKfZnkk14TbZM=", - "requires": { - "ansi": "0.3.1", - "has-unicode": "2.0.1", - "lodash.pad": "4.5.1", - "lodash.padend": "4.6.1", - "lodash.padstart": "4.6.1" - } - }, - "npmlog": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", - "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", - "requires": { - "ansi": "0.3.1", - "are-we-there-yet": "1.1.4", - "gauge": "1.2.7" - } } } }, @@ -9214,14 +9143,6 @@ "qs": "6.3.0" } }, - "node-abi": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.1.2.tgz", - "integrity": "sha512-hmUtb8m75RSi7N+zZLYqe75XDvZB+6LyTBPkj2DConvNgQet2e3BIqEwe1LLvqMrfyjabuT5ZOrTioLCH1HTdA==", - "requires": { - "semver": "5.4.1" - } - }, "node-dir": { "version": "0.1.17", "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", @@ -9241,21 +9162,21 @@ } }, "node-libs-browser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.0.0.tgz", - "integrity": "sha1-o6WeyXAkmFtG6Vg3lkb5bEthZkY=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", + "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", "dev": true, "requires": { "assert": "1.4.1", - "browserify-zlib": "0.1.4", + "browserify-zlib": "0.2.0", "buffer": "4.9.1", "console-browserify": "1.1.0", "constants-browserify": "1.0.0", "crypto-browserify": "3.12.0", "domain-browser": "1.1.7", "events": "1.1.1", - "https-browserify": "0.0.1", - "os-browserify": "0.2.1", + "https-browserify": "1.0.0", + "os-browserify": "0.3.0", "path-browserify": "0.0.0", "process": "0.11.10", "punycode": "1.4.1", @@ -9263,7 +9184,7 @@ "readable-stream": "2.3.3", "stream-browserify": "2.0.1", "stream-http": "2.7.2", - "string_decoder": "0.10.31", + "string_decoder": "1.0.3", "timers-browserify": "2.0.4", "tty-browserify": "0.0.0", "url": "0.11.0", @@ -9276,12 +9197,6 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true } } }, @@ -9290,11 +9205,6 @@ "resolved": "https://registry.npmjs.org/node-status-codes/-/node-status-codes-1.0.0.tgz", "integrity": "sha1-WuVUHQJGRdMqWPzdyc7s6nrjrC8=" }, - "noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" - }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", @@ -9353,14 +9263,13 @@ "integrity": "sha1-3tMGxbC/yHCp6fr4I7xfKD4FrhE=" }, "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", + "integrity": "sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI=", "requires": { + "ansi": "0.3.1", "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "gauge": "1.2.7" } }, "nth-check": { @@ -9430,7 +9339,7 @@ "dev": true, "requires": { "define-properties": "1.1.2", - "es-abstract": "1.9.0", + "es-abstract": "1.10.0", "function-bind": "1.1.1", "has": "1.0.1" } @@ -9451,7 +9360,7 @@ "dev": true, "requires": { "define-properties": "1.1.2", - "es-abstract": "1.9.0", + "es-abstract": "1.10.0", "function-bind": "1.1.1", "has": "1.0.1" } @@ -9474,9 +9383,9 @@ } }, "onecolor": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/onecolor/-/onecolor-3.0.4.tgz", - "integrity": "sha1-daRvgNpseqpbTarhekcZi9llJJQ=", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/onecolor/-/onecolor-3.0.5.tgz", + "integrity": "sha1-Nu/zIgE3nv3xGA+0ReUajiQl+fY=", "dev": true }, "onetime": { @@ -9534,9 +9443,9 @@ } }, "os-browserify": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", - "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, "os-homedir": { @@ -9584,9 +9493,9 @@ } }, "pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", "dev": true }, "param-case": { @@ -9775,7 +9684,7 @@ "integrity": "sha1-GVV2CVno0aEcsqUOyD7sRwYz5J8=", "dev": true, "requires": { - "onecolor": "3.0.4", + "onecolor": "3.0.5", "synesthesia": "1.0.1" } }, @@ -9821,7 +9730,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.3.2", + "js-base64": "2.4.0", "source-map": "0.5.7", "supports-color": "3.2.3" }, @@ -10632,27 +10541,6 @@ "uniqs": "2.0.0" } }, - "prebuild-install": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-2.3.0.tgz", - "integrity": "sha512-gzjq2oHB8oMbzJSsSh9MQ64zrXZGt092/uT4TLZlz2qnrPxpWqp4vYB7LZrDxnlxf5RfbCjkgDI/z0EIVuYzAw==", - "requires": { - "expand-template": "1.1.0", - "github-from-package": "0.0.0", - "minimist": "1.2.0", - "mkdirp": "0.5.1", - "node-abi": "2.1.2", - "noop-logger": "0.1.1", - "npmlog": "4.1.2", - "os-homedir": "1.0.2", - "pump": "1.0.2", - "rc": "1.2.2", - "simple-get": "1.4.3", - "tar-fs": "1.16.0", - "tunnel-agent": "0.6.0", - "xtend": "4.0.1" - } - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -10789,15 +10677,6 @@ "randombytes": "2.0.5" } }, - "pump": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz", - "integrity": "sha1-Oz7mUS+U8OV1U4wXmV+fFpkKXVE=", - "requires": { - "end-of-stream": "1.4.0", - "once": "1.4.0" - } - }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -10923,7 +10802,7 @@ "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=", "requires": { "deep-extend": "0.4.2", - "ini": "1.3.4", + "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" } @@ -11019,7 +10898,7 @@ "integrity": "sha1-zWvW70WOweA1z9iz/nswyMeIPGw=", "requires": { "classnames": "2.2.5", - "codemirror": "5.31.0", + "codemirror": "5.32.0", "lodash.debounce": "4.0.8" } }, @@ -11138,8 +11017,24 @@ "react-inspector": { "version": "github:paritytech/react-inspector#73b5214261a5131821eb9088f58d7e5f31210c23", "requires": { - "babel-runtime": "6.23.0", + "babel-runtime": "6.26.0", "is-dom": "1.0.9" + }, + "dependencies": { + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "2.5.1", + "regenerator-runtime": "0.11.0" + } + }, + "core-js": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", + "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=" + } } }, "react-intl": { @@ -11168,7 +11063,7 @@ "integrity": "sha1-JtglQ40pLnym4pL+diAeHb8s/u4=", "requires": { "commonmark": "0.24.0", - "commonmark-react-renderer": "4.3.3", + "commonmark-react-renderer": "4.3.4", "in-publish": "2.0.0" } }, @@ -11491,13 +11386,13 @@ "lodash": "4.17.2", "lodash-es": "4.17.4", "loose-envify": "1.3.1", - "symbol-observable": "1.0.4" + "symbol-observable": "1.1.0" }, "dependencies": { "symbol-observable": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.4.tgz", - "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.1.0.tgz", + "integrity": "sha512-dQoid9tqQ+uotGhuTKEY11X4xhyYePVnqGSoSm3OGKh2E8LZ6RPULp1uXTctk33IeERlrRJYoVSBglsL05F5Uw==" } } }, @@ -11725,12 +11620,6 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", "dev": true - }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", - "dev": true } } }, @@ -11906,7 +11795,7 @@ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", "integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=", "requires": { - "ajv": "5.3.0" + "ajv": "5.5.1" } }, "script-ext-html-webpack-plugin": { @@ -11929,9 +11818,9 @@ "integrity": "sha1-jgOPbdsUvXZa4fS1IW4SCUUR4NA=" }, "secp256k1": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.3.1.tgz", - "integrity": "sha512-lygjgfjzjBHblEDDkppUF5KK1EeVk6P/Dv2MsJZpYIR3vW5TKFRexOFkf0hHy9J5YxEpjQZ6x98Y3XQpMQO/vA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.4.0.tgz", + "integrity": "sha512-eC120ESQ6MB3gMkxj0PVcSjv/9VtSUmm9uPGNc58yTs93iMCUQZ1xeGPidQMY1z1O4psbCtOxRu3vNqpbuck6Q==", "requires": { "bindings": "1.3.0", "bip66": "1.1.5", @@ -11939,8 +11828,7 @@ "create-hash": "1.1.3", "drbg.js": "1.0.1", "elliptic": "6.4.0", - "nan": "2.7.0", - "prebuild-install": "2.3.0", + "nan": "2.8.0", "safe-buffer": "5.1.1" } }, @@ -12081,7 +11969,7 @@ "dev": true, "requires": { "glob": "7.1.2", - "interpret": "1.0.4", + "interpret": "1.1.0", "rechoir": "0.6.2" }, "dependencies": { @@ -12111,16 +11999,6 @@ "resolved": "https://registry.npmjs.org/simple-assign/-/simple-assign-0.1.0.tgz", "integrity": "sha1-F/0wZqXz13OPUDIbsPFMooHMS6o=" }, - "simple-get": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-1.4.3.tgz", - "integrity": "sha1-6XVe2kB+ltpAxeUVjJ6jezO+y+s=", - "requires": { - "once": "1.4.0", - "unzip-response": "1.0.2", - "xtend": "4.0.1" - } - }, "sinon": { "version": "1.17.7", "resolved": "https://registry.npmjs.org/sinon/-/sinon-1.17.7.tgz", @@ -12767,7 +12645,7 @@ "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "ajv": "5.3.0", + "ajv": "5.5.1", "ajv-keywords": "2.1.1", "chalk": "2.3.0", "lodash": "4.17.4", @@ -12967,17 +12845,6 @@ "inherits": "2.0.3" } }, - "tar-fs": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.0.tgz", - "integrity": "sha512-I9rb6v7mjWLtOfCau9eH5L7sLJyU2BnxtEZRQ5Mt+eRKmf1F0ohXmT/Jc3fr52kDvjJ/HV5MH3soQfPL5bQ0Yg==", - "requires": { - "chownr": "1.0.1", - "mkdirp": "0.5.1", - "pump": "1.0.2", - "tar-stream": "1.5.4" - } - }, "tar-pack": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.1.tgz", @@ -12994,9 +12861,9 @@ } }, "tar-stream": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.4.tgz", - "integrity": "sha1-NlSc8E7RrumyowwBQyUiONr5QBY=", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.5.tgz", + "integrity": "sha512-mQdgLPc/Vjfr3VWqWbfxW8yQNiJCbAZ+Gf6GDu1Cy0bdb33ofyiNGBtAY96jHFhDuivCwgW1H9DgTON+INiXgg==", "requires": { "bl": "1.2.1", "end-of-stream": "1.4.0", @@ -13174,12 +13041,9 @@ "dev": true }, "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "5.1.1" - } + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=" }, "tweetnacl": { "version": "0.14.5", @@ -13664,13 +13528,13 @@ "ajv-keywords": "1.5.1", "async": "2.6.0", "enhanced-resolve": "3.4.1", - "interpret": "1.0.4", + "interpret": "1.1.0", "json-loader": "0.5.4", "loader-runner": "2.3.0", "loader-utils": "0.2.17", "memory-fs": "0.4.1", "mkdirp": "0.5.1", - "node-libs-browser": "2.0.0", + "node-libs-browser": "2.1.0", "source-map": "0.5.7", "supports-color": "3.2.3", "tapable": "0.2.8", @@ -13800,7 +13664,7 @@ "dev": true, "requires": { "debug": "2.6.9", - "nan": "2.7.0", + "nan": "2.8.0", "typedarray-to-buffer": "3.1.2", "yaeti": "0.0.6" } @@ -13857,14 +13721,6 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" }, - "wide-align": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", - "requires": { - "string-width": "1.0.2" - } - }, "window-size": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", diff --git a/js-old/package.json b/js-old/package.json index 7f406ffe236..9022be9d690 100644 --- a/js-old/package.json +++ b/js-old/package.json @@ -27,16 +27,15 @@ ], "scripts": { "install": "napa", - "build": "npm run build:lib && npm run build:dll && npm run build:app", + "build": "npm run build:dll && npm run build:app", "build:app": "webpack --config webpack/app", - "build:lib": "webpack --config webpack/libraries", "build:dll": "webpack --config webpack/vendor", "ci:build": "cross-env NODE_ENV=production npm run build", "clean": "rimraf ./.build ./.coverage ./.happypack ./.npmjs ./build ./node_modules/.cache", "lint": "npm run lint:css && npm run lint:js", "lint:css": "stylelint ./src/**/*.css", "lint:js": "eslint --ignore-path .gitignore ./src/", - "test": "NODE_ENV=test mocha --compilers ejs:ejsify 'src/**/*.spec.js'", + "test": "NODE_ENV=test mocha 'src/**/*.spec.js'", "watch": "webpack --watch --config webpack/app" }, "napa": { @@ -76,7 +75,6 @@ "cross-env": "5.1.1", "css-loader": "0.26.1", "ejs-loader": "0.3.0", - "ejsify": "1.0.0", "empty-module": "0.0.2", "enzyme": "2.7.1", "eslint": "3.16.1", @@ -94,7 +92,6 @@ "html-loader": "0.4.4", "html-webpack-plugin": "2.28.0", "http-proxy-middleware": "0.17.3", - "ignore-styles": "5.0.1", "istanbul": "1.0.0-alpha.2", "jsdom": "9.11.0", "json-loader": "0.5.4", @@ -135,6 +132,7 @@ "yargs": "6.6.0" }, "dependencies": { + "@parity/abi": "2.1.x", "@parity/api": "2.1.x", "@parity/wordlist": "1.1.x", "base32.js": "0.1.0", diff --git a/js-old/scripts/build-rpc-json.js b/js-old/scripts/build-rpc-json.js deleted file mode 100644 index 740f96aa104..00000000000 --- a/js-old/scripts/build-rpc-json.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import fs from 'fs'; -import path from 'path'; -import yargs from 'yargs'; - -import interfaces from '../src/jsonrpc'; - -const argv = yargs.default('output', 'release').argv; - -const INDEX_JSON = path.join(__dirname, `../${argv.output}/index.json`); -const methods = []; - -function formatDescription (obj) { - const optional = obj.optional ? '(optional) ' : ''; - const defaults = obj.default ? `(default: ${obj.default}) ` : ''; - - return `${obj.type.name} - ${optional}${defaults}${obj.desc}`; -} - -function formatType (obj) { - if (obj.type === Object && obj.details) { - const formatted = {}; - - Object.keys(obj.details).sort().forEach((key) => { - formatted[key] = formatType(obj.details[key]); - }); - - return { - desc: formatDescription(obj), - details: formatted - }; - } else if (obj.type && obj.type.name) { - return formatDescription(obj); - } - - return obj; -} - -Object.keys(interfaces).sort().forEach((group) => { - Object.keys(interfaces[group]).sort().forEach((name) => { - const method = interfaces[group][name]; - const deprecated = method.deprecated ? ' (Deprecated and not supported, to be removed in a future version)' : ''; - - methods.push({ - name: `${group}_${name}`, - desc: `${method.desc}${deprecated}`, - params: method.params.map(formatType), - returns: formatType(method.returns), - inputFormatters: method.params.map((param) => param.format || null), - outputFormatter: method.returns.format || null - }); - }); -}); - -fs.writeFileSync(INDEX_JSON, JSON.stringify({ methods: methods }, null, 2), 'utf8'); diff --git a/js-old/scripts/build-rpc-markdown.js b/js-old/scripts/build-rpc-markdown.js deleted file mode 100644 index 7a78e1ce96c..00000000000 --- a/js-old/scripts/build-rpc-markdown.js +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import fs from 'fs'; -import path from 'path'; -import { isPlainObject } from 'lodash'; - -import { info, warn, error } from './helpers/log'; -import { Dummy } from '../src/jsonrpc/helpers'; -import interfaces from '../src/jsonrpc'; -import rustMethods from './helpers/parsed-rpc-traits'; - -const ROOT_DIR = path.join(__dirname, '../docs'); - -if (!fs.existsSync(ROOT_DIR)) { - fs.mkdirSync(ROOT_DIR); -} - -Object.keys(rustMethods).forEach((group) => { - Object.keys(rustMethods[group]).forEach((method) => { - if (interfaces[group] == null || interfaces[group][method] == null) { - error(`${group}_${method} is defined in Rust traits, but not in js/src/jsonrpc/interfaces`); - } - }); -}); - -function printType (type, obj) { - if (!type) { - throw new Error(`Invalid type in ${JSON.stringify(obj)}`); - } - - return type.print || `\`${type.name}\``; -} - -function formatDescription (obj, prefix = '', indent = '') { - const optional = obj.optional ? '(optional) ' : ''; - const defaults = obj.default ? `(default: \`${obj.default}\`) ` : ''; - - return `${indent}${prefix}${printType(obj.type, obj)} - ${optional}${defaults}${obj.desc}`; -} - -function formatType (obj) { - if (obj == null || obj.type == null) { - return obj; - } - - const details = obj.details || obj.type.details; - - if (details) { - const sub = Object.keys(details).map((key) => { - return formatDescription(details[key], `\`${key}\`: `, ' - '); - }).join('\n'); - - return `${formatDescription(obj)}\n${sub}`; - } else if (obj.type && obj.type.name) { - return formatDescription(obj); - } - - return obj; -} - -const rpcReqTemplate = { - method: 'web3_clientVersion', - params: [], - id: 1, - jsonrpc: '2.0' -}; - -const { isDummy } = Dummy; -const { isArray } = Array; - -// Checks if a field definition has an example, -// or describes an object with fields that recursively have examples of their own, -// or is optional. -function hasExample ({ optional, example, details } = {}) { - if (optional || example !== undefined) { - return true; - } - - if (details !== undefined) { - const values = Object.keys(details).map((key) => details[key]); - - return values.every(hasExample); - } - - return false; -} - -// Remove all optional (trailing) params without examples from an array -function removeOptionalWithoutExamples (arr) { - return arr.filter(({ optional, example, details }) => { - return !optional || example !== undefined || details !== undefined; - }); -} - -// Grabs JSON compatible -function getExample (obj) { - if (isArray(obj)) { - return removeOptionalWithoutExamples(obj).map(getExample); - } - - const { example, details } = obj; - - if (example === undefined && details !== undefined) { - const nested = {}; - - Object.keys(details).forEach((key) => { - nested[key] = getExample(details[key]); - }); - - return nested; - } - - return example; -} - -function stringifyExample (example, dent = '') { - const indent = `${dent} `; - - if (isDummy(example)) { - return example.toString(); - } - - if (isArray(example)) { - const last = example.length - 1; - - // If all elements are dummies, print out a single line. - // Also covers empty arrays. - if (example.every(isDummy)) { - const dummies = example.map(d => d.toString()); - - return `[${dummies.join(', ')}]`; - } - - // For arrays containing just one object or string, don't unwind the array to multiline - if (last === 0 && (isPlainObject(example[0]) || typeof example[0] === 'string')) { - return `[${stringifyExample(example[0], dent)}]`; - } - - const elements = example.map((value, index) => { - const comma = index !== last ? ',' : ''; - const comment = value != null && value._comment ? ` // ${value._comment}` : ''; - - return `${stringifyExample(value, indent)}${comma}${comment}`; - }); - - return `[\n${indent}${elements.join(`\n${indent}`)}\n${dent}]`; - } - - if (isPlainObject(example)) { - const keys = Object.keys(example); - const last = keys.length - 1; - - // print out an empty object - if (last === -1) { - return '{}'; - } - - const elements = keys.map((key, index) => { - const value = example[key]; - const comma = index !== last ? ',' : ''; - const comment = value && value._comment ? ` // ${example[key]._comment}` : ''; - - return `${JSON.stringify(key)}: ${stringifyExample(value, indent)}${comma}${comment}`; - }); - - return `{\n${indent}${elements.join(`\n${indent}`)}\n${dent}}`; - } - - return JSON.stringify(example); -} - -function buildExample (name, method) { - // deprecated, don't care - if (method.deprecated) { - return ''; - } - - const logPostfix = method.subdoc ? ` (${method.subdoc})` : ''; - - const hasReqExample = method.params.every(hasExample); - const hasResExample = hasExample(method.returns); - - if (!hasReqExample && !hasResExample) { - error(`${name} has no examples${logPostfix}`); - - return ''; - } - - const examples = []; - - if (hasReqExample) { - const params = getExample(method.params); - const req = Dummy.stringifyJSON(Object.assign({}, rpcReqTemplate, { method: name, params })); - - examples.push(`Request\n\`\`\`bash\ncurl --data '${req}' -H "Content-Type: application/json" -X POST localhost:8545\n\`\`\``); - } else { - warn(`${name} has a response example but not a request example${logPostfix}`); - } - - if (hasResExample) { - const res = stringifyExample({ - id: 1, - jsonrpc: '2.0', - result: getExample(method.returns) - }); - - examples.push(`Response\n\`\`\`js\n${res}\n\`\`\``); - } else { - if (typeof method.returns === 'string') { - info(`${name} has a request example and only text description for response${logPostfix}`); - } else { - warn(`${name} has a request example but not a response example${logPostfix}`); - } - } - - return `\n\n#### Example\n\n${examples.join('\n\n')}`; -} - -function buildParameters (params) { - if (params.length === 0) { - return ''; - } - - let md = `0. ${params.map(formatType).join('\n0. ')}`; - - if (params.length > 0 && params.every(hasExample) && !isDummy(params[0].example)) { - const example = getExample(params); - - md = `${md}\n\n\`\`\`js\nparams: ${stringifyExample(example)}\n\`\`\``; - } - - return md; -} - -Object.keys(interfaces).sort().forEach((group) => { - const spec = interfaces[group]; - - for (const key in spec) { - const method = spec[key]; - - if (!method || !method.subdoc) { - continue; - } - - const subgroup = `${group}_${method.subdoc}`; - - interfaces[subgroup] = interfaces[subgroup] || {}; - - interfaces[subgroup][key] = method; - delete spec[key]; - } -}); - -Object.keys(interfaces).sort().forEach((group) => { - let preamble = `# The \`${group}\` Module`; - let markdown = `## JSON-RPC methods\n`; - - const spec = interfaces[group]; - - if (spec._preamble) { - preamble = `${preamble}\n\n${spec._preamble}`; - } - - const content = []; - const tocMain = []; - const tocSections = {}; - - // Comparator that will sort by sections first, names second - function methodComparator (a, b) { - const sectionA = spec[a].section || ''; - const sectionB = spec[b].section || ''; - - return sectionA.localeCompare(sectionB) || a.localeCompare(b); - } - - Object.keys(spec).sort(methodComparator).forEach((iname) => { - const method = spec[iname]; - const groupName = group.replace(/_.*$/, ''); - const name = `${groupName}_${iname}`; - - if (method.nodoc || method.deprecated) { - info(`Skipping ${name}: ${method.nodoc || 'Deprecated'}`); - - return; - } - - if (rustMethods[groupName] == null || rustMethods[groupName][iname] == null) { - error(`${name} is defined in js/src/jsonrpc/interfaces, but not in Rust traits`); - } - - const desc = method.desc; - const params = buildParameters(method.params); - const returns = `- ${formatType(method.returns)}`; - const example = buildExample(name, method); - - const { section } = method; - const toc = section ? tocSections[section] = tocSections[section] || [] : tocMain; - - toc.push(`- [${name}](#${name.toLowerCase()})`); - content.push(`### ${name}\n\n${desc}\n\n#### Parameters\n\n${params || 'None'}\n\n#### Returns\n\n${returns || 'None'}${example}`); - }); - - markdown = `${markdown}\n${tocMain.join('\n')}`; - - Object.keys(tocSections).sort().forEach((section) => { - markdown = `${markdown}\n\n#### ${section}\n${tocSections[section].join('\n')}`; - }); - - markdown = `${markdown}\n\n## JSON-RPC API Reference\n\n${content.join('\n\n***\n\n')}\n\n`; - - const mdFile = path.join(ROOT_DIR, `${group}.md`); - - fs.writeFileSync(mdFile, `${preamble}\n\n${markdown}`, 'utf8'); -}); diff --git a/js-old/scripts/dryrun-npm.sh b/js-old/scripts/dryrun-npm.sh deleted file mode 100755 index bf8a151a8b0..00000000000 --- a/js-old/scripts/dryrun-npm.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -set -e - -# variables -PACKAGES=( "parity" "etherscan" "shapeshift" "jsonrpc" ) - -# change into the build directory -BASEDIR=`dirname $0` -cd $BASEDIR/.. - -# build jsonrpc -echo "*** Building JSONRPC .json" -mkdir -p .npmjs/jsonrpc -npm run ci:build:jsonrpc - -# build all packages -echo "*** Building packages for npmjs" -echo "$NPM_TOKEN" >> ~/.npmrc - -for PACKAGE in ${PACKAGES[@]} -do - echo "*** Building $PACKAGE" - LIBRARY=$PACKAGE npm run ci:build:npm - DIRECTORY=.npmjs/$PACKAGE - - cd $DIRECTORY - - echo "*** Publishing $PACKAGE from $DIRECTORY" - echo "npm publish --access public || true" - cd ../.. - -done -cd .. - -# exit with exit code -exit 0 diff --git a/js-old/scripts/helpers/log.js b/js-old/scripts/helpers/log.js deleted file mode 100644 index dc495564995..00000000000 --- a/js-old/scripts/helpers/log.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import chalk from 'chalk'; - -// INFO Logging helper -export function info (log) { - console.log(chalk.blue(`INFO:\t${log}`)); -} - -// WARN Logging helper -export function warn (log) { - console.warn(chalk.yellow(`WARN:\t${log}`)); -} - -// ERROR Logging helper -export function error (log) { - console.error(chalk.red(`ERROR:\t${log}`)); -} diff --git a/js-old/scripts/helpers/parsed-rpc-traits.js b/js-old/scripts/helpers/parsed-rpc-traits.js deleted file mode 100644 index 9f2d4ea8a47..00000000000 --- a/js-old/scripts/helpers/parsed-rpc-traits.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import fs from 'fs'; -import path from 'path'; - -// ```js -// rustMethods['eth']['call'] === true -// ``` -const rustMethods = {}; - -export default rustMethods; - -// Get a list of JSON-RPC from Rust trait source code -function parseMethodsFromRust (source) { - // Matching the custom `rpc` attribute with it's doc comment - const attributePattern = /((?:\s*\/\/\/.*$)*)\s*#\[rpc\(([^)]+)\)]/gm; - const commentPattern = /\s*\/\/\/\s*/g; - const separatorPattern = /\s*,\s*/g; - const assignPattern = /([\S]+)\s*=\s*"([^"]*)"/; - const ignorePattern = /@(ignore|deprecated|unimplemented|alias)\b/i; - - const methods = []; - - source.toString().replace(attributePattern, (match, comment, props) => { - comment = comment.replace(commentPattern, '\n').trim(); - - // Skip deprecated methods - if (ignorePattern.test(comment)) { - return match; - } - - props.split(separatorPattern).forEach((prop) => { - const [, key, value] = prop.split(assignPattern) || []; - - if (key === 'name' && value != null) { - methods.push(value); - } - }); - - return match; - }); - - return methods; -} - -// Get a list of all JSON-RPC methods from all defined traits -function getMethodsFromRustTraits () { - const traitsDir = path.join(__dirname, '../../../rpc/src/v1/traits'); - - return fs.readdirSync(traitsDir) - .filter((name) => name !== 'mod.rs' && /\.rs$/.test(name)) - .map((name) => fs.readFileSync(path.join(traitsDir, name))) - .map(parseMethodsFromRust) - .reduce((a, b) => a.concat(b)); -} - -getMethodsFromRustTraits().sort().forEach((method) => { - const [group, name] = method.split('_'); - - // Skip methods with malformed names - if (group == null || name == null) { - return; - } - - rustMethods[group] = rustMethods[group] || {}; - rustMethods[group][name] = true; -}); diff --git a/js-old/scripts/push-precompiled.sh b/js-old/scripts/push-precompiled.sh index cb20f20a183..30eee123025 100755 --- a/js-old/scripts/push-precompiled.sh +++ b/js-old/scripts/push-precompiled.sh @@ -2,51 +2,42 @@ set -e # variables +PVER="1-9" +PTYPE="v1" UTCDATE=`date -u "+%Y%m%d-%H%M%S"` -PRECOMPILED_BRANCH="v1" -GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/js-precompiled.git" +PRE_REPO="js-dist-paritytech/parity-${CI_BUILD_REF_NAME}-${PVER}-${PTYPE}.git" +PRE_REPO_TOKEN="https://${GITHUB_JS_PRECOMPILED}:@github.com/${PRE_REPO}" BASEDIR=`dirname $0` -GITLOG=./.git/.git-release.log - -# setup the git user defaults for the current repo -function setup_git_user { - git config push.default simple - git config merge.ours.driver true - git config user.email "$GITHUB_EMAIL" - git config user.name "GitLab Build Bot" -} - -# change into the build directory -pushd $BASEDIR -cd ../.dist - -# add local files and send it up -echo "*** [v1 precompiled] Setting up GitHub config for js-precompiled" -rm -rf ./.git -git init -setup_git_user - -echo "*** [v1 precompiled] Checking out $PRECOMPILED_BRANCH branch" -git remote add origin $GIT_JS_PRECOMPILED -git fetch origin 2>$GITLOG -git checkout -b $PRECOMPILED_BRANCH - -echo "*** [v1 precompiled] Committing compiled files for $UTCDATE" -mv build ../build.new -git add . -git commit -m "$UTCDATE [update]" -git merge origin/$PRECOMPILED_BRANCH -X ours --commit -m "$UTCDATE [merge]" -git rm -r build + +pushd $BASEDIR/.. + +echo "*** [$PRE_REPO] Cloning repo" +rm -rf precompiled +git clone https://github.com/$PRE_REPO precompiled +cd precompiled +git config push.default simple +git config merge.ours.driver true +git config user.email "$GITHUB_EMAIL" +git config user.name "GitLab Build Bot" +git remote set-url origin $PRE_REPO_TOKEN > /dev/null 2>&1 + +echo "*** [$PRE_REPO] Copying build" rm -rf build -git commit -m "$UTCDATE [cleanup]" -mv ../build.new build -git add . -git commit -m "$UTCDATE [release]" +cp -rf ../.dist/build . +find . -name "*.css.map" -type f -delete +find . -name "*.js.map" -type f -delete +find . -name "package.json" -type f -delete + +echo "*** [$PRE_REPO] Adding to git" +echo "$UTCDATE" >README.md +git add --all . +git commit -m "$UTCDATE" -echo "*** [v1 precompiled] Merging remote" -git push origin HEAD:refs/heads/$PRECOMPILED_BRANCH 2>$GITLOG +echo "*** [$PRE_REPO] Pushing upstream" +git push --quiet origin HEAD:refs/heads/master > /dev/null 2>&1 -# move to root +cd .. +rm -rf .dist .build .happypack precompiled popd # exit with exit code diff --git a/js-old/scripts/test.js b/js-old/scripts/test.js index 5f113bad72d..a6f52629693 100644 --- a/js-old/scripts/test.js +++ b/js-old/scripts/test.js @@ -1 +1 @@ -// test script 14 +// test script 21 diff --git a/js-old/src/3rdparty/etherscan/account.js b/js-old/src/3rdparty/etherscan/account.js index 7a684475911..1012a272727 100644 --- a/js-old/src/3rdparty/etherscan/account.js +++ b/js-old/src/3rdparty/etherscan/account.js @@ -18,7 +18,7 @@ import BigNumber from 'bignumber.js'; const PAGE_SIZE = 25; -import util from '../../api/util'; +import util from '@parity/api/lib/util'; import { call } from './call'; function _call (method, params, test, netVersion) { diff --git a/js-old/src/abi/README.md b/js-old/src/abi/README.md deleted file mode 100644 index 20bc094ded6..00000000000 --- a/js-old/src/abi/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# ethabi-js - -A very early, very POC-type port of [https://github.com/paritytech/ethabi](https://github.com/paritytech/ethabi) to JavaScript - -[![Build Status](https://travis-ci.org/jacogr/ethabi-js.svg?branch=master)](https://travis-ci.org/jacogr/ethabi-js) -[![Coverage Status](https://coveralls.io/repos/github/jacogr/ethabi-js/badge.svg?branch=master)](https://coveralls.io/github/jacogr/ethabi-js?branch=master) -[![Dependency Status](https://david-dm.org/jacogr/ethabi-js.svg)](https://david-dm.org/jacogr/ethabi-js) -[![devDependency Status](https://david-dm.org/jacogr/ethabi-js/dev-status.svg)](https://david-dm.org/jacogr/ethabi-js#info=devDependencies) - -## contributing - -Clone the repo and install dependencies via `npm install`. Tests can be executed via - -- `npm run testOnce` (100% covered unit tests) - -## installation - -Install the package with `npm install --save ethabi-js` from the [npm registry ethabi-js](https://www.npmjs.com/package/ethabi-js) - - -## implementation -### approach - -- this version tries to stay as close to the original Rust version in intent, function names & purpose -- it is a basic port of the Rust version, relying on effectively the same test-suite (expanded where deemed appropriate) -- it is meant as a library to be used in other projects, i.e. [ethapi-js](https://www.npmjs.com/package/ethapi-js) - -### differences to original Rust version - -- internally the library operates on string binary representations as opposed to Vector bytes, lengths are therefore 64 bytes as opposed to 32 bytes -- function names are adapted from the Rust standard snake_case to the JavaScript standard camelCase -- due to the initial library focus, the cli component (as implemented by the original) is not supported nor mplemented diff --git a/js-old/src/abi/decoder/bytesTaken.js b/js-old/src/abi/decoder/bytesTaken.js deleted file mode 100644 index dbf766f4bf1..00000000000 --- a/js-old/src/abi/decoder/bytesTaken.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default class BytesTaken { - constructor (bytes, newOffset) { - this._bytes = bytes; - this._newOffset = newOffset; - } - - get bytes () { - return this._bytes; - } - - get newOffset () { - return this._newOffset; - } -} diff --git a/js-old/src/abi/decoder/bytesTaken.spec.js b/js-old/src/abi/decoder/bytesTaken.spec.js deleted file mode 100644 index 9329657e48a..00000000000 --- a/js-old/src/abi/decoder/bytesTaken.spec.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BytesTaken from './bytesTaken'; - -describe('abi/decoder/BytesTaken', () => { - describe('constructor', () => { - it('sets the bytes of the object', () => { - expect((new BytesTaken(1, 2)).bytes).to.equal(1); - }); - - it('sets the newOffset of the object', () => { - expect((new BytesTaken(3, 4)).newOffset).to.equal(4); - }); - }); -}); diff --git a/js-old/src/abi/decoder/decodeResult.js b/js-old/src/abi/decoder/decodeResult.js deleted file mode 100644 index 5e41da4b60a..00000000000 --- a/js-old/src/abi/decoder/decodeResult.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default class DecodeResult { - constructor (token, newOffset) { - this._token = token; - this._newOffset = newOffset; - } - - get token () { - return this._token; - } - - get newOffset () { - return this._newOffset; - } -} diff --git a/js-old/src/abi/decoder/decodeResult.spec.js b/js-old/src/abi/decoder/decodeResult.spec.js deleted file mode 100644 index 0c4c81c5c4f..00000000000 --- a/js-old/src/abi/decoder/decodeResult.spec.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import DecodeResult from './decodeResult'; - -describe('abi/decoder/DecodeResult', () => { - describe('constructor', () => { - it('sets the token of the object', () => { - expect((new DecodeResult('token', 2)).token).to.equal('token'); - }); - - it('sets the newOffset of the object', () => { - expect((new DecodeResult('baz', 4)).newOffset).to.equal(4); - }); - }); -}); diff --git a/js-old/src/abi/decoder/decoder.js b/js-old/src/abi/decoder/decoder.js deleted file mode 100644 index 6922c91e800..00000000000 --- a/js-old/src/abi/decoder/decoder.js +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import utf8 from 'utf8'; - -import Token from '../token/token'; -import BytesTaken from './bytesTaken'; -import DecodeResult from './decodeResult'; -import ParamType from '../spec/paramType/paramType'; -import { sliceData } from '../util/slice'; -import { asAddress, asBool, asI32, asU32 } from '../util/sliceAs'; -import { isArray, isInstanceOf } from '../util/types'; - -const NULL = '0000000000000000000000000000000000000000000000000000000000000000'; - -export default class Decoder { - static decode (params, data) { - if (!isArray(params)) { - throw new Error('Parameters should be array of ParamType'); - } - - const slices = sliceData(data); - let offset = 0; - - return params.map((param) => { - const result = Decoder.decodeParam(param, slices, offset); - - offset = result.newOffset; - return result.token; - }); - } - - static peek (slices, position) { - if (!slices || !slices[position]) { - return NULL; - } - - return slices[position]; - } - - static takeBytes (slices, position, length) { - const slicesLength = Math.floor((length + 31) / 32); - let bytesStr = ''; - - for (let idx = 0; idx < slicesLength; idx++) { - bytesStr = `${bytesStr}${Decoder.peek(slices, position + idx)}`; - } - - const bytes = (bytesStr.substr(0, length * 2).match(/.{1,2}/g) || []).map((code) => parseInt(code, 16)); - - return new BytesTaken(bytes, position + slicesLength); - } - - static decodeParam (param, slices, offset) { - if (!isInstanceOf(param, ParamType)) { - throw new Error('param should be instanceof ParamType'); - } - - const tokens = []; - let taken; - let lengthOffset; - let length; - let newOffset; - - switch (param.type) { - case 'address': - return new DecodeResult(new Token(param.type, asAddress(Decoder.peek(slices, offset))), offset + 1); - - case 'bool': - return new DecodeResult(new Token(param.type, asBool(Decoder.peek(slices, offset))), offset + 1); - - case 'int': - return new DecodeResult(new Token(param.type, asI32(Decoder.peek(slices, offset))), offset + 1); - - case 'uint': - return new DecodeResult(new Token(param.type, asU32(Decoder.peek(slices, offset))), offset + 1); - - case 'fixedBytes': - taken = Decoder.takeBytes(slices, offset, param.length); - - return new DecodeResult(new Token(param.type, taken.bytes), taken.newOffset); - - case 'bytes': - lengthOffset = asU32(Decoder.peek(slices, offset)).div(32).toNumber(); - length = asU32(Decoder.peek(slices, lengthOffset)).toNumber(); - taken = Decoder.takeBytes(slices, lengthOffset + 1, length); - - return new DecodeResult(new Token(param.type, taken.bytes), offset + 1); - - case 'string': - if (param.indexed) { - taken = Decoder.takeBytes(slices, offset, 32); - - return new DecodeResult(new Token('fixedBytes', taken.bytes), offset + 1); - } - - lengthOffset = asU32(Decoder.peek(slices, offset)).div(32).toNumber(); - length = asU32(Decoder.peek(slices, lengthOffset)).toNumber(); - taken = Decoder.takeBytes(slices, lengthOffset + 1, length); - - const str = taken.bytes.map((code) => String.fromCharCode(code)).join(''); - - let decoded; - - try { - decoded = utf8.decode(str); - } catch (error) { - decoded = str; - } - - return new DecodeResult(new Token(param.type, decoded), offset + 1); - - case 'array': - lengthOffset = asU32(Decoder.peek(slices, offset)).div(32).toNumber(); - length = asU32(Decoder.peek(slices, lengthOffset)).toNumber(); - newOffset = lengthOffset + 1; - - for (let idx = 0; idx < length; idx++) { - const result = Decoder.decodeParam(param.subtype, slices, newOffset); - - newOffset = result.newOffset; - tokens.push(result.token); - } - - return new DecodeResult(new Token(param.type, tokens), offset + 1); - - case 'fixedArray': - newOffset = offset; - - for (let idx = 0; idx < param.length; idx++) { - const result = Decoder.decodeParam(param.subtype, slices, newOffset); - - newOffset = result.newOffset; - tokens.push(result.token); - } - - return new DecodeResult(new Token(param.type, tokens), newOffset); - - default: - throw new Error(`Invalid param type ${param.type} in decodeParam`); - } - } -} diff --git a/js-old/src/abi/decoder/decoder.spec.js b/js-old/src/abi/decoder/decoder.spec.js deleted file mode 100644 index 5065be3a7ee..00000000000 --- a/js-old/src/abi/decoder/decoder.spec.js +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -import Decoder from './decoder'; -import ParamType from '../spec/paramType'; -import Token from '../token'; -import { padU32 } from '../util/pad'; - -describe('abi/decoder/Decoder', () => { - const stringToBytes = function (str) { - return str.match(/.{1,2}/g).map((code) => parseInt(code, 16)); - }; - - const address1 = '0000000000000000000000001111111111111111111111111111111111111111'; - const address2 = '0000000000000000000000002222222222222222222222222222222222222222'; - const address3 = '0000000000000000000000003333333333333333333333333333333333333333'; - const address4 = '0000000000000000000000004444444444444444444444444444444444444444'; - const bool1 = '0000000000000000000000000000000000000000000000000000000000000001'; - const bytes1 = '1234000000000000000000000000000000000000000000000000000000000000'; - const bytes2 = '1000000000000000000000000000000000000000000000000000000000000000'; - const bytes3 = '10000000000000000000000000000000000000000000000000000000000002'; - const bytes4 = '0010000000000000000000000000000000000000000000000000000000000002'; - const int1 = '0111111111111111111111111111111111111111111111111111111111111111'; - const intn = 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85'; - const string1 = '6761766f66796f726b0000000000000000000000000000000000000000000000'; - const string2 = '4665726ee16e64657a0000000000000000000000000000000000000000000000'; - const tokenAddress1 = new Token('address', `0x${address1.slice(-40)}`); - const tokenAddress2 = new Token('address', `0x${address2.slice(-40)}`); - const tokenAddress3 = new Token('address', `0x${address3.slice(-40)}`); - const tokenAddress4 = new Token('address', `0x${address4.slice(-40)}`); - const tokenBool1 = new Token('bool', true); - const tokenFixedBytes1 = new Token('fixedBytes', [0x12, 0x34]); - const tokenBytes1 = new Token('bytes', [0x12, 0x34]); - const tokenBytes2 = new Token('bytes', stringToBytes(bytes2).concat(stringToBytes(bytes2))); - const tokenBytes3 = new Token('bytes', stringToBytes(bytes3)); - const tokenBytes4 = new Token('bytes', stringToBytes(bytes4)); - const tokenInt1 = new Token('int', new BigNumber(int1, 16)); - const tokenIntn = new Token('int', new BigNumber(-123)); - const tokenUint1 = new Token('uint', new BigNumber(int1, 16)); - const tokenUintn = new Token('uint', new BigNumber(intn, 16)); - const tokenString1 = new Token('string', 'gavofyork'); - const tokenString2 = new Token('string', 'Fernández'); - const slices = [ address1, address2, address3, address4 ]; - - describe('peek', () => { - it('returns the slice at the correct position', () => { - expect(Decoder.peek(slices, 1)).to.equal(slices[1]); - }); - - it('returns empty on invalid slices', () => { - expect(Decoder.peek(null, 4)).to.equal('0000000000000000000000000000000000000000000000000000000000000000'); - }); - }); - - describe('takeBytes', () => { - it('returns a single slice', () => { - expect(Decoder.takeBytes(slices, 0, 32).bytes).to.deep.equal(stringToBytes(slices[0])); - }); - - it('returns a single partial slice', () => { - expect(Decoder.takeBytes(slices, 0, 20).bytes).to.deep.equal(stringToBytes(slices[0].substr(0, 40))); - }); - - it('returns multiple slices', () => { - expect(Decoder.takeBytes(slices, 0, 64).bytes).to.deep.equal(stringToBytes(`${slices[0]}${slices[1]}`)); - }); - - it('returns a single offset slice', () => { - expect(Decoder.takeBytes(slices, 1, 32).bytes).to.deep.equal(stringToBytes(slices[1])); - }); - - it('returns multiple offset slices', () => { - expect(Decoder.takeBytes(slices, 1, 64).bytes).to.deep.equal(stringToBytes(`${slices[1]}${slices[2]}`)); - }); - - it('returns the requires length from slices', () => { - expect( - Decoder.takeBytes(slices, 1, 75).bytes - ).to.deep.equal(stringToBytes(`${slices[1]}${slices[2]}${slices[3]}`.substr(0, 150))); - }); - }); - - describe('decodeParam', () => { - it('throws an error on non ParamType param', () => { - expect(() => Decoder.decodeParam({})).to.throw(/ParamType/); - }); - - it('throws an error on invalid param type', () => { - const pt = new ParamType('address'); - - pt._type = 'noMatch'; - - expect(() => Decoder.decodeParam(pt)).to.throw(/noMatch/); - }); - - it('decodes an address', () => { - expect( - Decoder.decodeParam(new ParamType('address'), [address1], 0).token - ).to.deep.equal(tokenAddress1); - }); - - it('decodes a bool', () => { - expect( - Decoder.decodeParam(new ParamType('bool'), [bool1], 0).token - ).to.deep.equal(tokenBool1); - }); - - it('decodes an int', () => { - expect( - Decoder.decodeParam(new ParamType('int'), [int1], 0).token - ).to.deep.equal(tokenInt1); - }); - - it('decodes a negative int', () => { - expect( - Decoder.decodeParam(new ParamType('int'), [intn], 0).token - ).to.deep.equal(tokenIntn); - }); - - it('decodes an uint', () => { - expect( - Decoder.decodeParam(new ParamType('uint'), [int1], 0).token - ).to.deep.equal(tokenUint1); - }); - - it('decodes an uint (negative as int)', () => { - expect( - Decoder.decodeParam(new ParamType('uint'), [intn], 0).token - ).to.deep.equal(tokenUintn); - }); - - it('decodes fixedBytes', () => { - expect( - Decoder.decodeParam(new ParamType('fixedBytes', null, 2), [bytes1], 0).token - ).to.deep.equal(tokenFixedBytes1); - }); - - it('decodes bytes', () => { - expect( - Decoder.decodeParam(new ParamType('bytes'), [padU32(0x20), padU32(2), bytes1], 0).token - ).to.deep.equal(tokenBytes1); - }); - - it('decodes string', () => { - expect( - Decoder.decodeParam(new ParamType('string'), [padU32(0x20), padU32(9), string1], 0).token - ).to.deep.equal(tokenString1); - }); - - it('decodes utf8-invalid string', () => { - expect( - Decoder.decodeParam(new ParamType('string'), [padU32(0x20), padU32(9), string2], 0).token - ).to.deep.equal(tokenString2); - }); - - it('decodes string (indexed)', () => { - expect( - Decoder.decodeParam(new ParamType('string', null, 0, true), [bytes1], 0) - ).to.deep.equal(Decoder.decodeParam(new ParamType('fixedBytes', null, 32, true), [bytes1], 0)); - }); - }); - - describe('decode', () => { - it('throws an error on invalid params', () => { - expect(() => Decoder.decode(null, '123')).to.throw(/array/); - }); - - describe('address', () => { - it('decodes an address', () => { - expect( - Decoder.decode( - [new ParamType('address')], - `${address1}` - ) - ).to.deep.equal([tokenAddress1]); - }); - - it('decodes 2 addresses', () => { - expect( - Decoder.decode( - [new ParamType('address'), new ParamType('address')], - `${address1}${address2}` - ) - ).to.deep.equal([tokenAddress1, tokenAddress2]); - }); - - it('decodes a fixedArray of addresses', () => { - expect( - Decoder.decode( - [new ParamType('fixedArray', new ParamType('address'), 2)], - `${address1}${address2}` - ) - ).to.deep.equal([new Token('fixedArray', [tokenAddress1, tokenAddress2])]); - }); - - it('decodes a dynamic array of addresses', () => { - expect( - Decoder.decode( - [new ParamType('array', new ParamType('address'))], - `${padU32(0x20)}${padU32(2)}${address1}${address2}` - ) - ).to.deep.equal([new Token('array', [tokenAddress1, tokenAddress2])]); - }); - - it('decodes a dynamic array of fixed arrays', () => { - expect( - Decoder.decode( - [new ParamType('array', new ParamType('fixedArray', new ParamType('address'), 2))], - `${padU32(0x20)}${padU32(2)}${address1}${address2}${address3}${address4}` - ) - ).to.deep.equal([ - new Token('array', [ - new Token('fixedArray', [tokenAddress1, tokenAddress2]), - new Token('fixedArray', [tokenAddress3, tokenAddress4]) - ]) - ]); - }); - }); - - describe('int', () => { - it('decodes an int', () => { - expect( - Decoder.decode( - [new ParamType('int')], - `${int1}` - ) - ).to.deep.equal([tokenInt1]); - }); - }); - - describe('uint', () => { - it('decodes an uint', () => { - expect( - Decoder.decode( - [new ParamType('uint')], - `${int1}` - ) - ).to.deep.equal([tokenUint1]); - }); - }); - - describe('fixedBytes', () => { - it('decodes fixedBytes', () => { - expect( - Decoder.decode( - [new ParamType('fixedBytes', null, 2)], - `${bytes1}` - ) - ).to.deep.equal([tokenFixedBytes1]); - }); - }); - - describe('bytes', () => { - it('decodes bytes', () => { - expect( - Decoder.decode( - [new ParamType('bytes')], - `${padU32(0x20)}${padU32(2)}${bytes1}` - ) - ).to.deep.equal([tokenBytes1]); - }); - - it('decodes bytes sequence', () => { - expect( - Decoder.decode( - [new ParamType('bytes')], - `${padU32(0x20)}${padU32(0x40)}${bytes2}${bytes2}` - ) - ).to.deep.equal([tokenBytes2]); - }); - - it('decodes bytes seuence (2)', () => { - expect( - Decoder.decode( - [new ParamType('bytes'), new ParamType('bytes')], - `${padU32(0x40)}${padU32(0x80)}${padU32(0x1f)}${bytes3}00${padU32(0x20)}${bytes4}` - ) - ).to.deep.equal([tokenBytes3, tokenBytes4]); - }); - }); - - describe('bool', () => { - it('decodes a single bool', () => { - expect( - Decoder.decode( - [new ParamType('bool')], - bool1 - ) - ).to.deep.equal([tokenBool1]); - }); - }); - - describe('string', () => { - it('decodes a string', () => { - expect( - Decoder.decode( - [new ParamType('string')], - `${padU32(0x20)}${padU32(9)}${string1}` - ) - ).to.deep.equal([tokenString1]); - }); - }); - }); -}); diff --git a/js-old/src/abi/encoder/encoder.js b/js-old/src/abi/encoder/encoder.js deleted file mode 100644 index fa1aa04538a..00000000000 --- a/js-old/src/abi/encoder/encoder.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { padAddress, padBool, padBytes, padFixedBytes, padU32, padString } from '../util/pad'; -import Mediate from './mediate'; -import Token from '../token/token'; -import { isArray, isInstanceOf } from '../util/types'; - -export default class Encoder { - static encode (tokens) { - if (!isArray(tokens)) { - throw new Error('tokens should be array of Token'); - } - - const mediates = tokens.map((token, index) => Encoder.encodeToken(token, index)); - const inits = mediates - .map((mediate, idx) => mediate.init(Mediate.offsetFor(mediates, idx))) - .join(''); - const closings = mediates - .map((mediate, idx) => mediate.closing(Mediate.offsetFor(mediates, idx))) - .join(''); - - return `${inits}${closings}`; - } - - static encodeToken (token, index = 0) { - if (!isInstanceOf(token, Token)) { - throw new Error('token should be instanceof Token'); - } - - try { - switch (token.type) { - case 'address': - return new Mediate('raw', padAddress(token.value)); - - case 'int': - case 'uint': - return new Mediate('raw', padU32(token.value)); - - case 'bool': - return new Mediate('raw', padBool(token.value)); - - case 'fixedBytes': - return new Mediate('raw', padFixedBytes(token.value)); - - case 'bytes': - return new Mediate('prefixed', padBytes(token.value)); - - case 'string': - return new Mediate('prefixed', padString(token.value)); - - case 'fixedArray': - case 'array': - return new Mediate(token.type, token.value.map((token) => Encoder.encodeToken(token))); - } - } catch (e) { - throw new Error(`Cannot encode token #${index} [${token.type}: ${token.value}]. ${e.message}`); - } - - throw new Error(`Invalid token type ${token.type} in encodeToken`); - } -} diff --git a/js-old/src/abi/encoder/encoder.spec.js b/js-old/src/abi/encoder/encoder.spec.js deleted file mode 100644 index 9a4a24361ff..00000000000 --- a/js-old/src/abi/encoder/encoder.spec.js +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Encoder from './encoder'; -import Token from '../token'; -import { padAddress, padFixedBytes, padU32 } from '../util/pad'; - -describe('abi/encoder/Encoder', () => { - describe('encodeToken', () => { - it('requires token as Token', () => { - expect(() => Encoder.encodeToken()).to.throw(/Token/); - }); - - it('encodes address tokens in Mediate(raw)', () => { - const mediate = Encoder.encodeToken(new Token('address', '123')); - - expect(mediate.type).to.equal('raw'); - expect(mediate.value).to.be.ok; - }); - - it('encodes bool tokens in Mediate(raw)', () => { - const mediatet = Encoder.encodeToken(new Token('bool', true)); - const mediatef = Encoder.encodeToken(new Token('bool', false)); - - expect(mediatet.type).to.equal('raw'); - expect(mediatet.value).to.be.ok; - - expect(mediatef.type).to.equal('raw'); - expect(mediatef.value).to.be.ok; - }); - - it('encodes int tokens in Mediate(raw)', () => { - const mediate = Encoder.encodeToken(new Token('int', '123')); - - expect(mediate.type).to.equal('raw'); - expect(mediate.value).to.be.ok; - }); - - it('encodes uint tokens in Mediate(raw)', () => { - const mediate = Encoder.encodeToken(new Token('uint', '123')); - - expect(mediate.type).to.equal('raw'); - expect(mediate.value).to.be.ok; - }); - - it('encodes fixedBytes tokens in Mediate(raw)', () => { - const mediate = Encoder.encodeToken(new Token('fixedBytes', '123')); - - expect(mediate.type).to.equal('raw'); - expect(mediate.value).to.be.ok; - }); - - it('encodes bytes tokens in Mediate(prefixed)', () => { - const mediate = Encoder.encodeToken(new Token('bytes', '123')); - - expect(mediate.type).to.equal('prefixed'); - expect(mediate.value).to.be.ok; - }); - - it('encodes string tokens in Mediate(prefixed)', () => { - const mediate = Encoder.encodeToken(new Token('string', '123')); - - expect(mediate.type).to.equal('prefixed'); - expect(mediate.value).to.be.ok; - }); - - it('encodes fixedArray tokens in Mediate(fixedArray)', () => { - const mediate = Encoder.encodeToken(new Token('fixedArray', [new Token('uint', '123')])); - - expect(mediate.type).to.equal('fixedArray'); - expect(mediate.value).to.be.ok; - }); - - it('encodes array tokens in Mediate(array)', () => { - const mediate = Encoder.encodeToken(new Token('array', [new Token('uint', '123')])); - - expect(mediate.type).to.equal('array'); - expect(mediate.value).to.be.ok; - }); - - it('throws an Error on invalid tokens', () => { - const token = new Token('address'); - - token._type = 'noMatch'; - - expect(() => Encoder.encodeToken(token)).to.throw(/noMatch/); - }); - }); - - describe('encode', () => { - it('requires tokens array', () => { - expect(() => Encoder.encode()).to.throw(/array/); - }); - - describe('addresses', () => { - const address1 = '1111111111111111111111111111111111111111'; - const address2 = '2222222222222222222222222222222222222222'; - const address3 = '3333333333333333333333333333333333333333'; - const address4 = '4444444444444444444444444444444444444444'; - const encAddress1 = padAddress(address1); - const encAddress2 = padAddress(address2); - const encAddress3 = padAddress(address3); - const encAddress4 = padAddress(address4); - const tokenAddress1 = new Token('address', address1); - const tokenAddress2 = new Token('address', address2); - const tokenAddress3 = new Token('address', address3); - const tokenAddress4 = new Token('address', address4); - - it('encodes an address', () => { - const token = tokenAddress1; - - expect(Encoder.encode([token])).to.equal(encAddress1); - }); - - it('encodes an array of addresses', () => { - const expected = `${padU32(0x20)}${padU32(2)}${encAddress1}${encAddress2}`; - const token = new Token('array', [tokenAddress1, tokenAddress2]); - - expect(Encoder.encode([token])).to.equal(expected); - }); - - it('encodes an fixedArray of addresses', () => { - const expected = `${encAddress1}${encAddress2}`; - const token = new Token('fixedArray', [tokenAddress1, tokenAddress2]); - - expect(Encoder.encode([token])).to.equal(expected); - }); - - it('encodes two addresses', () => { - const expected = `${encAddress1}${encAddress2}`; - const tokens = [tokenAddress1, tokenAddress2]; - - expect(Encoder.encode(tokens)).to.equal(expected); - }); - - it('encodes fixed array of dynamic array addresses', () => { - const tokens1 = new Token('array', [tokenAddress1, tokenAddress2]); - const tokens2 = new Token('array', [tokenAddress3, tokenAddress4]); - const fixed = new Token('fixedArray', [tokens1, tokens2]); - const expected = `${padU32(0x40)}${padU32(0xa0)}${padU32(2)}${encAddress1}${encAddress2}${padU32(2)}${encAddress3}${encAddress4}`; - - expect(Encoder.encode([fixed])).to.equal(expected); - }); - - it('encodes dynamic array of fixed array addresses', () => { - const tokens1 = new Token('fixedArray', [tokenAddress1, tokenAddress2]); - const tokens2 = new Token('fixedArray', [tokenAddress3, tokenAddress4]); - const dynamic = new Token('array', [tokens1, tokens2]); - const expected = `${padU32(0x20)}${padU32(2)}${encAddress1}${encAddress2}${encAddress3}${encAddress4}`; - - expect(Encoder.encode([dynamic])).to.equal(expected); - }); - - it('encodes dynamic array of dynamic array addresses', () => { - const tokens1 = new Token('array', [tokenAddress1]); - const tokens2 = new Token('array', [tokenAddress2]); - const dynamic = new Token('array', [tokens1, tokens2]); - const expected = `${padU32(0x20)}${padU32(2)}${padU32(0x80)}${padU32(0xc0)}${padU32(1)}${encAddress1}${padU32(1)}${encAddress2}`; - - expect(Encoder.encode([dynamic])).to.equal(expected); - }); - - it('encodes dynamic array of dynamic array addresses (2)', () => { - const tokens1 = new Token('array', [tokenAddress1, tokenAddress2]); - const tokens2 = new Token('array', [tokenAddress3, tokenAddress4]); - const dynamic = new Token('array', [tokens1, tokens2]); - const expected = `${padU32(0x20)}${padU32(2)}${padU32(0x80)}${padU32(0xe0)}${padU32(2)}${encAddress1}${encAddress2}${padU32(2)}${encAddress3}${encAddress4}`; - - expect(Encoder.encode([dynamic])).to.equal(expected); - }); - - it('encodes fixed array of fixed array addresses', () => { - const tokens1 = new Token('fixedArray', [tokenAddress1, tokenAddress2]); - const tokens2 = new Token('fixedArray', [tokenAddress3, tokenAddress4]); - const dynamic = new Token('fixedArray', [tokens1, tokens2]); - const expected = `${encAddress1}${encAddress2}${encAddress3}${encAddress4}`; - - expect(Encoder.encode([dynamic])).to.equal(expected); - }); - }); - - describe('bytes', () => { - const bytes1 = '0x1234'; - const bytes2 = '0x10000000000000000000000000000000000000000000000000000000000002'; - const bytes3 = '0x1000000000000000000000000000000000000000000000000000000000000000'; - - it('encodes fixed bytes', () => { - const token = new Token('fixedBytes', bytes1); - - expect(Encoder.encode([token])).to.equal(padFixedBytes(bytes1)); - }); - - it('encodes bytes', () => { - const token = new Token('bytes', bytes1); - - expect(Encoder.encode([token])).to.equal(`${padU32(0x20)}${padU32(2)}${padFixedBytes(bytes1)}`); - }); - - it('encodes bytes (short of boundary)', () => { - const token = new Token('bytes', bytes2); - - expect(Encoder.encode([token])).to.equal(`${padU32(0x20)}${padU32(0x1f)}${padFixedBytes(bytes2)}`); - }); - - it('encodes bytes (two blocks)', () => { - const input = `${bytes3}${bytes3.slice(-64)}`; - const token = new Token('bytes', input); - - expect(Encoder.encode([token])).to.equal(`${padU32(0x20)}${padU32(0x40)}${padFixedBytes(input)}`); - }); - - it('encodes two consecutive bytes', () => { - const in1 = '0x10000000000000000000000000000000000000000000000000000000000002'; - const in2 = '0x0010000000000000000000000000000000000000000000000000000000000002'; - const tokens = [new Token('bytes', in1), new Token('bytes', in2)]; - - expect(Encoder.encode(tokens)).to.equal(`${padU32(0x40)}${padU32(0x80)}${padU32(0x1f)}${padFixedBytes(in1)}${padU32(0x20)}${padFixedBytes(in2)}`); - }); - }); - - describe('string', () => { - it('encodes a string', () => { - const string = 'gavofyork'; - const stringEnc = padFixedBytes('0x6761766f66796f726b'); - const token = new Token('string', string); - - expect(Encoder.encode([token])).to.equal(`${padU32(0x20)}${padU32(string.length.toString(16))}${stringEnc}`); - }); - }); - - describe('uint', () => { - it('encodes a uint', () => { - const token = new Token('uint', 4); - - expect(Encoder.encode([token])).to.equal(padU32(4)); - }); - }); - - describe('int', () => { - it('encodes a int', () => { - const token = new Token('int', 4); - - expect(Encoder.encode([token])).to.equal(padU32(4)); - }); - }); - - describe('bool', () => { - it('encodes a bool (true)', () => { - const token = new Token('bool', true); - - expect(Encoder.encode([token])).to.equal(padU32(1)); - }); - - it('encodes a bool (false)', () => { - const token = new Token('bool', false); - - expect(Encoder.encode([token])).to.equal(padU32(0)); - }); - }); - - describe('comprehensive test', () => { - it('encodes a complex sequence', () => { - const bytes = '0x131a3afc00d1b1e3461b955e53fc866dcf303b3eb9f4c16f89e388930f48134b131a3afc00d1b1e3461b955e53fc866dcf303b3eb9f4c16f89e388930f48134b'; - const tokens = [new Token('int', 5), new Token('bytes', bytes), new Token('int', 3), new Token('bytes', bytes)]; - - expect(Encoder.encode(tokens)).to.equal(`${padU32(5)}${padU32(0x80)}${padU32(3)}${padU32(0xe0)}${padU32(0x40)}${bytes.substr(2)}${padU32(0x40)}${bytes.substr(2)}`); - }); - - it('encodes a complex sequence (nested)', () => { - const array = [new Token('int', 5), new Token('int', 6), new Token('int', 7)]; - const tokens = [new Token('int', 1), new Token('string', 'gavofyork'), new Token('int', 2), new Token('int', 3), new Token('int', 4), new Token('array', array)]; - const stringEnc = padFixedBytes('0x6761766f66796f726b'); - - expect(Encoder.encode(tokens)).to.equal(`${padU32(1)}${padU32(0xc0)}${padU32(2)}${padU32(3)}${padU32(4)}${padU32(0x100)}${padU32(9)}${stringEnc}${padU32(3)}${padU32(5)}${padU32(6)}${padU32(7)}`); - }); - }); - }); -}); diff --git a/js-old/src/abi/encoder/index.js b/js-old/src/abi/encoder/index.js deleted file mode 100644 index 5ac3c0a6b21..00000000000 --- a/js-old/src/abi/encoder/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './encoder'; diff --git a/js-old/src/abi/encoder/mediate.js b/js-old/src/abi/encoder/mediate.js deleted file mode 100644 index 90cc28881d7..00000000000 --- a/js-old/src/abi/encoder/mediate.js +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -const TYPES = ['raw', 'prefixed', 'fixedArray', 'array']; - -import { padU32 } from '../util/pad'; - -export default class Mediate { - constructor (type, value) { - Mediate.validateType(type); - - this._type = type; - this._value = value; - } - - initLength () { - switch (this._type) { - case 'raw': - return this._value.length / 2; - - case 'array': - case 'prefixed': - return 32; - - case 'fixedArray': - return this._value - .reduce((total, mediate) => { - return total + mediate.initLength(); - }, 0); - } - } - - closingLength () { - switch (this._type) { - case 'raw': - return 0; - - case 'prefixed': - return this._value.length / 2; - - case 'array': - return this._value - .reduce((total, mediate) => { - return total + mediate.initLength(); - }, 32); - - case 'fixedArray': - return this._value - .reduce((total, mediate) => { - return total + mediate.initLength() + mediate.closingLength(); - }, 0); - } - } - - init (suffixOffset) { - switch (this._type) { - case 'raw': - return this._value; - - case 'fixedArray': - return this._value - .map((mediate, idx) => mediate.init(Mediate.offsetFor(this._value, idx)).toString(16)) - .join(''); - - case 'prefixed': - case 'array': - return padU32(suffixOffset); - } - } - - closing (offset) { - switch (this._type) { - case 'raw': - return ''; - - case 'prefixed': - return this._value; - - case 'fixedArray': - return this._value - .map((mediate, idx) => mediate.closing(Mediate.offsetFor(this._value, idx)).toString(16)) - .join(''); - - case 'array': - const prefix = padU32(this._value.length); - const inits = this._value - .map((mediate, idx) => mediate.init(offset + Mediate.offsetFor(this._value, idx) + 32).toString(16)) - .join(''); - const closings = this._value - .map((mediate, idx) => mediate.closing(offset + Mediate.offsetFor(this._value, idx)).toString(16)) - .join(''); - - return `${prefix}${inits}${closings}`; - } - } - - get type () { - return this._type; - } - - get value () { - return this._value; - } - - static offsetFor (mediates, position) { - if (position < 0 || position >= mediates.length) { - throw new Error(`Invalid position ${position} specified for Mediate.offsetFor`); - } - - const initLength = mediates - .reduce((total, mediate) => { - return total + mediate.initLength(); - }, 0); - - return mediates - .slice(0, position) - .reduce((total, mediate) => { - return total + mediate.closingLength(); - }, initLength); - } - - static validateType (type) { - if (TYPES.filter((_type) => type === _type).length) { - return true; - } - - throw new Error(`Invalid type ${type} received for Mediate.validateType`); - } -} diff --git a/js-old/src/abi/encoder/mediate.spec.js b/js-old/src/abi/encoder/mediate.spec.js deleted file mode 100644 index ab89909b1ed..00000000000 --- a/js-old/src/abi/encoder/mediate.spec.js +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Mediate from './mediate'; - -describe('abi/encoder/Mediate', () => { - const LONG15 = '1234567890abcdef000000000000000000000000000000000000000000000000'; - const DOUBLE15 = `${LONG15}${LONG15}`; - const ARRAY = [new Mediate('raw', DOUBLE15), new Mediate('raw', LONG15)]; - - describe('validateType', () => { - it('validates raw', () => { - expect(Mediate.validateType('raw')).to.be.true; - }); - - it('validates prefixed', () => { - expect(Mediate.validateType('prefixed')).to.be.true; - }); - - it('validates fixedArray', () => { - expect(Mediate.validateType('fixedArray')).to.be.true; - }); - - it('validates array', () => { - expect(Mediate.validateType('array')).to.be.true; - }); - - it('throws an error on invalid types', () => { - expect(() => Mediate.validateType('noMatch')).to.throw(/noMatch/); - }); - }); - - describe('offsetFor', () => { - it('thows an error when offset < 0', () => { - expect(() => Mediate.offsetFor([1], -1)).to.throw(/Invalid position/); - }); - - it('throws an error when offset >= length', () => { - expect(() => Mediate.offsetFor([1], 1)).to.throw(/Invalid position/); - }); - }); - - describe('constructor', () => { - it('throws an error on invalid types', () => { - expect(() => new Mediate('noMatch', '1')).to.throw(/noMatch/); - }); - - it('sets the type of the object', () => { - expect((new Mediate('raw', '1')).type).to.equal('raw'); - }); - - it('sets the value of the object', () => { - expect((new Mediate('raw', '1')).value).to.equal('1'); - }); - }); - - describe('initLength', () => { - it('returns correct variable byte length for raw', () => { - expect(new Mediate('raw', DOUBLE15).initLength()).to.equal(64); - }); - - it('returns correct fixed byte length for array', () => { - expect(new Mediate('array', [1, 2, 3, 4]).initLength()).to.equal(32); - }); - - it('returns correct fixed byte length for prefixed', () => { - expect(new Mediate('prefixed', 0).initLength()).to.equal(32); - }); - - it('returns correct variable byte length for fixedArray', () => { - expect(new Mediate('fixedArray', ARRAY).initLength()).to.equal(96); - }); - }); - - describe('closingLength', () => { - it('returns 0 byte length for raw', () => { - expect(new Mediate('raw', DOUBLE15).closingLength()).to.equal(0); - }); - - it('returns prefix + size for prefixed', () => { - expect(new Mediate('prefixed', DOUBLE15).closingLength()).to.equal(64); - }); - - it('returns prefix + size for array', () => { - expect(new Mediate('array', ARRAY).closingLength()).to.equal(128); - }); - - it('returns total length for fixedArray', () => { - expect(new Mediate('fixedArray', ARRAY).closingLength()).to.equal(96); - }); - }); -}); diff --git a/js-old/src/abi/spec/constructor.js b/js-old/src/abi/spec/constructor.js deleted file mode 100644 index e9b23b593df..00000000000 --- a/js-old/src/abi/spec/constructor.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Encoder from '../encoder/encoder'; -import Param from './param'; - -export default class Constructor { - constructor (abi) { - this._inputs = Param.toParams(abi.inputs || []); - } - - get inputs () { - return this._inputs; - } - - inputParamTypes () { - return this._inputs.map((input) => input.kind); - } - - encodeCall (tokens) { - return Encoder.encode(tokens); - } -} diff --git a/js-old/src/abi/spec/constructor.spec.js b/js-old/src/abi/spec/constructor.spec.js deleted file mode 100644 index 7c7414bdc8a..00000000000 --- a/js-old/src/abi/spec/constructor.spec.js +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Constructor from './constructor'; -import Param from './param'; -import Token from '../token'; - -describe('abi/spec/Constructor', () => { - const inputsArr = [{ name: 'boolin', type: 'bool' }, { name: 'stringin', type: 'string' }]; - const bool = new Param('boolin', 'bool'); - const string = new Param('stringin', 'string'); - - const inputs = [bool, string]; - const cr = new Constructor({ inputs: inputsArr }); - - describe('constructor', () => { - it('stores the inputs as received', () => { - expect(cr.inputs).to.deep.equal(inputs); - }); - - it('matches empty inputs with []', () => { - expect(new Constructor({}).inputs).to.deep.equal([]); - }); - }); - - describe('inputParamTypes', () => { - it('retrieves the input types as received', () => { - expect(cr.inputParamTypes()).to.deep.equal([bool.kind, string.kind]); - }); - }); - - describe('encodeCall', () => { - it('encodes correctly', () => { - const result = cr.encodeCall([new Token('bool', true), new Token('string', 'jacogr')]); - - expect(result).to.equal('0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000066a61636f67720000000000000000000000000000000000000000000000000000'); - }); - }); -}); diff --git a/js-old/src/abi/spec/event/decodedLog.js b/js-old/src/abi/spec/event/decodedLog.js deleted file mode 100644 index e398c5a1bf5..00000000000 --- a/js-old/src/abi/spec/event/decodedLog.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default class DecodedLog { - constructor (params, address) { - this._params = params; - this._address = address; - } - - get address () { - return this._address; - } - - get params () { - return this._params; - } -} diff --git a/js-old/src/abi/spec/event/decodedLog.spec.js b/js-old/src/abi/spec/event/decodedLog.spec.js deleted file mode 100644 index f448af011c0..00000000000 --- a/js-old/src/abi/spec/event/decodedLog.spec.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import DecodedLog from './decodedLog'; - -const log = new DecodedLog('someParams', 'someAddress'); - -describe('abi/spec/event/DecodedLog', () => { - describe('constructor', () => { - it('sets internal state', () => { - expect(log.params).to.equal('someParams'); - expect(log.address).to.equal('someAddress'); - }); - }); -}); diff --git a/js-old/src/abi/spec/event/decodedLogParam.js b/js-old/src/abi/spec/event/decodedLogParam.js deleted file mode 100644 index 422fbaac84f..00000000000 --- a/js-old/src/abi/spec/event/decodedLogParam.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import ParamType from '../paramType/paramType'; -import Token from '../../token/token'; -import { isInstanceOf } from '../../util/types'; - -export default class DecodedLogParam { - constructor (name, kind, token) { - if (!isInstanceOf(kind, ParamType)) { - throw new Error('kind not instanceof ParamType'); - } else if (!isInstanceOf(token, Token)) { - throw new Error('token not instanceof Token'); - } - - this._name = name; - this._kind = kind; - this._token = token; - } - - get name () { - return this._name; - } - - get kind () { - return this._kind; - } - - get token () { - return this._token; - } -} diff --git a/js-old/src/abi/spec/event/decodedLogParam.spec.js b/js-old/src/abi/spec/event/decodedLogParam.spec.js deleted file mode 100644 index 6a7f5204495..00000000000 --- a/js-old/src/abi/spec/event/decodedLogParam.spec.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import DecodedLogParam from './decodedLogParam'; -import ParamType from '../paramType'; -import Token from '../../token'; - -describe('abi/spec/event/DecodedLogParam', () => { - describe('constructor', () => { - const pt = new ParamType('bool'); - const tk = new Token('bool'); - - it('disallows kind not instanceof ParamType', () => { - expect(() => new DecodedLogParam('test', 'param')).to.throw(/ParamType/); - }); - - it('disallows token not instanceof Token', () => { - expect(() => new DecodedLogParam('test', pt, 'token')).to.throw(/Token/); - }); - - it('stores all parameters received', () => { - const log = new DecodedLogParam('test', pt, tk); - - expect(log.name).to.equal('test'); - expect(log.kind).to.equal(pt); - expect(log.token).to.equal(tk); - }); - }); -}); diff --git a/js-old/src/abi/spec/event/event.js b/js-old/src/abi/spec/event/event.js deleted file mode 100644 index 604f58cb18b..00000000000 --- a/js-old/src/abi/spec/event/event.js +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Decoder from '../../decoder/decoder'; -import DecodedLog from './decodedLog'; -import DecodedLogParam from './decodedLogParam'; -import EventParam from './eventParam'; -import { asAddress } from '../../util/sliceAs'; -import { eventSignature } from '../../util/signature'; - -export default class Event { - constructor (abi) { - this._inputs = EventParam.toEventParams(abi.inputs || []); - this._anonymous = !!abi.anonymous; - - const { id, name, signature } = eventSignature(abi.name, this.inputParamTypes()); - - this._id = id; - this._name = name; - this._signature = signature; - } - - get name () { - return this._name; - } - - get id () { - return this._id; - } - - get inputs () { - return this._inputs; - } - - get anonymous () { - return this._anonymous; - } - - get signature () { - return this._signature; - } - - inputParamTypes () { - return this._inputs.map((input) => input.kind); - } - - inputParamNames () { - return this._inputs.map((input) => input.name); - } - - indexedParams (indexed) { - return this._inputs.filter((input) => input.indexed === indexed); - } - - decodeLog (topics, data) { - const topicParams = this.indexedParams(true); - const dataParams = this.indexedParams(false); - - let address; - let toSkip; - - if (!this.anonymous) { - address = asAddress(topics[0]); - toSkip = 1; - } else { - toSkip = 0; - } - - const topicTypes = topicParams.map((param) => param.kind); - const flatTopics = topics - .filter((topic, idx) => idx >= toSkip) - .map((topic) => { - return (topic.substr(0, 2) === '0x') - ? topic.substr(2) - : topic; - }).join(''); - const topicTokens = Decoder.decode(topicTypes, flatTopics); - - if (topicTokens.length !== (topics.length - toSkip)) { - throw new Error('Invalid topic data'); - } - - const dataTypes = dataParams.map((param) => param.kind); - const dataTokens = Decoder.decode(dataTypes, data); - - const namedTokens = {}; - - topicParams.forEach((param, idx) => { - namedTokens[param.name || idx] = topicTokens[idx]; - }); - dataParams.forEach((param, idx) => { - namedTokens[param.name || idx] = dataTokens[idx]; - }); - - const inputParamTypes = this.inputParamTypes(); - const decodedParams = this.inputParamNames() - .map((name, idx) => new DecodedLogParam(name, inputParamTypes[idx], namedTokens[name || idx])); - - return new DecodedLog(decodedParams, address); - } -} diff --git a/js-old/src/abi/spec/event/event.spec.js b/js-old/src/abi/spec/event/event.spec.js deleted file mode 100644 index bf47980fc64..00000000000 --- a/js-old/src/abi/spec/event/event.spec.js +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -import Event from './event'; -import EventParam from './eventParam'; -import DecodedLogParam from './decodedLogParam'; -import ParamType from '../paramType'; -import Token from '../../token'; - -describe('abi/spec/event/Event', () => { - const inputArr = [{ name: 'a', type: 'bool' }, { name: 'b', type: 'uint', indexed: true }]; - const inputs = [new EventParam('a', 'bool', false), new EventParam('b', 'uint', true)]; - const event = new Event({ name: 'test', inputs: inputArr, anonymous: true }); - - describe('constructor', () => { - it('stores the parameters as received', () => { - expect(event.name).to.equal('test'); - expect(event.inputs).to.deep.equal(inputs); - expect(event.anonymous).to.be.true; - }); - - it('matches empty inputs with []', () => { - expect(new Event({ name: 'test' }).inputs).to.deep.equal([]); - }); - - it('sets the event signature', () => { - expect(new Event({ name: 'baz' }).signature) - .to.equal('a7916fac4f538170f7cd12c148552e2cba9fcd72329a2dd5b07a6fa906488ddf'); - }); - }); - - describe('inputParamTypes', () => { - it('returns all the types', () => { - expect(event.inputParamTypes()).to.deep.equal([new ParamType('bool'), new ParamType('uint', null, 256, true)]); - }); - }); - - describe('inputParamNames', () => { - it('returns all the names', () => { - expect(event.inputParamNames()).to.deep.equal(['a', 'b']); - }); - }); - - describe('indexedParams', () => { - it('returns all indexed parameters (indexed)', () => { - expect(event.indexedParams(true)).to.deep.equal([inputs[1]]); - }); - - it('returns all indexed parameters (non-indexed)', () => { - expect(event.indexedParams(false)).to.deep.equal([inputs[0]]); - }); - }); - - describe('decodeLog', () => { - it('decodes an event', () => { - const event = new Event({ - name: 'foo', - inputs: [ - { name: 'a', type: 'int' }, - { name: 'b', type: 'int', indexed: true }, - { name: 'c', type: 'address' }, - { name: 'd', type: 'address', indexed: true } - ] - }); - const decoded = event.decodeLog([ - '0000000000000000000000004444444444444444444444444444444444444444', - '0000000000000000000000000000000000000000000000000000000000000002', - '0000000000000000000000001111111111111111111111111111111111111111' ], - '00000000000000000000000000000000000000000000000000000000000000030000000000000000000000002222222222222222222222222222222222222222'); - - expect(decoded.address).to.equal('0x4444444444444444444444444444444444444444'); - expect(decoded.params).to.deep.equal([ - new DecodedLogParam('a', new ParamType('int', null, 256), new Token('int', new BigNumber(3))), - new DecodedLogParam('b', new ParamType('int', null, 256, true), new Token('int', new BigNumber(2))), - new DecodedLogParam('c', new ParamType('address'), new Token('address', '0x2222222222222222222222222222222222222222')), - new DecodedLogParam('d', new ParamType('address', null, 0, true), new Token('address', '0x1111111111111111111111111111111111111111')) - ]); - }); - - it('decodes an anonymous event', () => { - const event = new Event({ name: 'foo', inputs: [{ name: 'a', type: 'int' }], anonymous: true }); - const decoded = event.decodeLog([], '0000000000000000000000000000000000000000000000000000000000000003'); - - expect(decoded.address).to.not.be.ok; - expect(decoded.params).to.deep.equal([ - new DecodedLogParam('a', new ParamType('int', null, 256), new Token('int', new BigNumber(3))) - ]); - }); - - it('throws on invalid topics', () => { - const event = new Event({ name: 'foo', inputs: [{ name: 'a', type: 'int' }], anonymous: true }); - - expect(() => event.decodeLog(['0000000000000000000000004444444444444444444444444444444444444444'], '0000000000000000000000000000000000000000000000000000000000000003')).to.throw(/Invalid/); - }); - }); -}); diff --git a/js-old/src/abi/spec/event/eventParam.js b/js-old/src/abi/spec/event/eventParam.js deleted file mode 100644 index b49b7781411..00000000000 --- a/js-old/src/abi/spec/event/eventParam.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { toParamType } from '../paramType/format'; - -export default class EventParam { - constructor (name, type, indexed = false) { - this._name = name; - this._indexed = indexed; - this._kind = toParamType(type, indexed); - } - - get name () { - return this._name; - } - - get kind () { - return this._kind; - } - - get indexed () { - return this._indexed; - } - - static toEventParams (params) { - return params.map((param) => new EventParam(param.name, param.type, param.indexed)); - } -} diff --git a/js-old/src/abi/spec/event/eventParam.spec.js b/js-old/src/abi/spec/event/eventParam.spec.js deleted file mode 100644 index e35ebcebcce..00000000000 --- a/js-old/src/abi/spec/event/eventParam.spec.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import EventParam from './eventParam'; - -describe('abi/spec/event/EventParam', () => { - describe('constructor', () => { - it('sets the properties', () => { - const param = new EventParam('foo', 'uint', true); - - expect(param.name).to.equal('foo'); - expect(param.kind.type).to.equal('uint'); - expect(param.indexed).to.be.true; - }); - - it('uses defaults for indexed', () => { - expect(new EventParam('foo', 'uint').indexed).to.be.false; - }); - }); - - describe('toEventParams', () => { - it('maps an array of params', () => { - const params = EventParam.toEventParams([{ name: 'foo', type: 'uint' }]); - - expect(params.length).to.equal(1); - expect(params[0].indexed).to.be.false; - expect(params[0].name).to.equal('foo'); - expect(params[0].kind.type).to.equal('uint'); - }); - }); -}); diff --git a/js-old/src/abi/spec/function.js b/js-old/src/abi/spec/function.js deleted file mode 100644 index 6010f4e598f..00000000000 --- a/js-old/src/abi/spec/function.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Decoder from '../decoder/decoder'; -import Encoder from '../encoder/encoder'; -import Param from './param'; -import { methodSignature } from '../util/signature'; - -export default class Func { - constructor (abi) { - this._abi = abi; - this._constant = !!abi.constant; - this._payable = abi.payable; - this._inputs = Param.toParams(abi.inputs || []); - this._outputs = Param.toParams(abi.outputs || []); - - const { id, name, signature } = methodSignature(abi.name, this.inputParamTypes()); - - this._id = id; - this._name = name; - this._signature = signature; - } - - get abi () { - return this._abi; - } - - get constant () { - return this._constant; - } - - get name () { - return this._name; - } - - get id () { - return this._id; - } - - get payable () { - return this._payable; - } - - get inputs () { - return this._inputs; - } - - get outputs () { - return this._outputs; - } - - get signature () { - return this._signature; - } - - inputParamTypes () { - return this._inputs.map((input) => input.kind); - } - - outputParamTypes () { - return this._outputs.map((output) => output.kind); - } - - encodeCall (tokens) { - return `${this._signature}${Encoder.encode(tokens)}`; - } - - decodeInput (data) { - return Decoder.decode(this.inputParamTypes(), data); - } - - decodeOutput (data) { - return Decoder.decode(this.outputParamTypes(), data); - } -} diff --git a/js-old/src/abi/spec/function.spec.js b/js-old/src/abi/spec/function.spec.js deleted file mode 100644 index 436ca73650b..00000000000 --- a/js-old/src/abi/spec/function.spec.js +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Func from './function'; -import Param from './param'; -import Token from '../token'; - -describe('abi/spec/Function', () => { - const inputsArr = [{ name: 'boolin', type: 'bool' }, { name: 'stringin', type: 'string' }]; - const outputsArr = [{ name: 'output', type: 'uint' }]; - - const uint = new Param('output', 'uint'); - const bool = new Param('boolin', 'bool'); - const string = new Param('stringin', 'string'); - const inputs = [bool, string]; - const outputs = [uint]; - - const func = new Func({ - name: 'test', - inputs: inputsArr, - outputs: outputsArr - }); - - describe('constructor', () => { - it('returns signature correctly if name already contains it', () => { - const func = new Func({ - name: 'test(bool,string)', - inputs: inputsArr, - outputs: outputsArr - }); - - expect(func.name).to.equal('test'); - expect(func.id).to.equal('test(bool,string)'); - expect(func.signature).to.equal('02356205'); - }); - - it('stores the parameters as received', () => { - expect(func.name).to.equal('test'); - expect(func.constant).to.be.false; - expect(func.inputs).to.deep.equal(inputs); - expect(func.outputs).to.deep.equal(outputs); - }); - - it('matches empty inputs with []', () => { - expect(new Func({ name: 'test', outputs: outputsArr }).inputs).to.deep.equal([]); - }); - - it('matches empty outputs with []', () => { - expect(new Func({ name: 'test', inputs: inputsArr }).outputs).to.deep.equal([]); - }); - - it('sets the method signature', () => { - expect(new Func({ name: 'baz' }).signature).to.equal('a7916fac'); - }); - - it('allows constant functions', () => { - expect(new Func({ name: 'baz', constant: true }).constant).to.be.true; - }); - }); - - describe('inputParamTypes', () => { - it('retrieves the input types as received', () => { - expect(func.inputParamTypes()).to.deep.equal([bool.kind, string.kind]); - }); - }); - - describe('outputParamTypes', () => { - it('retrieves the output types as received', () => { - expect(func.outputParamTypes()).to.deep.equal([uint.kind]); - }); - }); - - describe('encodeCall', () => { - it('encodes the call correctly', () => { - const result = func.encodeCall([new Token('bool', true), new Token('string', 'jacogr')]); - - expect(result).to.equal('023562050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000066a61636f67720000000000000000000000000000000000000000000000000000'); - }); - }); - - describe('decodeOutput', () => { - it('decodes the result correctly', () => { - const result = func.decodeOutput('1111111111111111111111111111111111111111111111111111111111111111'); - - expect(result[0].value.toString(16)).to.equal('1111111111111111111111111111111111111111111111111111111111111111'); - }); - }); -}); diff --git a/js-old/src/abi/spec/index.js b/js-old/src/abi/spec/index.js deleted file mode 100644 index 87852d48803..00000000000 --- a/js-old/src/abi/spec/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './interface'; diff --git a/js-old/src/abi/spec/interface.js b/js-old/src/abi/spec/interface.js deleted file mode 100644 index b24569525db..00000000000 --- a/js-old/src/abi/spec/interface.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Constructor from './constructor'; -import Event from './event/event'; -import Func from './function'; -import Token from '../token'; - -export default class Interface { - constructor (abi) { - this._interface = Interface.parseABI(abi); - } - - get interface () { - return this._interface; - } - - get constructors () { - return this._interface.filter((item) => item instanceof Constructor); - } - - get events () { - return this._interface.filter((item) => item instanceof Event); - } - - get functions () { - return this._interface.filter((item) => item instanceof Func); - } - - encodeTokens (paramTypes, values) { - return Interface.encodeTokens(paramTypes, values); - } - - static encodeTokens (paramTypes, values) { - const createToken = function (paramType, value) { - if (paramType.subtype) { - return new Token(paramType.type, value.map((entry) => createToken(paramType.subtype, entry))); - } - - return new Token(paramType.type, value); - }; - - return paramTypes.map((paramType, idx) => createToken(paramType, values[idx])); - } - - static parseABI (abi) { - return abi.map((item) => { - switch (item.type) { - case 'constructor': - return new Constructor(item); - - case 'event': - return new Event(item); - - case 'function': - case 'fallback': - return new Func(item); - - default: - throw new Error(`Unknown ABI type ${item.type}`); - } - }); - } -} diff --git a/js-old/src/abi/spec/interface.spec.js b/js-old/src/abi/spec/interface.spec.js deleted file mode 100644 index ebaa323ed52..00000000000 --- a/js-old/src/abi/spec/interface.spec.js +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Interface from './interface'; -import ParamType from './paramType'; -import Token from '../token'; - -describe('abi/spec/Interface', () => { - const construct = { - type: 'constructor', - inputs: [] - }; - const event = { - type: 'event', - name: 'Event2', - anonymous: false, - inputs: [{ name: 'a', type: 'uint256', indexed: true }, { name: 'b', type: 'bytes32', indexed: false }] - }; - const func = { - type: 'function', - name: 'foo', - inputs: [{ name: 'a', type: 'uint256' }], - outputs: [] - }; - - describe('parseABI', () => { - it('throws on invalid types', () => { - expect(() => Interface.parseABI([{ type: 'noMatch' }])).to.throw(/noMatch/); - }); - - it('creates constructors', () => { - expect(Interface.parseABI([ construct ])).to.deep.equal([{ _inputs: [] }]); - }); - - it('creates events', () => { - expect(Interface.parseABI([ event ])[0].name).to.equal('Event2'); - }); - - it('creates functions', () => { - expect(Interface.parseABI([ func ])[0].name).to.equal('foo'); - }); - - it('parse complex interfaces', () => { - expect(Interface.parseABI([ construct, event, func ]).length).to.equal(3); - }); - }); - - describe('constructor', () => { - const int = new Interface([ construct, event, func ]); - - it('contains the full interface', () => { - expect(int.interface.length).to.equal(3); - }); - - it('contains the constructors', () => { - expect(int.constructors.length).to.equal(1); - }); - - it('contains the events', () => { - expect(int.events.length).to.equal(1); - }); - - it('contains the functions', () => { - expect(int.functions.length).to.equal(1); - }); - }); - - describe('encodeTokens', () => { - const int = new Interface([ construct, event, func ]); - - it('encodes simple types', () => { - expect( - int.encodeTokens( - [new ParamType('bool'), new ParamType('string'), new ParamType('int'), new ParamType('uint')], - [true, 'gavofyork', -123, 123] - ) - ).to.deep.equal([ - new Token('bool', true), new Token('string', 'gavofyork'), new Token('int', -123), new Token('uint', 123) - ]); - }); - - it('encodes array', () => { - expect( - int.encodeTokens( - [new ParamType('array', new ParamType('bool'))], - [[true, false, true]] - ) - ).to.deep.equal([ - new Token('array', [ - new Token('bool', true), new Token('bool', false), new Token('bool', true) - ]) - ]); - }); - - it('encodes simple with array of array', () => { - expect( - int.encodeTokens( - [ - new ParamType('bool'), - new ParamType('fixedArray', new ParamType('array', new ParamType('uint')), 2) - ], - [true, [[0, 1], [2, 3]]] - ) - ).to.deep.equal([ - new Token('bool', true), - new Token('fixedArray', [ - new Token('array', [new Token('uint', 0), new Token('uint', 1)]), - new Token('array', [new Token('uint', 2), new Token('uint', 3)]) - ]) - ]); - }); - }); -}); diff --git a/js-old/src/abi/spec/param.js b/js-old/src/abi/spec/param.js deleted file mode 100644 index e02b9910038..00000000000 --- a/js-old/src/abi/spec/param.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { toParamType } from './paramType/format'; - -export default class Param { - constructor (name, type) { - this._name = name; - this._kind = toParamType(type); - } - - get name () { - return this._name; - } - - get kind () { - return this._kind; - } - - static toParams (params) { - return params.map((param) => { - if (param instanceof Param) { - return param; - } - - return new Param(param.name, param.type); - }); - } -} diff --git a/js-old/src/abi/spec/param.spec.js b/js-old/src/abi/spec/param.spec.js deleted file mode 100644 index 0ecdb0319b1..00000000000 --- a/js-old/src/abi/spec/param.spec.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Param from './param'; - -describe('abi/spec/Param', () => { - describe('constructor', () => { - const param = new Param('foo', 'uint'); - - it('sets the properties', () => { - expect(param.name).to.equal('foo'); - expect(param.kind.type).to.equal('uint'); - }); - }); - - describe('toParams', () => { - it('maps an array of params', () => { - const params = Param.toParams([{ name: 'foo', type: 'uint' }]); - - expect(params.length).to.equal(1); - expect(params[0].name).to.equal('foo'); - expect(params[0].kind.type).to.equal('uint'); - }); - - it('converts only if needed', () => { - const _params = Param.toParams([{ name: 'foo', type: 'uint' }]); - const params = Param.toParams(_params); - - expect(params.length).to.equal(1); - expect(params[0].name).to.equal('foo'); - expect(params[0].kind.type).to.equal('uint'); - }); - }); -}); diff --git a/js-old/src/abi/spec/paramType/format.js b/js-old/src/abi/spec/paramType/format.js deleted file mode 100644 index 5aafd5e3070..00000000000 --- a/js-old/src/abi/spec/paramType/format.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import ParamType from './paramType'; - -export function toParamType (type, indexed) { - if (type[type.length - 1] === ']') { - const last = type.lastIndexOf('['); - const length = type.substr(last + 1, type.length - last - 2); - const subtype = toParamType(type.substr(0, last)); - - if (length.length === 0) { - return new ParamType('array', subtype, 0, indexed); - } - - return new ParamType('fixedArray', subtype, parseInt(length, 10), indexed); - } - - switch (type) { - case 'address': - case 'bool': - case 'bytes': - case 'string': - return new ParamType(type, null, 0, indexed); - - case 'int': - case 'uint': - return new ParamType(type, null, 256, indexed); - - default: - if (type.indexOf('uint') === 0) { - return new ParamType('uint', null, parseInt(type.substr(4), 10), indexed); - } else if (type.indexOf('int') === 0) { - return new ParamType('int', null, parseInt(type.substr(3), 10), indexed); - } else if (type.indexOf('bytes') === 0) { - return new ParamType('fixedBytes', null, parseInt(type.substr(5), 10), indexed); - } - - throw new Error(`Cannot convert ${type} to valid ParamType`); - } -} - -export function fromParamType (paramType) { - switch (paramType.type) { - case 'address': - case 'bool': - case 'bytes': - case 'string': - return paramType.type; - - case 'int': - case 'uint': - return `${paramType.type}${paramType.length}`; - - case 'fixedBytes': - return `bytes${paramType.length}`; - - case 'fixedArray': - return `${fromParamType(paramType.subtype)}[${paramType.length}]`; - - case 'array': - return `${fromParamType(paramType.subtype)}[]`; - - default: - throw new Error(`Cannot convert from ParamType ${paramType.type}`); - } -} diff --git a/js-old/src/abi/spec/paramType/format.spec.js b/js-old/src/abi/spec/paramType/format.spec.js deleted file mode 100644 index cb000473380..00000000000 --- a/js-old/src/abi/spec/paramType/format.spec.js +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import ParamType from './paramType'; -import { fromParamType, toParamType } from './format'; - -describe('abi/spec/paramType/format', () => { - describe('fromParamType', () => { - it('errors on invalid types', () => { - expect(() => fromParamType({ type: 'noMatch' })).to.throw(/noMatch/); - }); - - describe('simple types', () => { - it('converts address to address', () => { - const pt = new ParamType('address'); - - expect(fromParamType(pt)).to.equal('address'); - }); - - it('converts bool to bool', () => { - const pt = new ParamType('bool'); - - expect(fromParamType(pt)).to.equal('bool'); - }); - - it('converts bytes to bytes', () => { - const pt = new ParamType('bytes'); - - expect(fromParamType(pt)).to.equal('bytes'); - }); - - it('converts string to string', () => { - const pt = new ParamType('string'); - - expect(fromParamType(pt)).to.equal('string'); - }); - }); - - describe('length types', () => { - it('converts int32 to int32', () => { - const pt = new ParamType('int', null, 32); - - expect(fromParamType(pt)).to.equal('int32'); - }); - - it('converts uint64 to int64', () => { - const pt = new ParamType('uint', null, 64); - - expect(fromParamType(pt)).to.equal('uint64'); - }); - - it('converts fixedBytes8 to bytes8', () => { - const pt = new ParamType('fixedBytes', null, 8); - - expect(fromParamType(pt)).to.equal('bytes8'); - }); - }); - - describe('arrays', () => { - it('converts string[2] to string[2]', () => { - const pt = new ParamType('fixedArray', new ParamType('string'), 2); - - expect(fromParamType(pt)).to.equal('string[2]'); - }); - - it('converts bool[] to bool[]', () => { - const pt = new ParamType('array', new ParamType('bool')); - - expect(fromParamType(pt)).to.equal('bool[]'); - }); - - it('converts bool[][2] to bool[][2]', () => { - const pt = new ParamType('fixedArray', new ParamType('array', new ParamType('bool')), 2); - - expect(fromParamType(pt)).to.equal('bool[][2]'); - }); - - it('converts bool[2][] to bool[2][]', () => { - const pt = new ParamType('array', new ParamType('fixedArray', new ParamType('bool'), 2)); - - expect(fromParamType(pt)).to.equal('bool[2][]'); - }); - }); - }); - - describe('toParamType', () => { - it('errors on invalid types', () => { - expect(() => toParamType('noMatch')).to.throw(/noMatch/); - }); - - describe('simple mapping', () => { - it('converts address to address', () => { - const pt = toParamType('address'); - - expect(pt.type).to.equal('address'); - }); - - it('converts bool to bool', () => { - const pt = toParamType('bool'); - - expect(pt.type).to.equal('bool'); - }); - - it('converts bytes to bytes', () => { - const pt = toParamType('bytes'); - - expect(pt.type).to.equal('bytes'); - }); - - it('converts string to string', () => { - const pt = toParamType('string'); - - expect(pt.type).to.equal('string'); - }); - }); - - describe('number', () => { - it('converts int to int256', () => { - const pt = toParamType('int'); - - expect(pt.type).to.equal('int'); - expect(pt.length).to.equal(256); - }); - - it('converts uint to uint256', () => { - const pt = toParamType('uint'); - - expect(pt.type).to.equal('uint'); - expect(pt.length).to.equal(256); - }); - }); - - describe('sized types', () => { - it('converts int32 to int32', () => { - const pt = toParamType('int32'); - - expect(pt.type).to.equal('int'); - expect(pt.length).to.equal(32); - }); - - it('converts uint16 to uint16', () => { - const pt = toParamType('uint32'); - - expect(pt.type).to.equal('uint'); - expect(pt.length).to.equal(32); - }); - - it('converts bytes8 to fixedBytes8', () => { - const pt = toParamType('bytes8'); - - expect(pt.type).to.equal('fixedBytes'); - expect(pt.length).to.equal(8); - }); - }); - - describe('arrays', () => { - describe('fixed arrays', () => { - it('creates fixed array', () => { - const pt = toParamType('bytes[8]'); - - expect(pt.type).to.equal('fixedArray'); - expect(pt.subtype.type).to.equal('bytes'); - expect(pt.length).to.equal(8); - }); - - it('creates fixed arrays of fixed arrays', () => { - const pt = toParamType('bytes[45][3]'); - - expect(pt.type).to.equal('fixedArray'); - expect(pt.length).to.equal(3); - expect(pt.subtype.type).to.equal('fixedArray'); - expect(pt.subtype.length).to.equal(45); - expect(pt.subtype.subtype.type).to.equal('bytes'); - }); - }); - - describe('dynamic arrays', () => { - it('creates a dynamic array', () => { - const pt = toParamType('bytes[]'); - - expect(pt.type).to.equal('array'); - expect(pt.subtype.type).to.equal('bytes'); - }); - - it('creates a dynamic array of dynamic arrays', () => { - const pt = toParamType('bool[][]'); - - expect(pt.type).to.equal('array'); - expect(pt.subtype.type).to.equal('array'); - expect(pt.subtype.subtype.type).to.equal('bool'); - }); - }); - - describe('mixed arrays', () => { - it('creates a fixed dynamic array', () => { - const pt = toParamType('bool[][3]'); - - expect(pt.type).to.equal('fixedArray'); - expect(pt.length).to.equal(3); - expect(pt.subtype.type).to.equal('array'); - expect(pt.subtype.subtype.type).to.equal('bool'); - }); - - it('creates a dynamic fixed array', () => { - const pt = toParamType('bool[3][]'); - - expect(pt.type).to.equal('array'); - expect(pt.subtype.type).to.equal('fixedArray'); - expect(pt.subtype.length).to.equal(3); - expect(pt.subtype.subtype.type).to.equal('bool'); - }); - }); - }); - }); -}); diff --git a/js-old/src/abi/spec/paramType/index.js b/js-old/src/abi/spec/paramType/index.js deleted file mode 100644 index 123e198e8ea..00000000000 --- a/js-old/src/abi/spec/paramType/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './paramType'; diff --git a/js-old/src/abi/spec/paramType/paramType.js b/js-old/src/abi/spec/paramType/paramType.js deleted file mode 100644 index b65465d94ed..00000000000 --- a/js-old/src/abi/spec/paramType/paramType.js +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import TYPES from './types'; - -export default class ParamType { - constructor (type, subtype = null, length = 0, indexed = false) { - ParamType.validateType(type); - - this._type = type; - this._subtype = subtype; - this._length = length; - this._indexed = indexed; - } - - get type () { - return this._type; - } - - get subtype () { - return this._subtype; - } - - get length () { - return this._length; - } - - get indexed () { - return this._indexed; - } - - static validateType (type) { - if (TYPES.filter((_type) => type === _type).length) { - return true; - } - - throw new Error(`Invalid type ${type} received for ParamType`); - } -} diff --git a/js-old/src/abi/spec/paramType/paramType.spec.js b/js-old/src/abi/spec/paramType/paramType.spec.js deleted file mode 100644 index dc711472114..00000000000 --- a/js-old/src/abi/spec/paramType/paramType.spec.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import ParamType from './paramType'; - -describe('abi/spec/paramType/ParamType', () => { - describe('validateType', () => { - it('validates address', () => { - expect(ParamType.validateType('address')).to.be.true; - }); - - it('validates fixedArray', () => { - expect(ParamType.validateType('fixedArray')).to.be.true; - }); - - it('validates array', () => { - expect(ParamType.validateType('array')).to.be.true; - }); - - it('validates fixedBytes', () => { - expect(ParamType.validateType('fixedBytes')).to.be.true; - }); - - it('validates bytes', () => { - expect(ParamType.validateType('bytes')).to.be.true; - }); - - it('validates bool', () => { - expect(ParamType.validateType('bool')).to.be.true; - }); - - it('validates int', () => { - expect(ParamType.validateType('int')).to.be.true; - }); - - it('validates uint', () => { - expect(ParamType.validateType('uint')).to.be.true; - }); - - it('validates string', () => { - expect(ParamType.validateType('string')).to.be.true; - }); - - it('throws an error on invalid types', () => { - expect(() => ParamType.validateType('noMatch')).to.throw(/noMatch/); - }); - }); - - describe('constructor', () => { - it('throws an error on invalid types', () => { - expect(() => new ParamType('noMatch')).to.throw(/noMatch/); - }); - - it('sets the type of the object', () => { - expect((new ParamType('bool', null, 1)).type).to.equal('bool'); - }); - - it('sets the subtype of the object', () => { - expect((new ParamType('array', 'bool', 1)).subtype).to.equal('bool'); - }); - - it('sets the length of the object', () => { - expect((new ParamType('array', 'bool', 1)).length).to.equal(1); - }); - - it('sets the index of the object', () => { - expect((new ParamType('array', 'bool', 1, true)).indexed).to.be.true; - }); - - it('sets default values where none supplied', () => { - expect(Object.values(new ParamType('string'))).to.deep.equal(['string', null, 0, false]); - }); - }); -}); diff --git a/js-old/src/abi/spec/paramType/types.js b/js-old/src/abi/spec/paramType/types.js deleted file mode 100644 index e9749c5886f..00000000000 --- a/js-old/src/abi/spec/paramType/types.js +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -const TYPES = ['address', 'bytes', 'int', 'uint', 'bool', 'string', 'array', 'fixedBytes', 'fixedArray']; - -export default TYPES; diff --git a/js-old/src/abi/token/index.js b/js-old/src/abi/token/index.js deleted file mode 100644 index 6a636c3c89f..00000000000 --- a/js-old/src/abi/token/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './token'; diff --git a/js-old/src/abi/token/token.js b/js-old/src/abi/token/token.js deleted file mode 100644 index 7242248ab29..00000000000 --- a/js-old/src/abi/token/token.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import TYPES from '../spec/paramType/types'; - -export default class Token { - constructor (type, value) { - Token.validateType(type); - - this._type = type; - this._value = value; - } - - get type () { - return this._type; - } - - get value () { - return this._value; - } - - static validateType (type) { - if (TYPES.filter((_type) => type === _type).length) { - return true; - } - - throw new Error(`Invalid type ${type} received for Token`); - } -} diff --git a/js-old/src/abi/token/token.spec.js b/js-old/src/abi/token/token.spec.js deleted file mode 100644 index cf5fc51bf79..00000000000 --- a/js-old/src/abi/token/token.spec.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Token from './token'; - -describe('abi/token/token', () => { - describe('validateType', () => { - it('validates address', () => { - expect(Token.validateType('address')).to.be.true; - }); - - it('validates fixedArray', () => { - expect(Token.validateType('fixedArray')).to.be.true; - }); - - it('validates array', () => { - expect(Token.validateType('array')).to.be.true; - }); - - it('validates fixedBytes', () => { - expect(Token.validateType('fixedBytes')).to.be.true; - }); - - it('validates bytes', () => { - expect(Token.validateType('bytes')).to.be.true; - }); - - it('validates bool', () => { - expect(Token.validateType('bool')).to.be.true; - }); - - it('validates int', () => { - expect(Token.validateType('int')).to.be.true; - }); - - it('validates uint', () => { - expect(Token.validateType('uint')).to.be.true; - }); - - it('validates string', () => { - expect(Token.validateType('string')).to.be.true; - }); - - it('throws an error on invalid types', () => { - expect(() => Token.validateType('noMatch')).to.throw(/noMatch/); - }); - }); - - describe('constructor', () => { - it('throws an error on invalid types', () => { - expect(() => new Token('noMatch', '1')).to.throw(/noMatch/); - }); - - it('sets the type of the object', () => { - expect((new Token('bool', '1')).type).to.equal('bool'); - }); - - it('sets the value of the object', () => { - expect((new Token('bool', '1')).value).to.equal('1'); - }); - }); -}); diff --git a/js-old/src/abi/util/address.js b/js-old/src/abi/util/address.js deleted file mode 100644 index c0153ee5daa..00000000000 --- a/js-old/src/abi/util/address.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { keccak_256 } from 'js-sha3'; // eslint-disable-line camelcase - -export function isChecksumValid (_address) { - const address = _address.replace('0x', ''); - const hash = keccak_256(address.toLowerCase()); - - for (let n = 0; n < 40; n++) { - const char = address[n]; - const isLower = char !== char.toUpperCase(); - const isUpper = char !== char.toLowerCase(); - const hashval = parseInt(hash[n], 16); - - if ((hashval > 7 && isLower) || (hashval <= 7 && isUpper)) { - return false; - } - } - - return true; -} - -export function isAddress (address) { - if (address && address.length === 42) { - if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) { - return false; - } else if (/^(0x)?[0-9a-f]{40}$/.test(address) || /^(0x)?[0-9A-F]{40}$/.test(address)) { - return true; - } - - return isChecksumValid(address); - } - - return false; -} - -export function toChecksumAddress (_address) { - const address = (_address || '').toLowerCase(); - - if (!isAddress(address)) { - return ''; - } - - const hash = keccak_256(address.slice(-40)); - let result = '0x'; - - for (let n = 0; n < 40; n++) { - result = `${result}${parseInt(hash[n], 16) > 7 ? address[n + 2].toUpperCase() : address[n + 2]}`; - } - - return result; -} diff --git a/js-old/src/abi/util/address.spec.js b/js-old/src/abi/util/address.spec.js deleted file mode 100644 index 324ba163da9..00000000000 --- a/js-old/src/abi/util/address.spec.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { isChecksumValid, isAddress, toChecksumAddress } from './address'; - -describe('abi/util/address', () => { - const value = '63Cf90D3f0410092FC0fca41846f596223979195'; - const address = `0x${value}`; - const lowercase = `0x${value.toLowerCase()}`; - const uppercase = `0x${value.toUpperCase()}`; - const invalid = '0x' + value.split('').map((char) => { - if (char >= 'a' && char <= 'f') { - return char.toUpperCase(); - } else if (char >= 'A' && char <= 'F') { - return char.toLowerCase(); - } - - return char; - }).join(''); - const invalidhex = '0x01234567890123456789012345678901234567gh'; - - describe('isChecksumValid', () => { - it('returns false when fully lowercase', () => { - expect(isChecksumValid(lowercase)).to.be.false; - }); - - it('returns false when fully uppercase', () => { - expect(isChecksumValid(uppercase)).to.be.false; - }); - - it('returns false on a mixed-case address', () => { - expect(isChecksumValid(invalid)).to.be.false; - }); - - it('returns true on a checksummed address', () => { - expect(isChecksumValid(address)).to.be.true; - }); - }); - - describe('isAddress', () => { - it('returns true when fully lowercase', () => { - expect(isAddress(lowercase)).to.be.true; - }); - - it('returns true when fully uppercase', () => { - expect(isAddress(uppercase)).to.be.true; - }); - - it('returns true when checksummed', () => { - expect(isAddress(address)).to.be.true; - }); - - it('returns false when invalid checksum', () => { - expect(isAddress(invalid)).to.be.false; - }); - - it('returns false on valid length, non-hex', () => { - expect(isAddress(invalidhex)).to.be.false; - }); - }); - - describe('toChecksumAddress', () => { - it('returns empty when no address specified', () => { - expect(toChecksumAddress()).to.equal(''); - }); - - it('returns empty on invalid address structure', () => { - expect(toChecksumAddress('0xnotaddress')).to.equal(''); - }); - - it('returns formatted address on checksum input', () => { - expect(toChecksumAddress(address)).to.equal(address); - }); - - it('returns formatted address on lowercase input', () => { - expect(toChecksumAddress(lowercase)).to.equal(address); - }); - - it('returns formatted address on uppercase input', () => { - expect(toChecksumAddress(uppercase)).to.equal(address); - }); - - it('returns formatted address on mixed input', () => { - expect(toChecksumAddress(invalid)).to.equal(address); - }); - }); -}); diff --git a/js-old/src/abi/util/pad.js b/js-old/src/abi/util/pad.js deleted file mode 100644 index 476a27445e2..00000000000 --- a/js-old/src/abi/util/pad.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; -import utf8 from 'utf8'; - -import { isArray } from './types'; - -const ZERO_64 = '0000000000000000000000000000000000000000000000000000000000000000'; - -export function padAddress (_input) { - const input = _input.substr(0, 2) === '0x' ? _input.substr(2) : _input; - - return `${ZERO_64}${input}`.slice(-64); -} - -export function padBool (input) { - return `${ZERO_64}${input ? '1' : '0'}`.slice(-64); -} - -export function padU32 (input) { - let bn = new BigNumber(input); - - if (bn.lessThan(0)) { - bn = new BigNumber('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16) - .plus(bn).plus(1); - } - - return `${ZERO_64}${bn.toString(16)}`.slice(-64); -} - -function stringToBytes (input) { - if (isArray(input)) { - return input; - } else if (input.substr(0, 2) === '0x') { - const matches = input.substr(2).toLowerCase().match(/.{1,2}/g) || []; - - return matches.map((value) => parseInt(value, 16)); - } else { - return input.split('').map((char) => char.charCodeAt(0)); - } -} - -export function padBytes (_input) { - const input = stringToBytes(_input); - - return `${padU32(input.length)}${padFixedBytes(input)}`; -} - -export function padFixedBytes (_input) { - const input = stringToBytes(_input); - const sinput = input.map((code) => `0${code.toString(16)}`.slice(-2)).join(''); - const max = Math.floor((sinput.length + 63) / 64) * 64; - - return `${sinput}${ZERO_64}`.substr(0, max); -} - -export function padString (input) { - const array = utf8.encode(input) - .split('') - .map((char) => char.charCodeAt(0)); - - return padBytes(array); -} diff --git a/js-old/src/abi/util/pad.spec.js b/js-old/src/abi/util/pad.spec.js deleted file mode 100644 index 74463b438c1..00000000000 --- a/js-old/src/abi/util/pad.spec.js +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; -import { padAddress, padBool, padBytes, padFixedBytes, padString, padU32 } from './pad'; - -describe('abi/util/pad', () => { - const SHORT15 = '1234567890abcdef'; - const BYTES15 = [0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef]; - const LONG15 = `${SHORT15}000000000000000000000000000000000000000000000000`; - const PAD123 = '0000000000000000000000000000000000000000000000000000000000000123'; - - describe('padAddress', () => { - it('pads to 64 characters', () => { - expect(padAddress('123')).to.equal(PAD123); - }); - - it('strips leading 0x when passed in', () => { - expect(padFixedBytes(`0x${PAD123}`)).to.equal(PAD123); - }); - }); - - describe('padBool', () => { - const TRUE = '0000000000000000000000000000000000000000000000000000000000000001'; - const FALSE = '0000000000000000000000000000000000000000000000000000000000000000'; - - it('pads true to 64 characters', () => { - expect(padBool(true)).to.equal(TRUE); - }); - - it('pads false to 64 characters', () => { - expect(padBool(false)).to.equal(FALSE); - }); - }); - - describe('padU32', () => { - it('left pads length < 64 bytes to 64 bytes', () => { - expect(padU32(1)).to.equal('0000000000000000000000000000000000000000000000000000000000000001'); - }); - - it('pads hex representation', () => { - expect(padU32(0x123)).to.equal(PAD123); - }); - - it('pads decimal representation', () => { - expect(padU32(291)).to.equal(PAD123); - }); - - it('pads string representation', () => { - expect(padU32('0x123')).to.equal(PAD123); - }); - - it('pads BigNumber representation', () => { - expect(padU32(new BigNumber(0x123))).to.equal(PAD123); - }); - - it('converts negative numbers to 2s complement', () => { - expect(padU32(-123)).to.equal('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85'); - }); - }); - - describe('padFixedBytes', () => { - it('right pads length < 64 bytes to 64 bytes (string)', () => { - expect(padFixedBytes(`0x${SHORT15}`)).to.equal(LONG15); - }); - - it('right pads length < 64 bytes to 64 bytes (array)', () => { - expect(padFixedBytes(BYTES15)).to.equal(LONG15); - }); - - it('right pads length > 64 bytes (64 byte multiples)', () => { - expect(padFixedBytes(`0x${LONG15}${SHORT15}`)).to.equal(`${LONG15}${LONG15}`); - }); - - it('strips leading 0x when passed in', () => { - expect(padFixedBytes(`0x${SHORT15}`)).to.equal(LONG15); - }); - }); - - describe('padBytes', () => { - it('right pads length < 64, adding the length (string)', () => { - const result = padBytes(`0x${SHORT15}`); - - expect(result.length).to.equal(128); - expect(result).to.equal(`${padU32(8)}${LONG15}`); - }); - - it('right pads length < 64, adding the length (array)', () => { - const result = padBytes(BYTES15); - - expect(result.length).to.equal(128); - expect(result).to.equal(`${padU32(8)}${LONG15}`); - }); - - it('right pads length > 64, adding the length', () => { - const result = padBytes(`0x${LONG15}${SHORT15}`); - - expect(result.length).to.equal(192); - expect(result).to.equal(`${padU32(0x28)}${LONG15}${LONG15}`); - }); - }); - - describe('padString', () => { - it('correctly converts & pads strings', () => { - const result = padString('gavofyork'); - - expect(result.length).to.equal(128); - expect(result).to.equal(padBytes('0x6761766f66796f726b')); - }); - }); -}); diff --git a/js-old/src/abi/util/signature.js b/js-old/src/abi/util/signature.js deleted file mode 100644 index 86ed6f2657f..00000000000 --- a/js-old/src/abi/util/signature.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { keccak_256 } from 'js-sha3'; // eslint-disable-line camelcase -import { fromParamType } from '../spec/paramType/format'; - -export function eventSignature (eventName, params) { - const { strName, name } = parseName(eventName); - const types = (params || []).map(fromParamType).join(','); - const id = `${strName}(${types})`; - const signature = strName ? keccak_256(id) : ''; - - return { id, name, signature }; -} - -export function methodSignature (methodName, params) { - const { id, name, signature } = eventSignature(methodName, params); - - return { id, name, signature: signature.substr(0, 8) }; -} - -function parseName (name) { - const strName = `${name || ''}`; - const idx = strName.indexOf('('); - - if (idx === -1) { - return { strName, name }; - } - - const trimmedName = strName.slice(0, idx); - - return { - strName: trimmedName, - name: trimmedName - }; -} diff --git a/js-old/src/abi/util/signature.spec.js b/js-old/src/abi/util/signature.spec.js deleted file mode 100644 index 118ebf4e510..00000000000 --- a/js-old/src/abi/util/signature.spec.js +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { eventSignature, methodSignature } from './signature'; - -describe('abi/util/signature', () => { - describe('eventSignature', () => { - it('encodes signature baz() correctly', () => { - expect(eventSignature('baz', [])).to.deep.equal({ - id: 'baz()', - name: 'baz', - signature: 'a7916fac4f538170f7cd12c148552e2cba9fcd72329a2dd5b07a6fa906488ddf' - }); - }); - - it('encodes signature baz(uint32) correctly', () => { - expect(eventSignature('baz', [{ type: 'uint', length: 32 }])).to.deep.equal({ - id: 'baz(uint32)', - name: 'baz', - signature: '7d68785e8fc871be024b75964bd86d093511d4bc2dc7cf7bea32c48a0efaecb1' - }); - }); - - it('encodes signature baz(uint32, bool) correctly', () => { - expect(eventSignature('baz', [{ type: 'uint', length: 32 }, { type: 'bool' }])).to.deep.equal({ - id: 'baz(uint32,bool)', - name: 'baz', - signature: 'cdcd77c0992ec5bbfc459984220f8c45084cc24d9b6efed1fae540db8de801d2' - }); - }); - - it('encodes no-name signature correctly as ()', () => { - expect(eventSignature(undefined, [])).to.deep.equal({ - id: '()', - name: undefined, - signature: '' - }); - }); - - it('encodes no-params signature correctly as ()', () => { - expect(eventSignature(undefined, undefined)).to.deep.equal({ - id: '()', - name: undefined, - signature: '' - }); - }); - }); - - describe('methodSignature', () => { - it('encodes signature baz() correctly', () => { - expect(methodSignature('baz', [])).to.deep.equal({ - id: 'baz()', - name: 'baz', - signature: 'a7916fac' - }); - }); - - it('encodes signature baz(uint32) correctly', () => { - expect(methodSignature('baz', [{ type: 'uint', length: 32 }])).to.deep.equal({ - id: 'baz(uint32)', - name: 'baz', - signature: '7d68785e' - }); - }); - - it('encodes signature baz(uint32, bool) correctly', () => { - expect(methodSignature('baz', [{ type: 'uint', length: 32 }, { type: 'bool' }])).to.deep.equal({ - id: 'baz(uint32,bool)', - name: 'baz', - signature: 'cdcd77c0' - }); - }); - - it('encodes signature in name correctly', () => { - expect(methodSignature('baz(uint32,bool)', [{ type: 'uint', length: 32 }, { type: 'bool' }])).to.deep.equal({ - id: 'baz(uint32,bool)', - name: 'baz', - signature: 'cdcd77c0' - }); - }); - - it('encodes no-name signature correctly as ()', () => { - expect(methodSignature(undefined, [])).to.deep.equal({ - id: '()', - name: undefined, - signature: '' - }); - }); - - it('encodes no-params signature correctly as ()', () => { - expect(methodSignature(undefined, undefined)).to.deep.equal({ - id: '()', - name: undefined, - signature: '' - }); - }); - }); -}); diff --git a/js-old/src/abi/util/slice.js b/js-old/src/abi/util/slice.js deleted file mode 100644 index daab54f1ce2..00000000000 --- a/js-old/src/abi/util/slice.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { padAddress } from './pad'; - -export function sliceData (_data) { - if (!_data || !_data.length) { - return []; - } - - let data = (_data.substr(0, 2) === '0x') ? _data.substr(2) : _data; - - if (!data.length) { - data = padAddress(''); - } - - return data.match(/.{1,64}/g); -} diff --git a/js-old/src/abi/util/slice.spec.js b/js-old/src/abi/util/slice.spec.js deleted file mode 100644 index 1b754ccbb22..00000000000 --- a/js-old/src/abi/util/slice.spec.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { sliceData } from './slice'; - -describe('abi/util/slice', () => { - describe('sliceData', () => { - const slice1 = '131a3afc00d1b1e3461b955e53fc866dcf303b3eb9f4c16f89e388930f48134b'; - const slice2 = '2124768576358735263578356373526387638357635873563586353756358763'; - - it('returns an empty array when length === 0', () => { - expect(sliceData('')).to.deep.equal([]); - }); - - it('returns an array with the slices otherwise', () => { - const sliced = sliceData(`${slice1}${slice2}`); - - expect(sliced.length).to.equal(2); - expect(sliced[0]).to.equal(slice1); - expect(sliced[1]).to.equal(slice2); - }); - - it('removes leading 0x when passed in', () => { - const sliced = sliceData(`0x${slice1}${slice2}`); - - expect(sliced.length).to.equal(2); - expect(sliced[0]).to.equal(slice1); - expect(sliced[1]).to.equal(slice2); - }); - }); -}); diff --git a/js-old/src/abi/util/sliceAs.js b/js-old/src/abi/util/sliceAs.js deleted file mode 100644 index e177897a197..00000000000 --- a/js-old/src/abi/util/sliceAs.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -import { toChecksumAddress } from './address'; - -export function asU32 (slice) { - // TODO: validation - - return new BigNumber(slice, 16); -} - -export function asI32 (slice) { - if (new BigNumber(slice.substr(0, 1), 16).toString(2)[0] === '1') { - return new BigNumber(slice, 16) - .minus(new BigNumber('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)) - .minus(1); - } - - return new BigNumber(slice, 16); -} - -export function asAddress (slice) { - // TODO: address validation? - - return toChecksumAddress(`0x${slice.slice(-40)}`); -} - -export function asBool (slice) { - // TODO: everything else should be 0 - - return new BigNumber(slice[63]).eq(1); -} diff --git a/js-old/src/abi/util/sliceAs.spec.js b/js-old/src/abi/util/sliceAs.spec.js deleted file mode 100644 index c29e345547b..00000000000 --- a/js-old/src/abi/util/sliceAs.spec.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { asAddress, asBool, asI32, asU32 } from './sliceAs'; - -describe('abi/util/sliceAs', () => { - const MAX_INT = 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'; - - describe('asAddress', () => { - it('correctly returns the last 0x40 characters', () => { - const address = '1111111111222222222233333333334444444444'; - - expect(asAddress(`000000000000000000000000${address}`)).to.equal(`0x${address}`); - }); - }); - - describe('asBool', () => { - it('correctly returns true', () => { - expect(asBool('0000000000000000000000000000000000000000000000000000000000000001')).to.be.true; - }); - - it('correctly returns false', () => { - expect(asBool('0000000000000000000000000000000000000000000000000000000000000000')).to.be.false; - }); - }); - - describe('asI32', () => { - it('correctly decodes positive numbers', () => { - expect(asI32('000000000000000000000000000000000000000000000000000000000000007b').toString()).to.equal('123'); - }); - - it('correctly decodes negative numbers', () => { - expect(asI32('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff85').toString()).to.equal('-123'); - }); - }); - - describe('asU32', () => { - it('returns a maxium U32', () => { - expect(asU32(MAX_INT).toString(16)).to.equal(MAX_INT); - }); - }); -}); diff --git a/js-old/src/abi/util/types.js b/js-old/src/abi/util/types.js deleted file mode 100644 index dd408f3716f..00000000000 --- a/js-old/src/abi/util/types.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export function isArray (test) { - return Object.prototype.toString.call(test) === '[object Array]'; -} - -export function isString (test) { - return Object.prototype.toString.call(test) === '[object String]'; -} - -export function isInstanceOf (test, clazz) { - return test instanceof clazz; -} diff --git a/js-old/src/abi/util/types.spec.js b/js-old/src/abi/util/types.spec.js deleted file mode 100644 index 177662ae271..00000000000 --- a/js-old/src/abi/util/types.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { isArray, isString, isInstanceOf } from './types'; -import Token from '../token'; - -describe('abi/util/types', () => { - describe('isArray', () => { - it('correctly identifies empty arrays as Array', () => { - expect(isArray([])).to.be.true; - }); - - it('correctly identifies non-empty arrays as Array', () => { - expect(isArray([1, 2, 3])).to.be.true; - }); - - it('correctly identifies strings as non-Array', () => { - expect(isArray('not an array')).to.be.false; - }); - - it('correctly identifies objects as non-Array', () => { - expect(isArray({})).to.be.false; - }); - }); - - describe('isString', () => { - it('correctly identifies empty string as string', () => { - expect(isString('')).to.be.true; - }); - - it('correctly identifies string as string', () => { - expect(isString('123')).to.be.true; - }); - }); - - describe('isInstanceOf', () => { - it('correctly identifies build-in instanceof', () => { - expect(isInstanceOf(new String('123'), String)).to.be.true; // eslint-disable-line no-new-wrappers - }); - - it('correctly identifies own instanceof', () => { - expect(isInstanceOf(new Token('int', 123), Token)).to.be.true; - }); - - it('correctly reports false for own', () => { - expect(isInstanceOf({ type: 'int' }, Token)).to.be.false; - }); - }); -}); diff --git a/js-old/src/api/README.md b/js-old/src/api/README.md deleted file mode 100644 index 1a2051eaf49..00000000000 --- a/js-old/src/api/README.md +++ /dev/null @@ -1,146 +0,0 @@ -# ethapi-js - -A thin, fast, low-level Promise-based wrapper around the Ethereum APIs. - -[![Build Status](https://travis-ci.org/jacogr/ethapi-js.svg?branch=master)](https://travis-ci.org/jacogr/ethapi-js) -[![Coverage Status](https://coveralls.io/repos/github/jacogr/ethapi-js/badge.svg?branch=master)](https://coveralls.io/github/jacogr/ethapi-js?branch=master) -[![Dependency Status](https://david-dm.org/jacogr/ethapi-js.svg)](https://david-dm.org/jacogr/ethapi-js) -[![devDependency Status](https://david-dm.org/jacogr/ethapi-js/dev-status.svg)](https://david-dm.org/jacogr/ethapi-js#info=devDependencies) - -## contributing - -Clone the repo and install dependencies via `npm install`. Tests can be executed via - -- `npm run testOnce` (100% covered unit tests) -- `npm run testE2E` (E2E against a running RPC-enabled testnet Parity/Geth instance, `parity --testnet` and for WebScokets, `geth --testnet --ws --wsorigins '*' --rpc`) -- setting the environment `DEBUG=true` will display the RPC POST bodies and responses on E2E tests - -## installation - -Install the package with `npm install --save ethapi-js` from the [npm registry ethapi-js](https://www.npmjs.com/package/ethapi-js) - -## usage - -### initialisation - -```javascript -// import the actual EthApi class -import EthApi from 'ethapi-js'; - -// do the setup -const transport = new EthApi.Transport.Http('http://localhost:8545'); // or .Ws('ws://localhost:8546') -const ethapi = new EthApi(transport); -``` - -You will require native Promises and fetch support (latest browsers only), they can be utilised by - -```javascript -import 'isomorphic-fetch'; - -import es6Promise from 'es6-promise'; -es6Promise.polyfill(); -``` - -### making calls - -perform a call - -```javascript -ethapi.eth - .coinbase() - .then((coinbase) => { - console.log(`The coinbase is ${coinbase}`); - }); -``` - -multiple promises - -```javascript -Promise - .all([ - ethapi.eth.coinbase(), - ethapi.net.listening() - ]) - .then(([coinbase, listening]) => { - // do stuff here - }); -``` - -chaining promises - -```javascript -ethapi.eth - .newFilter({...}) - .then((filterId) => ethapi.eth.getFilterChanges(filterId)) - .then((changes) => { - console.log(changes); - }); -``` - -### contracts - -attach contract - -```javascript -const abi = [{ name: 'callMe', inputs: [{ type: 'bool', ...}, { type: 'string', ...}]}, ...abi...]; -const contract = new ethapi.newContract(abi); -``` - -deploy - -```javascript -contract - .deploy('0xc0de', [params], 'superPassword') - .then((address) => { - console.log(`the contract was deployed at ${address}`); - }); -``` - -attach a contract at address - -```javascript -// via the constructor & .at function -const contract = api.newContract(abi).at('0xa9280...7347b'); -// or on an already initialised contract -contract.at('0xa9280...7347b'); -// perform calls here -``` - -find & call a function - -```javascript -contract.instance - .myContractMethodName - .call({}, [myContractMethodParameter]) // or estimateGas or sendTransaction - .then((result) => { - console.log(`the result was ${result}`); - }); -``` - -parse events from transaction receipt - -```javascript -contract - .parseTransactionEvents(txReceipt) - .then((receipt) => { - receipt.logs.forEach((log) => { - console.log('log parameters', log.params); - }); - }); -``` - -## apis - -APIs implement the calls as exposed in the [Ethcore JSON Ethereum RPC](https://github.com/paritytech/ethereum-rpc-json/) definitions. Mapping follows the naming conventions of the originals, i.e. `eth_call` becomes `eth.call`, `personal_accounts` becomes `personal.accounts`, etc. - -- [ethapi.db](https://github.com/paritytech/ethereum-rpc-json/blob/master/interfaces.md#db) -- [ethapi.eth](https://github.com/paritytech/ethereum-rpc-json/blob/master/interfaces.md#eth) -- [ethapi.parity](https://github.com/paritytech/ethereum-rpc-json/blob/master/interfaces.md#parity) -- [ethapi.net](https://github.com/paritytech/ethereum-rpc-json/blob/master/interfaces.md#net) -- [ethapi.personal](https://github.com/paritytech/ethereum-rpc-json/blob/master/interfaces.md#personal) -- [ethapi.shh](https://github.com/paritytech/ethereum-rpc-json/blob/master/interfaces.md#shh) -- [ethapi.signer](https://github.com/paritytech/ethereum-rpc-json/blob/master/interfaces.md#signer) -- [ethapi.trace](https://github.com/paritytech/ethereum-rpc-json/blob/master/interfaces.md#trace) -- [ethapi.web3](https://github.com/paritytech/ethereum-rpc-json/blob/master/interfaces.md#web3) - -As a verification step, all exposed interfaces are tested for existing and pointing to the correct endpoints by using the generated interfaces from the above repo. diff --git a/js-old/src/api/api.js b/js-old/src/api/api.js deleted file mode 100644 index 220c3be2941..00000000000 --- a/js-old/src/api/api.js +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import EventEmitter from 'eventemitter3'; - -import { Http, Ws } from './transport'; -import Contract from './contract'; - -import { Db, Eth, Parity, Net, Personal, Shh, Signer, Trace, Web3 } from './rpc'; -import Subscriptions from './subscriptions'; -import Pubsub from './pubsub'; -import util from './util'; -import { isFunction } from './util/types'; - -import LocalAccountsMiddleware from '~/api/local'; - -export default class Api extends EventEmitter { - constructor (transport, allowSubscriptions = true) { - super(); - - if (!transport || !isFunction(transport.execute)) { - throw new Error('EthApi needs transport with execute() function defined'); - } - - this._transport = transport; - - this._db = new Db(transport); - this._eth = new Eth(transport); - this._net = new Net(transport); - this._parity = new Parity(transport); - this._personal = new Personal(transport); - this._shh = new Shh(transport); - this._signer = new Signer(transport); - this._trace = new Trace(transport); - this._web3 = new Web3(transport); - - if (isFunction(transport.subscribe)) { - this._pubsub = new Pubsub(transport); - } - - if (allowSubscriptions) { - this._subscriptions = new Subscriptions(this); - } - // Doing a request here in test env would cause an error - if (LocalAccountsMiddleware && process.env.NODE_ENV !== 'test') { - const middleware = this.parity - .nodeKind() - .then((nodeKind) => { - if (nodeKind.availability === 'public') { - return LocalAccountsMiddleware; - } - - return null; - }) - .catch(() => null); - - transport.addMiddleware(middleware); - } - } - - get pubsub () { - if (!this._pubsub) { - throw Error('Pubsub is only available with a subscribing-supported transport injected!'); - } - return this._pubsub; - } - - get db () { - return this._db; - } - - get eth () { - return this._eth; - } - - get parity () { - return this._parity; - } - - get net () { - return this._net; - } - - get personal () { - return this._personal; - } - - get shh () { - return this._shh; - } - - get signer () { - return this._signer; - } - - get trace () { - return this._trace; - } - - get transport () { - return this._transport; - } - - get web3 () { - return this._web3; - } - - get util () { - return util; - } - - newContract (abi, address) { - return new Contract(this, abi).at(address); - } - - subscribe (subscriptionName, callback) { - if (!this._subscriptions) { - return Promise.resolve(1); - } - - return this._subscriptions.subscribe(subscriptionName, callback); - } - - unsubscribe (subscriptionId) { - if (!this._subscriptions) { - return Promise.resolve(true); - } - - return this._subscriptions.unsubscribe(subscriptionId); - } - - pollMethod (method, input, validate) { - const [_group, endpoint] = method.split('_'); - const group = `_${_group}`; - - return new Promise((resolve, reject) => { - const timeout = () => { - this[group][endpoint](input) - .then((result) => { - if (validate ? validate(result) : result) { - resolve(result); - } else { - setTimeout(timeout, 500); - } - }) - .catch((error) => { - // Don't print if the request is rejected: that's ok - if (error.type !== 'REQUEST_REJECTED') { - console.error('pollMethod', error); - } - - reject(error); - }); - }; - - timeout(); - }); - } - - static util = util - - static Transport = { - Http: Http, - Ws: Ws - } -} diff --git a/js-old/src/api/api.spec.js b/js-old/src/api/api.spec.js deleted file mode 100644 index c72b2284922..00000000000 --- a/js-old/src/api/api.spec.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { TEST_HTTP_URL, endpointTest } from '../../test/mockRpc'; - -import util from './util'; -import Api from './api'; - -import ethereumRpc from '../jsonrpc/'; - -describe('api/Api', () => { - describe('constructor', () => { - it('requires defined/non-null transport object', () => { - expect(() => new Api()).to.throw(/Api needs transport/); - expect(() => new Api(null)).to.throw(/Api needs transport/); - }); - - it('requires an execute function on the transport object', () => { - expect(() => new Api({})).to.throw(/Api needs transport/); - expect(() => new Api({ execute: true })).to.throw(/Api needs transport/); - }); - }); - - describe('interface', () => { - const api = new Api(new Api.Transport.Http(TEST_HTTP_URL, -1)); - const ignored = [ - 'eth_subscribe', 'eth_unsubscribe', - 'parity_subscribe', 'parity_unsubscribe', - 'signer_subscribePending', 'signer_unsubscribePending' - ]; - - Object.keys(ethereumRpc).sort().forEach((endpoint) => { - describe(endpoint, () => { - Object.keys(ethereumRpc[endpoint]).sort() - .filter(method => ignored.indexOf(method) !== -1) - .forEach((method) => { - endpointTest(api, endpoint, method); - }); - }); - }); - }); - - it('exposes util as static property', () => { - expect(Api.util).to.equal(util); - }); -}); diff --git a/js-old/src/api/contract/contract.js b/js-old/src/api/contract/contract.js deleted file mode 100644 index dee4d6d777b..00000000000 --- a/js-old/src/api/contract/contract.js +++ /dev/null @@ -1,561 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Abi from '~/abi'; - -let nextSubscriptionId = 0; - -export default class Contract { - constructor (api, abi) { - if (!api) { - throw new Error('API instance needs to be provided to Contract'); - } - - if (!abi) { - throw new Error('ABI needs to be provided to Contract instance'); - } - - this._api = api; - this._abi = new Abi(abi); - - this._subscriptions = {}; - this._constructors = this._abi.constructors.map(this._bindFunction); - this._functions = this._abi.functions.map(this._bindFunction); - this._events = this._abi.events.map(this._bindEvent); - - this._instance = {}; - - this._events.forEach((evt) => { - this._instance[evt.name] = evt; - this._instance[evt.signature] = evt; - }); - - this._functions.forEach((fn) => { - this._instance[fn.name] = fn; - this._instance[fn.signature] = fn; - }); - - this._subscribedToPendings = false; - this._pendingsSubscriptionId = null; - - this._subscribedToBlock = false; - this._blockSubscriptionId = null; - - if (api && api.patch && api.patch.contract) { - api.patch.contract(this); - } - } - - get address () { - return this._address; - } - - get constructors () { - return this._constructors; - } - - get events () { - return this._events; - } - - get functions () { - return this._functions; - } - - get receipt () { - return this._receipt; - } - - get instance () { - this._instance.address = this._address; - return this._instance; - } - - get api () { - return this._api; - } - - get abi () { - return this._abi; - } - - at (address) { - this._address = address; - return this; - } - - deployEstimateGas (options, values) { - const _options = this._encodeOptions(this.constructors[0], options, values); - - return this._api.eth - .estimateGas(_options) - .then((gasEst) => { - return [gasEst, gasEst.mul(1.2)]; - }); - } - - deploy (options, values, statecb = () => {}, skipGasEstimate = false) { - let gasEstPromise; - - if (skipGasEstimate) { - gasEstPromise = Promise.resolve(null); - } else { - statecb(null, { state: 'estimateGas' }); - - gasEstPromise = this.deployEstimateGas(options, values) - .then(([gasEst, gas]) => gas); - } - - return gasEstPromise - .then((_gas) => { - if (_gas) { - options.gas = _gas.toFixed(0); - } - - const gas = _gas || options.gas; - - statecb(null, { state: 'postTransaction', gas }); - - const encodedOptions = this._encodeOptions(this.constructors[0], options, values); - - return this._api.parity - .postTransaction(encodedOptions) - .then((requestId) => { - statecb(null, { state: 'checkRequest', requestId }); - return this._pollCheckRequest(requestId); - }) - .then((txhash) => { - statecb(null, { state: 'getTransactionReceipt', txhash }); - return this._pollTransactionReceipt(txhash, gas); - }) - .then((receipt) => { - if (receipt.gasUsed.eq(gas)) { - throw new Error(`Contract not deployed, gasUsed == ${gas.toFixed(0)}`); - } - - statecb(null, { state: 'hasReceipt', receipt }); - this._receipt = receipt; - this._address = receipt.contractAddress; - return this._address; - }) - .then((address) => { - statecb(null, { state: 'getCode' }); - return this._api.eth.getCode(this._address); - }) - .then((code) => { - if (code === '0x') { - throw new Error('Contract not deployed, getCode returned 0x'); - } - - statecb(null, { state: 'completed' }); - return this._address; - }); - }); - } - - parseEventLogs (logs) { - return logs - .map((log) => { - const signature = log.topics[0].substr(2); - const event = this.events.find((evt) => evt.signature === signature); - - if (!event) { - console.warn(`Unable to find event matching signature ${signature}`); - return null; - } - - try { - const decoded = event.decodeLog(log.topics, log.data); - - log.params = {}; - log.event = event.name; - - decoded.params.forEach((param, index) => { - const { type, value } = param.token; - const key = param.name || index; - - log.params[key] = { type, value }; - }); - - return log; - } catch (error) { - console.warn('Error decoding log', log); - console.warn(error); - - return null; - } - }) - .filter((log) => log); - } - - parseTransactionEvents (receipt) { - receipt.logs = this.parseEventLogs(receipt.logs); - - return receipt; - } - - _pollCheckRequest = (requestId) => { - return this._api.pollMethod('parity_checkRequest', requestId); - } - - _pollTransactionReceipt = (txhash, gas) => { - return this.api.pollMethod('eth_getTransactionReceipt', txhash, (receipt) => { - if (!receipt || !receipt.blockNumber || receipt.blockNumber.eq(0)) { - return false; - } - - return true; - }); - } - - getCallData = (func, options, values) => { - let data = options.data; - - const tokens = func ? Abi.encodeTokens(func.inputParamTypes(), values) : null; - const call = tokens ? func.encodeCall(tokens) : null; - - if (data && data.substr(0, 2) === '0x') { - data = data.substr(2); - } - - return `0x${data || ''}${call || ''}`; - } - - _encodeOptions (func, options, values) { - const data = this.getCallData(func, options, values); - - return { - ...options, - data - }; - } - - _addOptionsTo (options = {}) { - return { - to: this._address, - ...options - }; - } - - _bindFunction = (func) => { - func.contract = this; - - func.call = (_options = {}, values = []) => { - const rawTokens = !!_options.rawTokens; - const options = { - ..._options - }; - - delete options.rawTokens; - - let callParams; - - try { - callParams = this._encodeOptions(func, this._addOptionsTo(options), values); - } catch (error) { - return Promise.reject(error); - } - - return this._api.eth - .call(callParams) - .then((encoded) => func.decodeOutput(encoded)) - .then((tokens) => { - if (rawTokens) { - return tokens; - } - - return tokens.map((token) => token.value); - }) - .then((returns) => returns.length === 1 ? returns[0] : returns) - .catch((error) => { - console.warn(`${func.name}.call`, values, error); - throw error; - }); - }; - - if (!func.constant) { - func.postTransaction = (options, values = []) => { - let _options; - - try { - _options = this._encodeOptions(func, this._addOptionsTo(options), values); - } catch (error) { - return Promise.reject(error); - } - - return this._api.parity - .postTransaction(_options) - .catch((error) => { - console.warn(`${func.name}.postTransaction`, values, error); - throw error; - }); - }; - - func.estimateGas = (options, values = []) => { - const _options = this._encodeOptions(func, this._addOptionsTo(options), values); - - return this._api.eth - .estimateGas(_options) - .catch((error) => { - console.warn(`${func.name}.estimateGas`, values, error); - throw error; - }); - }; - } - - return func; - } - - _bindEvent = (event) => { - event.subscribe = (options = {}, callback, autoRemove) => { - return this._subscribe(event, options, callback, autoRemove); - }; - - event.unsubscribe = (subscriptionId) => { - return this.unsubscribe(subscriptionId); - }; - - event.getAllLogs = (options = {}) => { - return this.getAllLogs(event); - }; - - return event; - } - - getAllLogs (event, _options) { - // Options as first parameter - if (!_options && event && event.topics) { - return this.getAllLogs(null, event); - } - - const options = this._getFilterOptions(event, _options); - - options.fromBlock = 0; - options.toBlock = 'latest'; - - return this._api.eth - .getLogs(options) - .then((logs) => this.parseEventLogs(logs)); - } - - _findEvent (eventName = null) { - const event = eventName - ? this._events.find((evt) => evt.name === eventName) - : null; - - if (eventName && !event) { - const events = this._events.map((evt) => evt.name).join(', '); - - throw new Error(`${eventName} is not a valid eventName, subscribe using one of ${events} (or null to include all)`); - } - - return event; - } - - _getFilterOptions (event = null, _options = {}) { - const optionTopics = _options.topics || []; - const signature = event && event.signature || null; - - // If event provided, remove the potential event signature - // as the first element of the topics - const topics = signature - ? [ signature ].concat(optionTopics.filter((t, idx) => idx > 0 || t !== signature)) - : optionTopics; - - const options = Object.assign({}, _options, { - address: this._address, - topics - }); - - return options; - } - - _createEthFilter (event = null, _options) { - const options = this._getFilterOptions(event, _options); - - return this._api.eth.newFilter(options); - } - - subscribe (eventName = null, options = {}, callback, autoRemove) { - try { - const event = this._findEvent(eventName); - - return this._subscribe(event, options, callback, autoRemove); - } catch (e) { - return Promise.reject(e); - } - } - - _sendData (subscriptionId, error, logs) { - const { autoRemove, callback } = this._subscriptions[subscriptionId]; - let result = true; - - try { - result = callback(error, logs); - } catch (error) { - console.warn('_sendData', subscriptionId, error); - } - - if (autoRemove && result && typeof result === 'boolean') { - this.unsubscribe(subscriptionId); - } - } - - _subscribe (event = null, _options, callback, autoRemove = false) { - const subscriptionId = nextSubscriptionId++; - const { skipInitFetch } = _options; - - delete _options['skipInitFetch']; - - return this - ._createEthFilter(event, _options) - .then((filterId) => { - this._subscriptions[subscriptionId] = { - options: _options, - autoRemove, - callback, - filterId, - id: subscriptionId - }; - - if (skipInitFetch) { - this._subscribeToChanges(); - return subscriptionId; - } - - return this._api.eth - .getFilterLogs(filterId) - .then((logs) => { - this._sendData(subscriptionId, null, this.parseEventLogs(logs)); - this._subscribeToChanges(); - return subscriptionId; - }); - }) - .catch((error) => { - console.warn('subscribe', event, _options, error); - throw error; - }); - } - - unsubscribe (subscriptionId) { - return this._api.eth - .uninstallFilter(this._subscriptions[subscriptionId].filterId) - .catch((error) => { - console.error('unsubscribe', error); - }) - .then(() => { - delete this._subscriptions[subscriptionId]; - this._unsubscribeFromChanges(); - }); - } - - _subscribeToChanges = () => { - const subscriptions = Object.values(this._subscriptions); - - const pendingSubscriptions = subscriptions - .filter((s) => s.options.toBlock && s.options.toBlock === 'pending'); - - const otherSubscriptions = subscriptions - .filter((s) => !(s.options.toBlock && s.options.toBlock === 'pending')); - - if (pendingSubscriptions.length > 0 && !this._subscribedToPendings) { - this._subscribedToPendings = true; - this._subscribeToPendings(); - } - - if (otherSubscriptions.length > 0 && !this._subscribedToBlock) { - this._subscribedToBlock = true; - this._subscribeToBlock(); - } - } - - _unsubscribeFromChanges = () => { - const subscriptions = Object.values(this._subscriptions); - - const pendingSubscriptions = subscriptions - .filter((s) => s.options.toBlock && s.options.toBlock === 'pending'); - - const otherSubscriptions = subscriptions - .filter((s) => !(s.options.toBlock && s.options.toBlock === 'pending')); - - if (pendingSubscriptions.length === 0 && this._subscribedToPendings) { - this._subscribedToPendings = false; - clearTimeout(this._pendingsSubscriptionId); - } - - if (otherSubscriptions.length === 0 && this._subscribedToBlock) { - this._subscribedToBlock = false; - this._api.unsubscribe(this._blockSubscriptionId); - } - } - - _subscribeToBlock = () => { - this._api - .subscribe('eth_blockNumber', (error) => { - if (error) { - console.error('::_subscribeToBlock', error, error && error.stack); - } - - const subscriptions = Object.values(this._subscriptions) - .filter((s) => !(s.options.toBlock && s.options.toBlock === 'pending')); - - this._sendSubscriptionChanges(subscriptions); - }) - .then((blockSubId) => { - this._blockSubscriptionId = blockSubId; - }) - .catch((e) => { - console.error('::_subscribeToBlock', e, e && e.stack); - }); - } - - _subscribeToPendings = () => { - const subscriptions = Object.values(this._subscriptions) - .filter((s) => s.options.toBlock && s.options.toBlock === 'pending'); - - const timeout = () => setTimeout(() => this._subscribeToPendings(), 1000); - - this._sendSubscriptionChanges(subscriptions) - .then(() => { - this._pendingsSubscriptionId = timeout(); - }); - } - - _sendSubscriptionChanges = (subscriptions) => { - return Promise - .all( - subscriptions.map((subscription) => { - return this._api.eth.getFilterChanges(subscription.filterId); - }) - ) - .then((logsArray) => { - logsArray.forEach((logs, index) => { - if (!logs || !logs.length) { - return; - } - - try { - this._sendData(subscriptions[index].id, null, this.parseEventLogs(logs)); - } catch (error) { - console.error('_sendSubscriptionChanges', error); - } - }); - }) - .catch((error) => { - console.error('_sendSubscriptionChanges', error); - }); - } -} diff --git a/js-old/src/api/contract/contract.spec.js b/js-old/src/api/contract/contract.spec.js deleted file mode 100644 index bd8b0fbdae7..00000000000 --- a/js-old/src/api/contract/contract.spec.js +++ /dev/null @@ -1,597 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; -import sinon from 'sinon'; - -import { TEST_HTTP_URL, mockHttp } from '../../../test/mockRpc'; - -import Abi from '../../abi'; -import { sha3 } from '../util/sha3'; - -import Api from '../api'; -import Contract from './contract'; -import { isInstanceOf, isFunction } from '../util/types'; - -const transport = new Api.Transport.Http(TEST_HTTP_URL, -1); -const eth = new Api(transport); - -describe('api/contract/Contract', () => { - const ADDR = '0x0123456789'; - - const ABI = [ - { - type: 'function', name: 'test', - inputs: [{ name: 'boolin', type: 'bool' }, { name: 'stringin', type: 'string' }], - outputs: [{ type: 'uint' }] - }, - { - type: 'function', name: 'test2', - outputs: [{ type: 'uint' }, { type: 'uint' }] - }, - { - type: 'constructor', - inputs: [{ name: 'boolin', type: 'bool' }, { name: 'stringin', type: 'string' }] - }, - { type: 'event', name: 'baz' }, - { type: 'event', name: 'foo' } - ]; - - const ABI_NO_PARAMS = [ - { - type: 'function', name: 'test', - inputs: [{ name: 'boolin', type: 'bool' }, { name: 'stringin', type: 'string' }], - outputs: [{ type: 'uint' }] - }, - { - type: 'function', name: 'test2', - outputs: [{ type: 'uint' }, { type: 'uint' }] - }, - { - type: 'constructor' - }, - { type: 'event', name: 'baz' }, - { type: 'event', name: 'foo' } - ]; - - const VALUES = [ true, 'jacogr' ]; - const CALLDATA = ` - 0000000000000000000000000000000000000000000000000000000000000001 - 0000000000000000000000000000000000000000000000000000000000000040 - 0000000000000000000000000000000000000000000000000000000000000006 - 6a61636f67720000000000000000000000000000000000000000000000000000 - `.replace(/\s/g, ''); - const SIGNATURE = '02356205'; - - const ENCODED = `0x${SIGNATURE}${CALLDATA}`; - - const RETURN1 = '0000000000000000000000000000000000000000000000000000000000123456'; - const RETURN2 = '0000000000000000000000000000000000000000000000000000000000456789'; - let scope; - - describe('constructor', () => { - it('needs an EthAbi instance', () => { - expect(() => new Contract()).to.throw(/API instance needs to be provided to Contract/); - }); - - it('needs an ABI', () => { - expect(() => new Contract(eth)).to.throw(/ABI needs to be provided to Contract instance/); - }); - - describe('internal setup', () => { - const contract = new Contract(eth, ABI); - - it('sets EthApi & parsed interface', () => { - expect(contract.address).to.not.be.ok; - expect(contract.api).to.deep.equal(eth); - expect(isInstanceOf(contract.abi, Abi)).to.be.ok; - }); - - it('attaches functions', () => { - expect(contract.functions.length).to.equal(2); - expect(contract.functions[0].name).to.equal('test'); - }); - - it('attaches constructors', () => { - expect(contract.constructors.length).to.equal(1); - }); - - it('attaches events', () => { - expect(contract.events.length).to.equal(2); - expect(contract.events[0].name).to.equal('baz'); - }); - }); - }); - - describe('at', () => { - it('sets returns the functions, events & sets the address', () => { - const contract = new Contract(eth, [ - { - constant: true, - inputs: [{ - name: '_who', - type: 'address' - }], - name: 'balanceOf', - outputs: [{ - name: '', - type: 'uint256' - }], - type: 'function' - }, - { - anonymous: false, - inputs: [{ - indexed: false, - name: 'amount', - type: 'uint256' - }], - name: 'Drained', - type: 'event' - } - ]); - - contract.at('6789'); - - expect(Object.keys(contract.instance)).to.deep.equal([ - 'Drained', - /^(?:0x)(.+)$/.exec(sha3('Drained(uint256)'))[1], - 'balanceOf', - /^(?:0x)(.+)$/.exec(sha3('balanceOf(address)'))[1].substr(0, 8), - 'address' - ]); - expect(contract.address).to.equal('6789'); - }); - }); - - describe('parseTransactionEvents', () => { - it('parses a transaction log into the data', () => { - const contract = new Contract(eth, [ - { - anonymous: false, name: 'Message', type: 'event', - inputs: [ - { indexed: true, name: 'postId', type: 'uint256' }, - { indexed: false, name: 'parentId', type: 'uint256' }, - { indexed: false, name: 'sender', type: 'address' }, - { indexed: false, name: 'at', type: 'uint256' }, - { indexed: false, name: 'messageId', type: 'uint256' }, - { indexed: false, name: 'message', type: 'string' } - ] - } - ]); - const decoded = contract.parseTransactionEvents({ - blockHash: '0xa9280530a3b47bee2fc80f2862fd56502ae075350571d724d6442ea4c597347b', - blockNumber: '0x4fcd', - cumulativeGasUsed: '0xb57f', - gasUsed: '0xb57f', - logs: [{ - address: '0x22bff18ec62281850546a664bb63a5c06ac5f76c', - blockHash: '0xa9280530a3b47bee2fc80f2862fd56502ae075350571d724d6442ea4c597347b', - blockNumber: '0x4fcd', - data: '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063cf90d3f0410092fc0fca41846f5962239791950000000000000000000000000000000000000000000000000000000056e6c85f0000000000000000000000000000000000000000000000000001000000004fcd00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000d706f7374286d6573736167652900000000000000000000000000000000000000', - logIndex: '0x0', - topics: [ - '0x954ba6c157daf8a26539574ffa64203c044691aa57251af95f4b48d85ec00dd5', - '0x0000000000000000000000000000000000000000000000000001000000004fe0' - ], - transactionHash: '0xca16f537d761d13e4e80953b754e2b15541f267d6cad9381f750af1bae1e4917', - transactionIndex: '0x0' - }], - to: '0x22bff18ec62281850546a664bb63a5c06ac5f76c', - transactionHash: '0xca16f537d761d13e4e80953b754e2b15541f267d6cad9381f750af1bae1e4917', - transactionIndex: '0x0' - }); - const log = decoded.logs[0]; - - expect(log.event).to.equal('Message'); - expect(log.address).to.equal('0x22bff18ec62281850546a664bb63a5c06ac5f76c'); - expect(log.params).to.deep.equal({ - at: { type: 'uint', value: new BigNumber('1457965151') }, - message: { type: 'string', value: 'post(message)' }, - messageId: { type: 'uint', value: new BigNumber('281474976731085') }, - parentId: { type: 'uint', value: new BigNumber(0) }, - postId: { type: 'uint', value: new BigNumber('281474976731104') }, - sender: { type: 'address', value: '0x63Cf90D3f0410092FC0fca41846f596223979195' } - }); - }); - }); - - describe('_pollTransactionReceipt', () => { - const contract = new Contract(eth, ABI); - const ADDRESS = '0xD337e80eEdBdf86eDBba021797d7e4e00Bb78351'; - const BLOCKNUMBER = '555000'; - const RECEIPT = { contractAddress: ADDRESS.toLowerCase(), blockNumber: BLOCKNUMBER }; - const EXPECT = { contractAddress: ADDRESS, blockNumber: new BigNumber(BLOCKNUMBER) }; - - let scope; - let receipt; - - describe('success', () => { - before(() => { - scope = mockHttp([ - { method: 'eth_getTransactionReceipt', reply: { result: null } }, - { method: 'eth_getTransactionReceipt', reply: { result: null } }, - { method: 'eth_getTransactionReceipt', reply: { result: RECEIPT } } - ]); - - return contract - ._pollTransactionReceipt('0x123') - .then((_receipt) => { - receipt = _receipt; - }); - }); - - it('sends multiple getTransactionReceipt calls', () => { - expect(scope.isDone()).to.be.true; - }); - - it('passes the txhash through', () => { - expect(scope.body.eth_getTransactionReceipt.params[0]).to.equal('0x123'); - }); - - it('receives the final receipt', () => { - expect(receipt).to.deep.equal(EXPECT); - }); - }); - - describe('error', () => { - before(() => { - scope = mockHttp([{ method: 'eth_getTransactionReceipt', reply: { error: { code: -1, message: 'failure' } } }]); - }); - - it('returns the errors', () => { - return contract - ._pollTransactionReceipt('0x123') - .catch((error) => { - expect(error.message).to.match(/failure/); - }); - }); - }); - }); - - describe('deploy without parameters', () => { - const contract = new Contract(eth, ABI_NO_PARAMS); - const CODE = '0x123'; - const ADDRESS = '0xD337e80eEdBdf86eDBba021797d7e4e00Bb78351'; - const RECEIPT_DONE = { contractAddress: ADDRESS.toLowerCase(), gasUsed: 50, blockNumber: 2500 }; - - let scope; - - describe('success', () => { - before(() => { - scope = mockHttp([ - { method: 'eth_estimateGas', reply: { result: 1000 } }, - { method: 'parity_postTransaction', reply: { result: '0x678' } }, - { method: 'parity_checkRequest', reply: { result: '0x890' } }, - { method: 'eth_getTransactionReceipt', reply: { result: RECEIPT_DONE } }, - { method: 'eth_getCode', reply: { result: CODE } } - ]); - - return contract.deploy({ data: CODE }, []); - }); - - it('passes the options through to postTransaction (incl. gas calculation)', () => { - expect(scope.body.parity_postTransaction.params[0].data).to.equal(CODE); - }); - }); - }); - - describe('deploy', () => { - const contract = new Contract(eth, ABI); - const ADDRESS = '0xD337e80eEdBdf86eDBba021797d7e4e00Bb78351'; - const RECEIPT_PEND = { contractAddress: ADDRESS.toLowerCase(), gasUsed: 50, blockNumber: 0 }; - const RECEIPT_DONE = { contractAddress: ADDRESS.toLowerCase(), gasUsed: 50, blockNumber: 2500 }; - const RECEIPT_EXCP = { contractAddress: ADDRESS.toLowerCase(), gasUsed: 1200, blockNumber: 2500 }; - - let scope; - - describe('success', () => { - before(() => { - scope = mockHttp([ - { method: 'eth_estimateGas', reply: { result: 1000 } }, - { method: 'parity_postTransaction', reply: { result: '0x678' } }, - { method: 'parity_checkRequest', reply: { result: null } }, - { method: 'parity_checkRequest', reply: { result: '0x890' } }, - { method: 'eth_getTransactionReceipt', reply: { result: null } }, - { method: 'eth_getTransactionReceipt', reply: { result: RECEIPT_PEND } }, - { method: 'eth_getTransactionReceipt', reply: { result: RECEIPT_DONE } }, - { method: 'eth_getCode', reply: { result: '0x456' } } - ]); - - return contract.deploy({ data: '0x123' }, VALUES); - }); - - it('calls estimateGas, postTransaction, checkRequest, getTransactionReceipt & getCode in order', () => { - expect(scope.isDone()).to.be.true; - }); - - it('passes the options through to postTransaction (incl. gas calculation)', () => { - expect(scope.body.parity_postTransaction.params).to.deep.equal([ - { data: `0x123${CALLDATA}`, gas: '0x4b0' } - ]); - }); - - it('sets the address of the contract', () => { - expect(contract.address).to.equal(ADDRESS); - }); - }); - - describe('error', () => { - it('fails when gasUsed == gas', () => { - mockHttp([ - { method: 'eth_estimateGas', reply: { result: 1000 } }, - { method: 'parity_postTransaction', reply: { result: '0x678' } }, - { method: 'parity_checkRequest', reply: { result: '0x789' } }, - { method: 'eth_getTransactionReceipt', reply: { result: RECEIPT_EXCP } } - ]); - - return contract - .deploy({ data: '0x123' }, VALUES) - .catch((error) => { - expect(error.message).to.match(/not deployed, gasUsed/); - }); - }); - - it('fails when no code was deployed', () => { - mockHttp([ - { method: 'eth_estimateGas', reply: { result: 1000 } }, - { method: 'parity_postTransaction', reply: { result: '0x678' } }, - { method: 'parity_checkRequest', reply: { result: '0x789' } }, - { method: 'eth_getTransactionReceipt', reply: { result: RECEIPT_DONE } }, - { method: 'eth_getCode', reply: { result: '0x' } } - ]); - - return contract - .deploy({ data: '0x123' }, VALUES) - .catch((error) => { - expect(error.message).to.match(/not deployed, getCode/); - }); - }); - }); - }); - - describe('bindings', () => { - let contract; - let cons; - let func; - - beforeEach(() => { - contract = new Contract(eth, ABI); - contract.at(ADDR); - cons = contract.constructors[0]; - func = contract.functions.find((fn) => fn.name === 'test'); - }); - - describe('_addOptionsTo', () => { - it('works on no object specified', () => { - expect(contract._addOptionsTo()).to.deep.equal({ to: ADDR }); - }); - - it('uses the contract address when none specified', () => { - expect(contract._addOptionsTo({ from: 'me' })).to.deep.equal({ to: ADDR, from: 'me' }); - }); - - it('overrides the contract address when specified', () => { - expect(contract._addOptionsTo({ to: 'you', from: 'me' })).to.deep.equal({ to: 'you', from: 'me' }); - }); - }); - - describe('attachments', () => { - it('attaches .call, .postTransaction & .estimateGas to constructors', () => { - expect(isFunction(cons.call)).to.be.true; - expect(isFunction(cons.postTransaction)).to.be.true; - expect(isFunction(cons.estimateGas)).to.be.true; - }); - - it('attaches .call, .postTransaction & .estimateGas to functions', () => { - expect(isFunction(func.call)).to.be.true; - expect(isFunction(func.postTransaction)).to.be.true; - expect(isFunction(func.estimateGas)).to.be.true; - }); - - it('attaches .call only to constant functions', () => { - func = (new Contract(eth, [{ type: 'function', name: 'test', constant: true }])).functions[0]; - - expect(isFunction(func.call)).to.be.true; - expect(isFunction(func.postTransaction)).to.be.false; - expect(isFunction(func.estimateGas)).to.be.false; - }); - }); - - describe('postTransaction', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'parity_postTransaction', reply: { result: ['hashId'] } }]); - }); - - it('encodes options and mades an parity_postTransaction call', () => { - return func - .postTransaction({ someExtras: 'foo' }, VALUES) - .then(() => { - expect(scope.isDone()).to.be.true; - expect(scope.body.parity_postTransaction.params[0]).to.deep.equal({ - someExtras: 'foo', - to: ADDR, - data: ENCODED - }); - }); - }); - }); - - describe('estimateGas', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_estimateGas', reply: { result: ['0x123'] } }]); - }); - - it('encodes options and mades an eth_estimateGas call', () => { - return func - .estimateGas({ someExtras: 'foo' }, VALUES) - .then((amount) => { - expect(scope.isDone()).to.be.true; - expect(amount.toString(16)).to.equal('123'); - expect(scope.body.eth_estimateGas.params).to.deep.equal([{ - someExtras: 'foo', - to: ADDR, - data: ENCODED - }]); - }); - }); - }); - - describe('call', () => { - it('encodes options and mades an eth_call call', () => { - scope = mockHttp([{ method: 'eth_call', reply: { result: RETURN1 } }]); - - return func - .call({ someExtras: 'foo' }, VALUES) - .then((result) => { - expect(scope.isDone()).to.be.true; - expect(scope.body.eth_call.params).to.deep.equal([{ - someExtras: 'foo', - to: ADDR, - data: ENCODED - }, 'latest']); - expect(result.toString(16)).to.equal('123456'); - }); - }); - - it('encodes options and mades an eth_call call (multiple returns)', () => { - scope = mockHttp([{ method: 'eth_call', reply: { result: `${RETURN1}${RETURN2}` } }]); - - return contract.functions[1] - .call({}, []) - .then((result) => { - expect(scope.isDone()).to.be.true; - expect(result.length).to.equal(2); - expect(result[0].toString(16)).to.equal('123456'); - expect(result[1].toString(16)).to.equal('456789'); - }); - }); - }); - }); - - describe('subscribe', () => { - const abi = [ - { - anonymous: false, name: 'Message', type: 'event', - inputs: [ - { indexed: true, name: 'postId', type: 'uint256' }, - { indexed: false, name: 'parentId', type: 'uint256' }, - { indexed: false, name: 'sender', type: 'address' }, - { indexed: false, name: 'at', type: 'uint256' }, - { indexed: false, name: 'messageId', type: 'uint256' }, - { indexed: false, name: 'message', type: 'string' } - ] - } - ]; - - const logs = [{ - address: '0x22bff18ec62281850546a664bb63a5c06ac5f76c', - blockHash: '0xa9280530a3b47bee2fc80f2862fd56502ae075350571d724d6442ea4c597347b', - blockNumber: '0x4fcd', - data: '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063cf90d3f0410092fc0fca41846f5962239791950000000000000000000000000000000000000000000000000000000056e6c85f0000000000000000000000000000000000000000000000000001000000004fcd00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000d706f7374286d6573736167652900000000000000000000000000000000000000', - logIndex: '0x0', - topics: [ - '0x954ba6c157daf8a26539574ffa64203c044691aa57251af95f4b48d85ec00dd5', - '0x0000000000000000000000000000000000000000000000000001000000004fe0' - ], - transactionHash: '0xca16f537d761d13e4e80953b754e2b15541f267d6cad9381f750af1bae1e4917', - transactionIndex: '0x0' - }]; - - const parsed = [{ - address: '0x22bfF18ec62281850546a664bb63a5C06AC5F76C', - blockHash: '0xa9280530a3b47bee2fc80f2862fd56502ae075350571d724d6442ea4c597347b', - blockNumber: new BigNumber(20429), - data: '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063cf90d3f0410092fc0fca41846f5962239791950000000000000000000000000000000000000000000000000000000056e6c85f0000000000000000000000000000000000000000000000000001000000004fcd00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000d706f7374286d6573736167652900000000000000000000000000000000000000', - event: 'Message', - logIndex: new BigNumber(0), - params: { - at: { type: 'uint', value: new BigNumber(1457965151) }, - message: { type: 'string', value: 'post(message)' }, - messageId: { type: 'uint', value: new BigNumber(281474976731085) }, - parentId: { type: 'uint', value: new BigNumber(0) }, - postId: { type: 'uint', value: new BigNumber(281474976731104) }, - sender: { type: 'address', value: '0x63Cf90D3f0410092FC0fca41846f596223979195' } - }, - topics: [ - '0x954ba6c157daf8a26539574ffa64203c044691aa57251af95f4b48d85ec00dd5', - '0x0000000000000000000000000000000000000000000000000001000000004fe0' - ], - transactionHash: '0xca16f537d761d13e4e80953b754e2b15541f267d6cad9381f750af1bae1e4917', - transactionIndex: new BigNumber(0) - }]; - - let contract; - - beforeEach(() => { - contract = new Contract(eth, abi); - contract.at(ADDR); - }); - - describe('invalid events', () => { - it('fails to subscribe to an invalid names', () => { - return contract - .subscribe('invalid') - .catch((error) => { - expect(error.message).to.match(/invalid is not a valid eventName/); - }); - }); - }); - - describe('valid events', () => { - let cbb; - let cbe; - - beforeEach(() => { - scope = mockHttp([ - { method: 'eth_newFilter', reply: { result: '0x123' } }, - { method: 'eth_getFilterLogs', reply: { result: logs } }, - { method: 'eth_getFilterChanges', reply: { result: logs } }, - { method: 'eth_newFilter', reply: { result: '0x123' } }, - { method: 'eth_getFilterLogs', reply: { result: logs } } - ]); - cbb = sinon.stub(); - cbe = sinon.stub(); - - return contract.subscribe('Message', { toBlock: 'pending' }, cbb); - }); - - it('sets the subscriptionId returned', () => { - return contract - .subscribe('Message', { toBlock: 'pending' }, cbe) - .then((subscriptionId) => { - expect(subscriptionId).to.equal(1); - }); - }); - - it('creates a new filter and retrieves the logs on it', () => { - return contract - .subscribe('Message', { toBlock: 'pending' }, cbe) - .then((subscriptionId) => { - expect(scope.isDone()).to.be.true; - }); - }); - - it('returns the logs to the callback', () => { - return contract - .subscribe('Message', { toBlock: 'pending' }, cbe) - .then((subscriptionId) => { - expect(cbe).to.have.been.calledWith(null, parsed); - }); - }); - }); - }); -}); diff --git a/js-old/src/api/contract/index.js b/js-old/src/api/contract/index.js deleted file mode 100644 index 74c58e942d4..00000000000 --- a/js-old/src/api/contract/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './contract'; diff --git a/js-old/src/api/format/input.js b/js-old/src/api/format/input.js deleted file mode 100644 index 0ccd10604bf..00000000000 --- a/js-old/src/api/format/input.js +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -import { isArray, isHex, isInstanceOf, isString } from '../util/types'; -import { padLeft, toHex } from '../util/format'; - -export function inAddress (address) { - // TODO: address validation if we have upper-lower addresses - return inHex(address); -} - -export function inAddresses (addresses) { - return (addresses || []).map(inAddress); -} - -export function inBlockNumber (blockNumber) { - if (isString(blockNumber)) { - switch (blockNumber) { - case 'earliest': - case 'latest': - case 'pending': - return blockNumber; - } - } - - return inNumber16(blockNumber); -} - -export function inData (data) { - if (data && data.length && !isHex(data)) { - data = data.split('').map((chr) => { - return `0${chr.charCodeAt(0).toString(16)}`.slice(-2); - }).join(''); - } - - return inHex(data); -} - -export function inHash (hash) { - return inHex(hash); -} - -export function inTopics (_topics) { - let topics = (_topics || []) - .filter((topic) => topic === null || topic) - .map((topic) => { - if (topic === null) { - return null; - } - - if (Array.isArray(topic)) { - return inTopics(topic); - } - - return padLeft(topic, 32); - }); - - return topics; -} - -export function inFilter (options) { - if (options) { - Object.keys(options).forEach((key) => { - switch (key) { - case 'address': - if (isArray(options[key])) { - options[key] = options[key].map(inAddress); - } else { - options[key] = inAddress(options[key]); - } - break; - - case 'fromBlock': - case 'toBlock': - options[key] = inBlockNumber(options[key]); - break; - - case 'limit': - options[key] = inNumber10(options[key]); - break; - - case 'topics': - options[key] = inTopics(options[key]); - } - }); - } - - return options; -} - -export function inHex (str) { - return toHex(str); -} - -export function inNumber10 (number) { - if (isInstanceOf(number, BigNumber)) { - return number.toNumber(); - } - - return (new BigNumber(number || 0)).toNumber(); -} - -export function inNumber16 (number) { - const bn = isInstanceOf(number, BigNumber) - ? number - : (new BigNumber(number || 0)); - - if (!bn.isInteger()) { - throw new Error(`[format/input::inNumber16] the given number is not an integer: ${bn.toFormat()}`); - } - - return inHex(bn.toString(16)); -} - -export function inOptionsCondition (condition) { - if (condition) { - if (condition.block) { - condition.block = condition.block ? inNumber10(condition.block) : null; - } else if (condition.time) { - condition.time = inNumber10(Math.floor(condition.time.getTime() / 1000)); - } - } - - return condition; -} - -export function inOptions (_options = {}) { - const options = { ..._options }; - - Object.keys(options).forEach((key) => { - switch (key) { - case 'to': - // Don't encode the `to` option if it's empty - // (eg. contract deployments) - if (options[key]) { - options.to = inAddress(options[key]); - } - break; - - case 'from': - options[key] = inAddress(options[key]); - break; - - case 'condition': - options[key] = inOptionsCondition(options[key]); - break; - - case 'gas': - case 'gasPrice': - options[key] = inNumber16((new BigNumber(options[key])).round()); - break; - - case 'value': - case 'nonce': - options[key] = inNumber16(options[key]); - break; - - case 'data': - options[key] = inData(options[key]); - break; - } - }); - - return options; -} - -export function inTraceFilter (filterObject) { - if (filterObject) { - Object.keys(filterObject).forEach((key) => { - switch (key) { - case 'fromAddress': - case 'toAddress': - filterObject[key] = [].concat(filterObject[key]) - .map(address => inAddress(address)); - break; - - case 'toBlock': - case 'fromBlock': - filterObject[key] = inBlockNumber(filterObject[key]); - break; - } - }); - } - - return filterObject; -} - -export function inTraceType (whatTrace) { - if (isString(whatTrace)) { - return [whatTrace]; - } - - return whatTrace; -} - -function inDeriveType (derive) { - return derive && derive.type === 'hard' ? 'hard' : 'soft'; -} - -export function inDeriveHash (derive) { - const hash = derive && derive.hash ? derive.hash : derive; - const type = inDeriveType(derive); - - return { - hash: inHex(hash), - type - }; -} - -export function inDeriveIndex (derive) { - if (!derive) { - return []; - } - - if (!isArray(derive)) { - derive = [derive]; - } - - return derive.map(item => { - const index = inNumber10(item && item.index ? item.index : item); - - return { - index, - type: inDeriveType(item) - }; - }); -} diff --git a/js-old/src/api/format/input.spec.js b/js-old/src/api/format/input.spec.js deleted file mode 100644 index eb74b7bd67c..00000000000 --- a/js-old/src/api/format/input.spec.js +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -import { - inAddress, inBlockNumber, inData, inFilter, inHex, - inNumber10, inNumber16, inOptions, inTraceType, - inDeriveHash, inDeriveIndex -} from './input'; -import { isAddress } from '../../../test/types'; - -describe('api/format/input', () => { - const address = '0x63cf90d3f0410092fc0fca41846f596223979195'; - - describe('inAddress', () => { - const address = '63cf90d3f0410092fc0fca41846f596223979195'; - - it('adds the leading 0x as required', () => { - expect(inAddress(address)).to.equal(`0x${address}`); - }); - - it('returns verified addresses as-is', () => { - expect(inAddress(`0x${address}`)).to.equal(`0x${address}`); - }); - - it('returns lowercase equivalents', () => { - expect(inAddress(address.toUpperCase())).to.equal(`0x${address}`); - }); - - it('returns 0x on null addresses', () => { - expect(inAddress()).to.equal('0x'); - }); - }); - - describe('inBlockNumber()', () => { - it('returns earliest as-is', () => { - expect(inBlockNumber('earliest')).to.equal('earliest'); - }); - - it('returns latest as-is', () => { - expect(inBlockNumber('latest')).to.equal('latest'); - }); - - it('returns pending as-is', () => { - expect(inBlockNumber('pending')).to.equal('pending'); - }); - - it('formats existing BigNumber into hex', () => { - expect(inBlockNumber(new BigNumber(0x123456))).to.equal('0x123456'); - }); - - it('formats hex strings into hex', () => { - expect(inBlockNumber('0x123456')).to.equal('0x123456'); - }); - - it('formats numbers into hex', () => { - expect(inBlockNumber(0x123456)).to.equal('0x123456'); - }); - }); - - describe('inData', () => { - it('formats to hex', () => { - expect(inData('123456')).to.equal('0x123456'); - }); - - it('converts a string to a hex representation', () => { - expect(inData('jaco')).to.equal('0x6a61636f'); - }); - }); - - describe('inHex', () => { - it('leaves leading 0x as-is', () => { - expect(inHex('0x123456')).to.equal('0x123456'); - }); - - it('adds a leading 0x', () => { - expect(inHex('123456')).to.equal('0x123456'); - }); - - it('returns uppercase as lowercase (leading 0x)', () => { - expect(inHex('0xABCDEF')).to.equal('0xabcdef'); - }); - - it('returns uppercase as lowercase (no leading 0x)', () => { - expect(inHex('ABCDEF')).to.equal('0xabcdef'); - }); - - it('handles empty & null', () => { - expect(inHex()).to.equal('0x'); - expect(inHex('')).to.equal('0x'); - }); - }); - - describe('inFilter', () => { - ['address'].forEach((input) => { - it(`formats ${input} address as address`, () => { - const block = {}; - - block[input] = address; - const formatted = inFilter(block)[input]; - - expect(isAddress(formatted)).to.be.true; - expect(formatted).to.equal(address); - }); - }); - - ['fromBlock', 'toBlock'].forEach((input) => { - it(`formats ${input} number as blockNumber`, () => { - const block = {}; - - block[input] = 0x123; - const formatted = inFilter(block)[input]; - - expect(formatted).to.equal('0x123'); - }); - }); - - it('ignores and passes through unknown keys', () => { - expect(inFilter({ someRandom: 'someRandom' })).to.deep.equal({ someRandom: 'someRandom' }); - }); - - it('formats an filter options object with relevant entries converted', () => { - expect( - inFilter({ - address: address, - fromBlock: 'latest', - toBlock: 0x101, - extraData: 'someExtraStuffInHere', - limit: 0x32 - }) - ).to.deep.equal({ - address: address, - fromBlock: 'latest', - toBlock: '0x101', - extraData: 'someExtraStuffInHere', - limit: 50 - }); - }); - }); - - describe('inNumber10()', () => { - it('formats existing BigNumber into number', () => { - expect(inNumber10(new BigNumber(123))).to.equal(123); - }); - - it('formats hex strings into decimal', () => { - expect(inNumber10('0x0a')).to.equal(10); - }); - - it('formats numbers into number', () => { - expect(inNumber10(123)).to.equal(123); - }); - - it('formats undefined into 0', () => { - expect(inNumber10()).to.equal(0); - }); - }); - - describe('inNumber16()', () => { - it('formats existing BigNumber into hex', () => { - expect(inNumber16(new BigNumber(0x123456))).to.equal('0x123456'); - }); - - it('formats hex strings into hex', () => { - expect(inNumber16('0x123456')).to.equal('0x123456'); - }); - - it('formats numbers into hex', () => { - expect(inNumber16(0x123456)).to.equal('0x123456'); - }); - - it('formats undefined into 0', () => { - expect(inNumber16()).to.equal('0x0'); - }); - }); - - describe('inOptions', () => { - ['data'].forEach((input) => { - it(`converts ${input} to hex data`, () => { - const block = {}; - - block[input] = '1234'; - const formatted = inData(block[input]); - - expect(formatted).to.equal('0x1234'); - }); - }); - - ['from', 'to'].forEach((input) => { - it(`formats ${input} address as address`, () => { - const block = {}; - - block[input] = address; - const formatted = inOptions(block)[input]; - - expect(isAddress(formatted)).to.be.true; - expect(formatted).to.equal(address); - }); - }); - - it('does not encode an empty `to` value', () => { - const options = { to: '' }; - const formatted = inOptions(options); - - expect(formatted.to).to.equal(''); - }); - - ['gas', 'gasPrice', 'value', 'nonce'].forEach((input) => { - it(`formats ${input} number as hexnumber`, () => { - const block = {}; - - block[input] = 0x123; - const formatted = inOptions(block)[input]; - - expect(formatted).to.equal('0x123'); - }); - }); - - it('passes condition as null when specified as such', () => { - expect(inOptions({ condition: null })).to.deep.equal({ condition: null }); - }); - - it('ignores and passes through unknown keys', () => { - expect(inOptions({ someRandom: 'someRandom' })).to.deep.equal({ someRandom: 'someRandom' }); - }); - - it('formats an options object with relevant entries converted', () => { - expect( - inOptions({ - from: address, - to: address, - gas: new BigNumber('0x100'), - gasPrice: 0x101, - value: 258, - nonce: '0x104', - data: '0123456789', - extraData: 'someExtraStuffInHere' - }) - ).to.deep.equal({ - from: address, - to: address, - gas: '0x100', - gasPrice: '0x101', - value: '0x102', - nonce: '0x104', - data: '0x0123456789', - extraData: 'someExtraStuffInHere' - }); - }); - }); - - describe('inTraceType', () => { - it('returns array of types as is', () => { - const types = ['vmTrace', 'trace', 'stateDiff']; - - expect(inTraceType(types)).to.deep.equal(types); - }); - - it('formats single string type into array', () => { - const type = 'vmTrace'; - - expect(inTraceType(type)).to.deep.equal([type]); - }); - }); - - describe('inDeriveHash', () => { - it('returns derive hash', () => { - expect(inDeriveHash(1)).to.deep.equal({ - hash: '0x1', - type: 'soft' - }); - - expect(inDeriveHash(null)).to.deep.equal({ - hash: '0x', - type: 'soft' - }); - - expect(inDeriveHash({ - hash: 5 - })).to.deep.equal({ - hash: '0x5', - type: 'soft' - }); - - expect(inDeriveHash({ - hash: 5, - type: 'hard' - })).to.deep.equal({ - hash: '0x5', - type: 'hard' - }); - }); - }); - - describe('inDeriveIndex', () => { - it('returns derive hash', () => { - expect(inDeriveIndex(null)).to.deep.equal([]); - expect(inDeriveIndex([])).to.deep.equal([]); - - expect(inDeriveIndex([1])).to.deep.equal([{ - index: 1, - type: 'soft' - }]); - - expect(inDeriveIndex({ - index: 1 - })).to.deep.equal([{ - index: 1, - type: 'soft' - }]); - - expect(inDeriveIndex([{ - index: 1, - type: 'hard' - }, 5])).to.deep.equal([ - { - index: 1, - type: 'hard' - }, - { - index: 5, - type: 'soft' - } - ]); - }); - }); -}); diff --git a/js-old/src/api/format/output.js b/js-old/src/api/format/output.js deleted file mode 100644 index 7bf39d17c67..00000000000 --- a/js-old/src/api/format/output.js +++ /dev/null @@ -1,414 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -import { toChecksumAddress } from '../../abi/util/address'; -import { isString } from '../util/types'; - -export function outAccountInfo (infos) { - return Object - .keys(infos) - .reduce((ret, _address) => { - const info = infos[_address]; - const address = outAddress(_address); - - ret[address] = { - name: info.name - }; - - if (info.meta) { - ret[address].uuid = info.uuid; - ret[address].meta = JSON.parse(info.meta); - } - - return ret; - }, {}); -} - -export function outAddress (address) { - return toChecksumAddress(address); -} - -export function outAddresses (addresses) { - return (addresses || []).map(outAddress); -} - -export function outBlock (block) { - if (block) { - Object.keys(block).forEach((key) => { - switch (key) { - case 'author': - case 'miner': - block[key] = outAddress(block[key]); - break; - - case 'difficulty': - case 'gasLimit': - case 'gasUsed': - case 'nonce': - case 'number': - case 'totalDifficulty': - block[key] = outNumber(block[key]); - break; - - case 'timestamp': - block[key] = outDate(block[key]); - break; - } - }); - } - - return block; -} - -export function outChainStatus (status) { - if (status) { - Object.keys(status).forEach((key) => { - switch (key) { - case 'blockGap': - status[key] = status[key] - ? status[key].map(outNumber) - : status[key]; - break; - } - }); - } - - return status; -} - -export function outDate (date) { - if (typeof date.toISOString === 'function') { - return date; - } - - try { - if (typeof date === 'string' && (new Date(date)).toISOString() === date) { - return new Date(date); - } - } catch (error) {} - - return new Date(outNumber(date).toNumber() * 1000); -} - -export function outHistogram (histogram) { - if (histogram) { - Object.keys(histogram).forEach((key) => { - switch (key) { - case 'bucketBounds': - case 'counts': - histogram[key] = histogram[key].map(outNumber); - break; - } - }); - } - - return histogram; -} - -export function outLog (log) { - Object.keys(log).forEach((key) => { - switch (key) { - case 'blockNumber': - case 'logIndex': - case 'transactionIndex': - log[key] = outNumber(log[key]); - break; - - case 'address': - log[key] = outAddress(log[key]); - break; - } - }); - - return log; -} - -export function outHwAccountInfo (infos) { - return Object - .keys(infos) - .reduce((ret, _address) => { - const address = outAddress(_address); - - ret[address] = infos[_address]; - - return ret; - }, {}); -} - -export function outNodeKind (info) { - return info; -} - -export function outNumber (number) { - return new BigNumber(number || 0); -} - -export function outPeer (peer) { - const protocols = Object.keys(peer.protocols) - .reduce((obj, key) => { - if (peer.protocols[key]) { - obj[key] = { - ...peer.protocols[key], - difficulty: outNumber(peer.protocols[key].difficulty) - }; - } - - return obj; - }, {}); - - return { - ...peer, - protocols - }; -} - -export function outPeers (peers) { - return { - active: outNumber(peers.active), - connected: outNumber(peers.connected), - max: outNumber(peers.max), - peers: peers.peers.map((peer) => outPeer(peer)) - }; -} - -export function outReceipt (receipt) { - if (receipt) { - Object.keys(receipt).forEach((key) => { - switch (key) { - case 'blockNumber': - case 'cumulativeGasUsed': - case 'gasUsed': - case 'transactionIndex': - receipt[key] = outNumber(receipt[key]); - break; - - case 'contractAddress': - receipt[key] = outAddress(receipt[key]); - break; - } - }); - } - - return receipt; -} - -export function outRecentDapps (recentDapps) { - if (recentDapps) { - Object.keys(recentDapps).forEach((url) => { - recentDapps[url] = outDate(recentDapps[url]); - }); - } - - return recentDapps; -} - -export function outSignerRequest (request) { - if (request) { - Object.keys(request).forEach((key) => { - switch (key) { - case 'id': - request[key] = outNumber(request[key]); - break; - - case 'payload': - request[key].decrypt = outSigningPayload(request[key].decrypt); - request[key].sign = outSigningPayload(request[key].sign); - request[key].signTransaction = outTransaction(request[key].signTransaction); - request[key].sendTransaction = outTransaction(request[key].sendTransaction); - break; - - case 'origin': - const type = Object.keys(request[key])[0]; - const details = request[key][type]; - - request[key] = { type, details }; - break; - } - }); - } - - return request; -} - -export function outSyncing (syncing) { - if (syncing && syncing !== 'false') { - Object.keys(syncing).forEach((key) => { - switch (key) { - case 'currentBlock': - case 'highestBlock': - case 'startingBlock': - case 'warpChunksAmount': - case 'warpChunksProcessed': - syncing[key] = outNumber(syncing[key]); - break; - - case 'blockGap': - syncing[key] = syncing[key] ? syncing[key].map(outNumber) : syncing[key]; - break; - } - }); - } - - return syncing; -} - -export function outTransactionCondition (condition) { - if (condition) { - if (condition.block) { - condition.block = outNumber(condition.block); - } else if (condition.time) { - condition.time = outDate(condition.time); - } - } - - return condition; -} - -export function outTransaction (tx) { - if (tx) { - Object.keys(tx).forEach((key) => { - switch (key) { - case 'blockNumber': - case 'gasPrice': - case 'gas': - case 'nonce': - case 'transactionIndex': - case 'value': - tx[key] = outNumber(tx[key]); - break; - - case 'condition': - tx[key] = outTransactionCondition(tx[key]); - break; - - case 'creates': - case 'from': - case 'to': - tx[key] = outAddress(tx[key]); - break; - } - }); - } - - return tx; -} - -export function outSigningPayload (payload) { - if (payload) { - Object.keys(payload).forEach((key) => { - switch (key) { - case 'address': - payload[key] = outAddress(payload[key]); - break; - } - }); - } - - return payload; -} - -export function outTrace (trace) { - if (trace) { - if (trace.action) { - Object.keys(trace.action).forEach(key => { - switch (key) { - case 'gas': - case 'value': - case 'balance': - trace.action[key] = outNumber(trace.action[key]); - break; - - case 'from': - case 'to': - case 'address': - case 'refundAddress': - trace.action[key] = outAddress(trace.action[key]); - break; - } - }); - } - - if (trace.result) { - Object.keys(trace.result).forEach(key => { - switch (key) { - case 'gasUsed': - trace.result[key] = outNumber(trace.result[key]); - break; - - case 'address': - trace.action[key] = outAddress(trace.action[key]); - break; - } - }); - } - - if (trace.traceAddress) { - trace.traceAddress.forEach((address, index) => { - trace.traceAddress[index] = outNumber(address); - }); - } - - Object.keys(trace).forEach((key) => { - switch (key) { - case 'subtraces': - case 'transactionPosition': - case 'blockNumber': - trace[key] = outNumber(trace[key]); - break; - } - }); - } - - return trace; -} - -export function outTraces (traces) { - if (traces) { - return traces.map(outTrace); - } - - return traces; -} - -export function outTraceReplay (trace) { - if (trace) { - Object.keys(trace).forEach((key) => { - switch (key) { - case 'trace': - trace[key] = outTraces(trace[key]); - break; - } - }); - } - - return trace; -} - -export function outVaultMeta (meta) { - if (isString(meta)) { - try { - const obj = JSON.parse(meta); - - return obj; - } catch (error) { - return {}; - } - } - - return meta || {}; -} diff --git a/js-old/src/api/format/output.spec.js b/js-old/src/api/format/output.spec.js deleted file mode 100644 index 6ffefaedcc7..00000000000 --- a/js-old/src/api/format/output.spec.js +++ /dev/null @@ -1,502 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -import { outBlock, outAccountInfo, outAddress, outChainStatus, outDate, outHistogram, outHwAccountInfo, outNodeKind, outNumber, outPeer, outPeers, outReceipt, outRecentDapps, outSyncing, outTransaction, outTrace, outVaultMeta } from './output'; -import { isAddress, isBigNumber, isInstanceOf } from '../../../test/types'; - -describe('api/format/output', () => { - const address = '0x63cf90d3f0410092fc0fca41846f596223979195'; - const checksum = '0x63Cf90D3f0410092FC0fca41846f596223979195'; - - describe('outAccountInfo', () => { - it('returns meta objects parsed', () => { - expect(outAccountInfo( - { '0x63cf90d3f0410092fc0fca41846f596223979195': { - name: 'name', uuid: 'uuid', meta: '{"name":"456"}' } - } - )).to.deep.equal({ - '0x63Cf90D3f0410092FC0fca41846f596223979195': { - name: 'name', uuid: 'uuid', meta: { name: '456' } - } - }); - }); - - it('returns objects without meta & uuid as required', () => { - expect(outAccountInfo( - { '0x63cf90d3f0410092fc0fca41846f596223979195': { name: 'name' } } - )).to.deep.equal({ - '0x63Cf90D3f0410092FC0fca41846f596223979195': { name: 'name' } - }); - }); - }); - - describe('outAddress', () => { - it('retuns the address as checksummed', () => { - expect(outAddress(address)).to.equal(checksum); - }); - - it('retuns the checksum as checksummed', () => { - expect(outAddress(checksum)).to.equal(checksum); - }); - }); - - describe('outBlock', () => { - ['author', 'miner'].forEach((input) => { - it(`formats ${input} address as address`, () => { - const block = {}; - - block[input] = address; - const formatted = outBlock(block)[input]; - - expect(isAddress(formatted)).to.be.true; - expect(formatted).to.equal(checksum); - }); - }); - - ['difficulty', 'gasLimit', 'gasUsed', 'number', 'nonce', 'totalDifficulty'].forEach((input) => { - it(`formats ${input} number as hexnumber`, () => { - const block = {}; - - block[input] = 0x123; - const formatted = outBlock(block)[input]; - - expect(isInstanceOf(formatted, BigNumber)).to.be.true; - expect(formatted.toString(16)).to.equal('123'); - }); - }); - - ['timestamp'].forEach((input) => { - it(`formats ${input} number as Date`, () => { - const block = {}; - - block[input] = 0x57513668; - const formatted = outBlock(block)[input]; - - expect(isInstanceOf(formatted, Date)).to.be.true; - expect(formatted.getTime()).to.equal(1464940136000); - }); - }); - - it('ignores and passes through unknown keys', () => { - expect(outBlock({ someRandom: 'someRandom' })).to.deep.equal({ someRandom: 'someRandom' }); - }); - - it('formats a block with all the info converted', () => { - expect( - outBlock({ - author: address, - miner: address, - difficulty: '0x100', - gasLimit: '0x101', - gasUsed: '0x102', - number: '0x103', - nonce: '0x104', - totalDifficulty: '0x105', - timestamp: '0x57513668', - extraData: 'someExtraStuffInHere' - }) - ).to.deep.equal({ - author: checksum, - miner: checksum, - difficulty: new BigNumber('0x100'), - gasLimit: new BigNumber('0x101'), - gasUsed: new BigNumber('0x102'), - number: new BigNumber('0x103'), - nonce: new BigNumber('0x104'), - totalDifficulty: new BigNumber('0x105'), - timestamp: new Date('2016-06-03T07:48:56.000Z'), - extraData: 'someExtraStuffInHere' - }); - }); - }); - - describe('outChainStatus', () => { - it('formats blockGap values', () => { - const status = { - blockGap: [0x1234, '0x5678'] - }; - - expect(outChainStatus(status)).to.deep.equal({ - blockGap: [new BigNumber(0x1234), new BigNumber(0x5678)] - }); - }); - - it('handles null blockGap values', () => { - const status = { - blockGap: null - }; - - expect(outChainStatus(status)).to.deep.equal(status); - }); - }); - - describe('outDate', () => { - it('converts a second date in unix timestamp', () => { - expect(outDate(0x57513668)).to.deep.equal(new Date('2016-06-03T07:48:56.000Z')); - }); - }); - - describe('outHistogram', () => { - ['bucketBounds', 'counts'].forEach((type) => { - it(`formats ${type} as number arrays`, () => { - expect( - outHistogram({ [type]: [0x123, 0x456, 0x789] }) - ).to.deep.equal({ - [type]: [new BigNumber(0x123), new BigNumber(0x456), new BigNumber(0x789)] - }); - }); - }); - }); - - describe('outHwAccountInfo', () => { - it('returns objects with formatted addresses', () => { - expect(outHwAccountInfo( - { '0x63cf90d3f0410092fc0fca41846f596223979195': { manufacturer: 'mfg', name: 'type' } } - )).to.deep.equal({ - '0x63Cf90D3f0410092FC0fca41846f596223979195': { manufacturer: 'mfg', name: 'type' } - }); - }); - }); - - describe('outNodeKind', () => { - it('formats the input as received', () => { - const kind = { availability: 'personal', capability: 'full' }; - - expect(outNodeKind(kind)).to.deep.equal(kind); - }); - }); - - describe('outNumber', () => { - it('returns a BigNumber equalling the value', () => { - const bn = outNumber('0x123456'); - - expect(isBigNumber(bn)).to.be.true; - expect(bn.eq(0x123456)).to.be.true; - }); - - it('assumes 0 when ivalid input', () => { - expect(outNumber().eq(0)).to.be.true; - }); - }); - - describe('outPeer', () => { - it('converts all internal numbers to BigNumbers', () => { - expect(outPeer({ - caps: ['par/1'], - id: '0x01', - name: 'Parity', - network: { - localAddress: '10.0.0.1', - remoteAddress: '10.0.0.1' - }, - protocols: { - par: { - difficulty: '0x0f', - head: '0x02', - version: 63 - } - } - })).to.deep.equal({ - caps: ['par/1'], - id: '0x01', - name: 'Parity', - network: { - localAddress: '10.0.0.1', - remoteAddress: '10.0.0.1' - }, - protocols: { - par: { - difficulty: new BigNumber(15), - head: '0x02', - version: 63 - } - } - }); - }); - - it('does not output null protocols', () => { - expect(outPeer({ - caps: ['par/1'], - id: '0x01', - name: 'Parity', - network: { - localAddress: '10.0.0.1', - remoteAddress: '10.0.0.1' - }, - protocols: { - les: null - } - })).to.deep.equal({ - caps: ['par/1'], - id: '0x01', - name: 'Parity', - network: { - localAddress: '10.0.0.1', - remoteAddress: '10.0.0.1' - }, - protocols: {} - }); - }); - }); - - describe('outPeers', () => { - it('converts all internal numbers to BigNumbers', () => { - expect(outPeers({ - active: 789, - connected: '456', - max: 0x7b, - peers: [ - { - caps: ['par/1'], - id: '0x01', - name: 'Parity', - network: { - localAddress: '10.0.0.1', - remoteAddress: '10.0.0.1' - }, - protocols: { - par: { - difficulty: '0x0f', - head: '0x02', - version: 63 - }, - les: null - } - } - ] - })).to.deep.equal({ - active: new BigNumber(789), - connected: new BigNumber(456), - max: new BigNumber(123), - peers: [ - { - caps: ['par/1'], - id: '0x01', - name: 'Parity', - network: { - localAddress: '10.0.0.1', - remoteAddress: '10.0.0.1' - }, - protocols: { - par: { - difficulty: new BigNumber(15), - head: '0x02', - version: 63 - } - } - } - ] - }); - }); - }); - - describe('outReceipt', () => { - ['contractAddress'].forEach((input) => { - it(`formats ${input} address as address`, () => { - const block = {}; - - block[input] = address; - const formatted = outReceipt(block)[input]; - - expect(isAddress(formatted)).to.be.true; - expect(formatted).to.equal(checksum); - }); - }); - - ['blockNumber', 'cumulativeGasUsed', 'cumulativeGasUsed', 'gasUsed', 'transactionIndex'].forEach((input) => { - it(`formats ${input} number as hexnumber`, () => { - const block = {}; - - block[input] = 0x123; - const formatted = outReceipt(block)[input]; - - expect(isInstanceOf(formatted, BigNumber)).to.be.true; - expect(formatted.toString(16)).to.equal('123'); - }); - }); - - it('ignores and passes through unknown keys', () => { - expect(outReceipt({ someRandom: 'someRandom' })).to.deep.equal({ someRandom: 'someRandom' }); - }); - - it('formats a receipt with all the info converted', () => { - expect( - outReceipt({ - contractAddress: address, - blockNumber: '0x100', - cumulativeGasUsed: '0x101', - gasUsed: '0x102', - transactionIndex: '0x103', - extraData: 'someExtraStuffInHere' - }) - ).to.deep.equal({ - contractAddress: checksum, - blockNumber: new BigNumber('0x100'), - cumulativeGasUsed: new BigNumber('0x101'), - gasUsed: new BigNumber('0x102'), - transactionIndex: new BigNumber('0x103'), - extraData: 'someExtraStuffInHere' - }); - }); - }); - - describe('outRecentDapps', () => { - it('formats the URLs with timestamps', () => { - expect(outRecentDapps({ testing: 0x57513668 })).to.deep.equal({ - testing: new Date('2016-06-03T07:48:56.000Z') - }); - }); - }); - - describe('outSyncing', () => { - ['currentBlock', 'highestBlock', 'startingBlock', 'warpChunksAmount', 'warpChunksProcessed'].forEach((input) => { - it(`formats ${input} numbers as a number`, () => { - expect(outSyncing({ [input]: '0x123' })).to.deep.equal({ - [input]: new BigNumber('0x123') - }); - }); - }); - - it('formats blockGap properly', () => { - expect(outSyncing({ blockGap: [0x123, 0x456] })).to.deep.equal({ - blockGap: [new BigNumber(0x123), new BigNumber(0x456)] - }); - }); - }); - - describe('outTransaction', () => { - ['from', 'to'].forEach((input) => { - it(`formats ${input} address as address`, () => { - const block = {}; - - block[input] = address; - const formatted = outTransaction(block)[input]; - - expect(isAddress(formatted)).to.be.true; - expect(formatted).to.equal(checksum); - }); - }); - - ['blockNumber', 'gasPrice', 'gas', 'nonce', 'transactionIndex', 'value'].forEach((input) => { - it(`formats ${input} number as hexnumber`, () => { - const block = {}; - - block[input] = 0x123; - const formatted = outTransaction(block)[input]; - - expect(isInstanceOf(formatted, BigNumber)).to.be.true; - expect(formatted.toString(16)).to.equal('123'); - }); - }); - - it('passes condition as null when null', () => { - expect(outTransaction({ condition: null })).to.deep.equal({ condition: null }); - }); - - it('ignores and passes through unknown keys', () => { - expect(outTransaction({ someRandom: 'someRandom' })).to.deep.equal({ someRandom: 'someRandom' }); - }); - - it('formats a transaction with all the info converted', () => { - expect( - outTransaction({ - from: address, - to: address, - blockNumber: '0x100', - gasPrice: '0x101', - gas: '0x102', - nonce: '0x103', - transactionIndex: '0x104', - value: '0x105', - extraData: 'someExtraStuffInHere' - }) - ).to.deep.equal({ - from: checksum, - to: checksum, - blockNumber: new BigNumber('0x100'), - gasPrice: new BigNumber('0x101'), - gas: new BigNumber('0x102'), - nonce: new BigNumber('0x103'), - transactionIndex: new BigNumber('0x104'), - value: new BigNumber('0x105'), - extraData: 'someExtraStuffInHere' - }); - }); - }); - - describe('outTrace', () => { - it('ignores and passes through unknown keys', () => { - expect(outTrace({ someRandom: 'someRandom' })).to.deep.equal({ someRandom: 'someRandom' }); - }); - - it('formats a trace with all the info converted', () => { - const formatted = outTrace({ - type: 'call', - action: { - from: address, - to: address, - value: '0x06', - gas: '0x07', - input: '0x1234', - callType: 'call' - }, - result: { - gasUsed: '0x08', - output: '0x5678' - }, - traceAddress: [ '0x2' ], - subtraces: 3, - transactionPosition: '0xb', - transactionHash: '0x000000000000000000000000000000000000000000000000000000000000000c', - blockNumber: '0x0d', - blockHash: '0x000000000000000000000000000000000000000000000000000000000000000e' - }); - - expect(isBigNumber(formatted.action.gas)).to.be.true; - expect(formatted.action.gas.toNumber()).to.equal(7); - expect(isBigNumber(formatted.action.value)).to.be.true; - expect(formatted.action.value.toNumber()).to.equal(6); - - expect(formatted.action.from).to.equal(checksum); - expect(formatted.action.to).to.equal(checksum); - - expect(isBigNumber(formatted.blockNumber)).to.be.true; - expect(formatted.blockNumber.toNumber()).to.equal(13); - expect(isBigNumber(formatted.transactionPosition)).to.be.true; - expect(formatted.transactionPosition.toNumber()).to.equal(11); - }); - }); - - describe('outVaultMeta', () => { - it('returns an exmpt object on null', () => { - expect(outVaultMeta(null)).to.deep.equal({}); - }); - - it('returns the original value if not string', () => { - expect(outVaultMeta({ test: 123 })).to.deep.equal({ test: 123 }); - }); - - it('returns an object from JSON string', () => { - expect(outVaultMeta('{"test":123}')).to.deep.equal({ test: 123 }); - }); - - it('returns an empty object on invalid JSON', () => { - expect(outVaultMeta('{"test"}')).to.deep.equal({}); - }); - }); -}); diff --git a/js-old/src/api/index.js b/js-old/src/api/index.js deleted file mode 100644 index 978d98fecaf..00000000000 --- a/js-old/src/api/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './api'; diff --git a/js-old/src/api/local/accounts/account.js b/js-old/src/api/local/accounts/account.js deleted file mode 100644 index 224a05cd9f8..00000000000 --- a/js-old/src/api/local/accounts/account.js +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { createKeyObject, decryptPrivateKey } from '../ethkey'; - -export default class Account { - constructor (persist, data = {}) { - const { - keyObject = null, - meta = {}, - name = '' - } = data; - - this._persist = persist; - this._keyObject = keyObject; - this._name = name; - this._meta = meta; - } - - isValidPassword (password) { - if (!this._keyObject) { - return false; - } - - return decryptPrivateKey(this._keyObject, password) - .then((privateKey) => { - if (!privateKey) { - return false; - } - - return true; - }); - } - - export () { - const exported = Object.assign({}, this._keyObject); - - exported.meta = JSON.stringify(this._meta); - exported.name = this._name; - - return exported; - } - - get address () { - return `0x${this._keyObject.address.toLowerCase()}`; - } - - get name () { - return this._name; - } - - set name (name) { - this._name = name; - - this._persist(); - } - - get meta () { - return JSON.stringify(this._meta); - } - - set meta (meta) { - this._meta = JSON.parse(meta); - - this._persist(); - } - - get uuid () { - if (!this._keyObject) { - return null; - } - - return this._keyObject.id; - } - - decryptPrivateKey (password) { - return decryptPrivateKey(this._keyObject, password); - } - - changePassword (key, password) { - return createKeyObject(key, password).then((keyObject) => { - this._keyObject = keyObject; - - this._persist(); - }); - } - - static fromPrivateKey (persist, key, password) { - return createKeyObject(key, password).then((keyObject) => { - const account = new Account(persist, { keyObject }); - - return account; - }); - } - - toJSON () { - return { - keyObject: this._keyObject, - name: this._name, - meta: this._meta - }; - } -} diff --git a/js-old/src/api/local/accounts/accounts.js b/js-old/src/api/local/accounts/accounts.js deleted file mode 100644 index d11ea2badb6..00000000000 --- a/js-old/src/api/local/accounts/accounts.js +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Account from './account'; -import localStore from 'store'; -import { debounce } from 'lodash'; -import { decryptPrivateKey } from '../ethkey'; - -const NULL_ADDRESS = '0x0000000000000000000000000000000000000000'; -const LS_STORE_KEY = '_parity::localAccounts'; - -export default class Accounts { - persist = debounce(() => { - this._lastState = JSON.stringify(this); - - localStore.set(LS_STORE_KEY, this); - }, 100); - - constructor (data = localStore.get(LS_STORE_KEY) || {}) { - this._lastState = JSON.stringify(data); - - window.addEventListener('storage', ({ key, newValue }) => { - if (key !== LS_STORE_KEY) { - return; - } - - if (newValue !== this._lastState) { - console.log('Data changed in a second tab, syncing state'); - - this.restore(JSON.parse(newValue)); - } - }); - - this.restore(data); - } - - restore (data) { - const { - last = NULL_ADDRESS, - dappsDefault = NULL_ADDRESS, - store = {} - } = data; - - this._last = last; - this._dappsDefaultAddress = dappsDefault; - this._store = {}; - - if (Array.isArray(store)) { - // Recover older version that stored accounts as an array - store.forEach((data) => { - const account = new Account(this.persist, data); - - this._store[account.address] = account; - }); - } else { - Object.keys(store).forEach((key) => { - this._store[key] = new Account(this.persist, store[key]); - }); - } - } - - _addAccount = (account) => { - const { address } = account; - - if (address in this._store && this._store[address].uuid) { - throw new Error(`Account ${address} already exists!`); - } - - this._store[address] = account; - this.lastAddress = address; - - this.persist(); - - return account.address; - } - - create (secret, password) { - const privateKey = Buffer.from(secret.slice(2), 'hex'); - - return Account - .fromPrivateKey(this.persist, privateKey, password) - .then(this._addAccount); - } - - restoreFromWallet (wallet, password) { - return decryptPrivateKey(wallet, password) - .then((privateKey) => { - if (!privateKey) { - throw new Error('Invalid password'); - } - - return Account.fromPrivateKey(this.persist, privateKey, password); - }) - .then(this._addAccount); - } - - set lastAddress (value) { - this._last = value.toLowerCase(); - } - - get lastAddress () { - return this._last; - } - - get dappsDefaultAddress () { - if (this._dappsDefaultAddress === NULL_ADDRESS) { - return this._last; - } - - if (this._dappsDefaultAddress in this._store) { - return this._dappsDefaultAddress; - } - - return NULL_ADDRESS; - } - - set dappsDefaultAddress (value) { - this._dappsDefaultAddress = value.toLowerCase(); - - this.persist(); - } - - get (address) { - address = address.toLowerCase(); - - const account = this._store[address]; - - if (!account) { - throw new Error(`Account not found: ${address}`); - } - - this.lastAddress = address; - - return account; - } - - getLazyCreate (address) { - address = address.toLowerCase(); - - this.lastAddress = address; - - if (!(address in this._store)) { - this._store[address] = new Account(this.persist); - } - - return this._store[address]; - } - - remove (address, password) { - address = address.toLowerCase(); - - const account = this.get(address); - - if (!account) { - return false; - } - - if (!account.uuid) { - this.removeUnsafe(address); - - return true; - } - - return account - .isValidPassword(password) - .then((isValid) => { - if (!isValid) { - return false; - } - - if (address === this.lastAddress) { - this.lastAddress = NULL_ADDRESS; - } - - this.removeUnsafe(address); - - return true; - }); - } - - removeUnsafe (address) { - address = address.toLowerCase(); - - delete this._store[address]; - - this.persist(); - } - - allAddresses () { - return Object.keys(this._store); - } - - accountAddresses () { - return Object - .keys(this._store) - .filter((address) => this._store[address].uuid); - } - - map (mapper) { - const result = {}; - - Object.keys(this._store).forEach((key) => { - result[key] = mapper(this._store[key]); - }); - - return result; - } - - toJSON () { - return { - last: this._last, - dappsDefault: this._dappsDefaultAddress, - store: this._store - }; - } -} diff --git a/js-old/src/api/local/ethkey/ethkey.js b/js-old/src/api/local/ethkey/ethkey.js deleted file mode 100644 index f8395b007ab..00000000000 --- a/js-old/src/api/local/ethkey/ethkey.js +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -/* global WebAssembly */ - -import wasmBuffer from './ethkey.wasm.js'; - -const NOOP = () => {}; - -// WASM memory setup -const WASM_PAGE_SIZE = 65536; -const STATIC_BASE = 1024; -const STATICTOP = STATIC_BASE + WASM_PAGE_SIZE * 2; -const STACK_BASE = align(STATICTOP + 16); -const STACKTOP = STACK_BASE; -const TOTAL_STACK = 5 * 1024 * 1024; -const TOTAL_MEMORY = 16777216; -const STACK_MAX = STACK_BASE + TOTAL_STACK; -const DYNAMIC_BASE = STACK_MAX + 64; -const DYNAMICTOP_PTR = STACK_MAX; - -function mockWebAssembly () { - function throwWasmError () { - throw new Error('Missing WebAssembly support'); - } - - // Simple mock replacement - return { - Memory: class { buffer = new ArrayBuffer(2048) }, - Table: class {}, - Module: class {}, - Instance: class { - exports = { - '_input_ptr': () => 0, - '_secret_ptr': () => 0, - '_public_ptr': () => 0, - '_address_ptr': () => 0, - '_ecpointg': NOOP, - '_brain': throwWasmError, - '_verify_secret': throwWasmError - } - } - }; -} - -const { Memory, Table, Module, Instance } = typeof WebAssembly !== 'undefined' ? WebAssembly : mockWebAssembly(); - -const wasmMemory = new Memory({ - initial: TOTAL_MEMORY / WASM_PAGE_SIZE, - maximum: TOTAL_MEMORY / WASM_PAGE_SIZE -}); - -const wasmTable = new Table({ - initial: 8, - maximum: 8, - element: 'anyfunc' -}); - -// TypedArray views into the memory -const wasmMemoryU8 = new Uint8Array(wasmMemory.buffer); -const wasmMemoryU32 = new Uint32Array(wasmMemory.buffer); - -// Keep DYNAMIC_BASE in memory -wasmMemoryU32[DYNAMICTOP_PTR >> 2] = align(DYNAMIC_BASE); - -function align (mem) { - const ALIGN_SIZE = 16; - - return (Math.ceil(mem / ALIGN_SIZE) * ALIGN_SIZE) | 0; -} - -export function slice (ptr, len) { - return wasmMemoryU8.subarray(ptr, ptr + len); -} - -// Required by emscripten -function abort (what) { - throw new Error(what || 'WASM abort'); -} - -// Required by emscripten -function abortOnCannotGrowMemory () { - abort(`Cannot enlarge memory arrays.`); -} - -// Required by emscripten -function enlargeMemory () { - abortOnCannotGrowMemory(); -} - -// Required by emscripten -function getTotalMemory () { - return TOTAL_MEMORY; -} - -// Required by emscripten - used to perform memcpy on large data -function memcpy (dest, src, len) { - wasmMemoryU8.set(wasmMemoryU8.subarray(src, src + len), dest); - - return dest; -} - -// Synchronously compile WASM from the buffer -const module = new Module(wasmBuffer); - -// Instantiated WASM module -const instance = new Instance(module, { - global: {}, - env: { - DYNAMICTOP_PTR, - STACKTOP, - STACK_MAX, - abort, - enlargeMemory, - getTotalMemory, - abortOnCannotGrowMemory, - ___lock: NOOP, - ___syscall6: () => 0, - ___setErrNo: (no) => no, - _abort: abort, - ___syscall140: () => 0, - _emscripten_memcpy_big: memcpy, - ___syscall54: () => 0, - ___unlock: NOOP, - _llvm_trap: abort, - ___syscall146: () => 0, - 'memory': wasmMemory, - 'table': wasmTable, - tableBase: 0, - memoryBase: STATIC_BASE - } -}); - -export const extern = instance.exports; diff --git a/js-old/src/api/local/ethkey/ethkey.wasm.js b/js-old/src/api/local/ethkey/ethkey.wasm.js deleted file mode 100644 index d426f0e0c46..00000000000 --- a/js-old/src/api/local/ethkey/ethkey.wasm.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = new Buffer('AGFzbQEAAAABOgpgA39/fwF/YAF/AX9gAn9/AX9gAX8AYAABf2AAAGACf38AYAR/f39/AGADf39/AGAGf39/f39/AX8CyQELA2VudghTVEFDS1RPUAN/AANlbnYFYWJvcnQAAwNlbnYLX19fc3lzY2FsbDYAAgNlbnYNX19fc3lzY2FsbDE0MAACA2VudhZfZW1zY3JpcHRlbl9tZW1jcHlfYmlnAAADZW52DF9fX3N5c2NhbGw1NAACA2VudgpfbGx2bV90cmFwAAUDZW52DV9fX3N5c2NhbGwxNDYAAgNlbnYGbWVtb3J5AgGAAoACA2VudgV0YWJsZQFwAQgIA2Vudgl0YWJsZUJhc2UDfwADOjkEBAQEBAQDBwMICAgIAwYGBgIIAwMDBgMDCAYGBgMCBwYIAgICBgkDBgEAAAEEBAQAAQAAAQABAAIGBgF/ASMACwdfBw5fdmVyaWZ5X3NlY3JldAAMC19wdWJsaWNfcHRyAAoLX3NlY3JldF9wdHIACQpfaW5wdXRfcHRyAAgJX2VjcG9pbnRnAAcGX2JyYWluAA0MX2FkZHJlc3NfcHRyAAsJDgEAIwELCD0wPjEyNz8rCpClAzlJAQJ/An8jAiEAIwJB0JgBaiQCQagZKAIAQQFGBEAgACQCQawZDwsgACIBEB9BqBlBATYCAEGsGSABQdCYARA8GiAAJAJBrBkLCwYAQbi2AQsGAEG4vgELBgBB2L4BCwYAQZi/AQsKAEG4vgFBIBAlC74HAQt/AkAjAiEIIwJBoJwBaiQCIABBgAhLBEAgAEGACBAnCyAIQaACaiEFQagZKAIAQQFHBEAgBRAfQagZQQE2AgBBrBkgBUHQmAEQPBoLIAghCSAIQcgAaiIEEBQgCEH4mwFqIgFCADcAACABQgA3AAggAUIANwAQIAFCADcAGCAEQbi2ASAAEBAgBSAEQdgBEDwaIAUgAUEgEBIgCEHwmgFqIgMgASkAADcAACADIAEpAAg3AAggAyABKQAQNwAQIAMgASkAGDcAGCAIQZCbAWoiBkEBaiEHIAhB2JsBaiICQQxqIQpBACEAA0AgBBAUIAFCADcAACABQgA3AAggAUIANwAQIAFCADcAGCAEIANBIBAQIAUgBEHYARA8GiAFIAFBIBASIAIgASkAADcAACACIAEpAAg3AAggAiABKQAQNwAQIAIgASkAGDcAGCADIAIpAAA3AAAgAyACKQAINwAIIAMgAikAEDcAECADIAIpABg3ABggAEEBaiELIABBgYABRwRAIAshAAwBCwsgCUEBaiEAA0ACQCAJQawZIANBIBAmIAksAABBAUYEQCAGIAApAAA3AAAgBiAAKQAINwAIIAYgACkAEDcAECAGIAApABg3ABggBiAAKQAgNwAgIAYgACkAKDcAKCAGIAApADA3ADAgBiAAKQA4NwA4IAYgACwAQDoAQCAEEBQgAUIANwAAIAFCADcACCABQgA3ABAgAUIANwAYIAQgB0HAABAQIAUgBEHYARA8GiAFIAFBIBASIAIgASkAADcAACACIAEpAAg3AAggAiABKQAQNwAQIAIgASkAGDcAGEGYvwEgCikAADcAAEGgvwEgCikACDcAAEGovwEgCigAEDYAAEGYvwEsAABFDQELIAQQFCABQgA3AAAgAUIANwAIIAFCADcAECABQgA3ABggBCADQSAQECAFIARB2AEQPBogBSABQSAQEiACIAEpAAA3AAAgAiABKQAINwAIIAIgASkAEDcAECACIAEpABg3ABggAyACKQAANwAAIAMgAikACDcACCADIAIpABA3ABAgAyACKQAYNwAYDAELC0HYvgEgBykAADcAAEHgvgEgBykACDcAAEHovgEgBykAEDcAAEHwvgEgBykAGDcAAEH4vgEgBykAIDcAAEGAvwEgBykAKDcAAEGIvwEgBykAMDcAAEGQvwEgBykAODcAAEG4vgEgAykAADcAAEHAvgEgAykACDcAAEHIvgEgAykAEDcAAEHQvgEgAykAGDcAACAIJAILCwQAEAUL1wsCGX8tfgJAIAApAwAhJCAAQShqIgIpAwAhJSAAQdAAaiIDKQMAITAgAEH4AGoiBCkDACE+IABBoAFqIgUpAwAhJiAAQQhqIgYpAwAhMSAAQTBqIgcpAwAhMiAAQdgAaiIIKQMAIScgAEGAAWoiCSkDACEgIABBqAFqIgopAwAhPyAAQRBqIgspAwAhMyAAQThqIgwpAwAhHSAAQeAAaiINKQMAISEgAEGIAWoiDikDACE0IABBsAFqIg8pAwAhHiAAQRhqIhApAwAhNSAAQcAAaiIRKQMAISggAEHoAGoiEikDACE2IABBkAFqIhMpAwAhGyAAQbgBaiIUKQMAISIgAEEgaiIVKQMAITcgAEHIAGoiFikDACE4IABB8ABqIhcpAwAhHCAAQZgBaiIYKQMAISMgAEHAAWoiGSkDACEaQQAhAQNAICQgGiAjIBwgOCA3hYWFhSIphSA/ICAgJyAyIDGFhYWFIipCAYYgKkI/iIQiOYUhQCAxICYgPiAwICUgJIWFhYUiK4UgHiA0ICEgHSAzhYWFhSIsQgGGICxCP4iEIjqFIUEgMyAqhSAiIBsgNiAoIDWFhYWFIi1CAYYgLUI/iIQiO4UhQiA1ICyFIClCAYYgKUI/iIQiPIUhLiA3IC2FICtCAYYgK0I/iIQiPYUhQyAbICyFIDyFIhtCFYYgG0IriIQiHyAhICqFIDuFIhtCK4YgG0IViIQiREJ/hYMgMiArhSA6hSIbQiyGIBtCFIiEIiSFITEgGiAthSA9hSIaQg6GIBpCMoiEIhogH0J/hYMgRIUhMyBAIBpCf4WDIB+FITUgJCBAQn+FgyAahSE3IDAgKYUgOYUiGkIDhiAaQj2IhCIvIDggLYUgPYUiGkIUhiAaQiyIhCIhQn+FgyAuQhyGIC5CJIiEIh+FIUUgICArhSA6hSIaQi2GIBpCE4iEIhsgL0J/hYMgIYUhMiAeICqFIDuFIhpCPYYgGkIDiIQiGiAbQn+FgyAvhSFGIB8gGkJ/hYMgG4UhLiAhIB9Cf4WDIBqFITggNiAshSA8hSIaQhmGIBpCJ4iEIiAgHSAqhSA7hSIaQgaGIBpCOoiEIhtCf4WDIEFCAYYgQUI/iIQiHYUhMCAjIC2FID2FIhpCCIYgGkI4iIQiHiAgQn+FgyAbhSEvICYgKYUgOYUiGkIShiAaQi6IhCIaIB5Cf4WDICCFISEgHSAaQn+FgyAehSE2IBsgHUJ/hYMgGoUhHyAnICuFIDqFIhpCCoYgGkI2iIQiGyAlICmFIDmFIhpCJIYgGkIciIQiI0J/hYMgQ0IbhiBDQiWIhCIdhSEnIDQgKoUgO4UiGkIPhiAaQjGIhCIeIBtCf4WDICOFISAgIiAshSA8hSIaQjiGIBpCCIiEIhogHkJ/hYMgG4UhNCAdIBpCf4WDIB6FIRsgIyAdQn+FgyAahSEjIBwgLYUgPYUiHEInhiAcQhmIhCIiICggLIUgPIUiHEI3hiAcQgmIhCIlQn+FgyBCQj6GIEJCAoiEIiaFIR0gPiAphSA5hSIcQimGIBxCF4iEIhogIkJ/hYMgJYUhHiA/ICuFIDqFIhxCAoYgHEI+iIQiHCAaQn+FgyAihSEoICYgHEJ/hYMgGoUhIiAlICZCf4WDIByFIRogRCAkQn+FgyBAhSABQQN0QYAIaikDAIUhHCABQQFqIgFBGEcEQCAcISQgRSElICchPiAdISYgLyEnIB4hPyBGIR0gKCEeIC4hKCAfIRwMAQsLIAAgHDcDACACIEU3AwAgAyAwNwMAIAQgJzcDACAFIB03AwAgBiAxNwMAIAcgMjcDACAIIC83AwAgCSAgNwMAIAogHjcDACALIDM3AwAgDCBGNwMAIA0gITcDACAOIDQ3AwAgDyAoNwMAIBAgNTcDACARIC43AwAgEiA2NwMAIBMgGzcDACAUICI3AwAgFSA3NwMAIBYgODcDACAXIB83AwAgGCAjNwMAIBkgGjcDAAsLCgAgACABIAIQEQu9AwEPfwJAIABByAFqIgooAgAiA0HIAUsEQCADQcgBEC8LIAAgA2ohC0HIASADayEEAkAgAEHMAWoiECgCACADayIFIAJLBEAgBCEMIAshDSADIQ9BACEIIAIhBgUgBCEJQQAhByACIQ4gBSEEAkACQAJAA0AgBCAJSw0BIAcgAksNAiABIAdqIREgBCACIAdrIgNNBH8gBAUgAwsiCQRAIAshA0EAIQUDQCADIAMsAAAgESAFaiwAAHM6AAAgCyAFQQFqIgVqIQMgBSAJSQ0ACwsgABAPIAQgB2ohAyAQKAIAIQUgCkEANgIAIA4gBGsiDiAFSQRAQcgBIQwgACENQQAhDyADIQggDiEGDAYFQcgBIQkgACELIAMhByAFIQQMAQsACwALIAQgCRAnDAELIAcgAhAvCwsLIAYgDEsEQCAGIAwQJwsgCCACSwRAIAggAhAvCyAGIAIgCGsiAE0EfyAGBSAACyIEBEAgDSEAQQAhAgUgCiAPIAZqNgIADwsgASAIaiEBA0AgACAALAAAIAEgAmosAABzOgAAIA0gAkEBaiICaiEAIAIgBEkNAAsgCiAKKAIAIAZqNgIACwuSAQEDfwJAIwIhBCMCQeABaiQCIAQiAyAAQdgBEDwaIAMoAsgBIgBByAFPBEBB3AogAEHIARAoCyADKALMASEFIAMgAGoiACAALAAAIAMsANABczoAACAFQX9qIgBByAFJBEAgAyAAaiIAIAAsAABBgH9zOgAAIAMQDyADIAEgAhATIAQkAgVB0AogAEHIARAoCwsLygEBB38CQAJAIAAoAswBIgNByAFLBEAgAyACSwRAIAEhCCACIQYFIANByAEQJwsFIAIhBEEAIQUCQAJAAkACQANAIAEgBWohCSACIAVrIQcgBCADSQ0DIAMgB0sNAiAJIAAgAxA8GiAAEA8gBCADayEEIAUgA2oiBSACTQ0ADAELAAsgBSACEC8MAgsgAyAHECcMAQsgBCAHTQRAIAkhCCAEIQYMAwsgBCAHECcLCwsgBkHIAUsEQCAGQcgBECcFIAggACAGEDwaCwsLIAACQCAAQQBBzAEQOhogAEGIATYCzAEgAEEBOgDQAQsLgQUCCH8DfgJAIwIhBSMCQdAAaiQCIAUhAiAAQcQAaiIDLAAAIgcgASwAREcEQCAHBEAgA0EAOgAAIAAgARAWIAMgAywAAEEBczoAAAUgAiABKQIANwIAIAIgASkCCDcCCCACIAEpAhA3AhAgAiABKQIYNwIYIAIgASkCIDcCICACIAEpAig3AiggAiABKQIwNwIwIAIgASkCODcCOCACIAEpAkA3AkAgAkEAOgBEIAAgAhAWCyAAKAIABEAgBSQCDwsgACgCBARAIAUkAg8LIANBADoAACAFJAIPCwJAIAEoAgAiAyAAKAIAIgJLBEACQAJAA0AgAkEQTw0CIABBBGogAkECdGpBADYCACACQQFqIgIgA0kNAAwBCwALIAAgAzYCAEIAIQtBACEEDAILQcgLIAJBEBAoBSADBEBCACELQQAhBAUgBSQCDwsLCwJAAkADQCAEQRBPDQEgAEEEaiAEQQJ0aiICKAIArSALfCABQQRqIARBAnRqKAIArXwhCiACIAo+AgAgCkIgiCEKIARBAWoiBiADSQRAIAohCyAGIQQMAQsLDAELQdQLIARBEBAoCyAKQgBSIgQgBiAAKAIAIgFJcQRAIAYhAQJAAkADQCABQRBPDQEgAEEEaiABQQJ0aiICKAIArSAKfCEKIAIgCj4CACAKQiCIIgxCAFIiCCABQQFqIgEgACgCACIJSXEEQCAMIQoMAQsLDAELQeALIAFBEBAoCyAMpyECIAgEQCAJIQEFIAUkAg8LBSAKpyECIARFBEAgBSQCDwsLIAFBEE8EQEHsCyABQRAQKAsgAEEEaiABQQJ0aiACNgIAIAAgACgCAEEBajYCACAFJAILC+YHAg1/An4CQCMCIQUjAkHQAGokAiAFIQIgAEHEAGoiBiwAACIDIAEsAERHBEAgAwRAIAZBADoAACAAIAEQFSAGQQE6AAAFIAIgASkCADcCACACIAEpAgg3AgggAiABKQIQNwIQIAIgASkCGDcCGCACIAEpAiA3AiAgAiABKQIoNwIoIAIgASkCMDcCMCACIAEpAjg3AjggAiABKQJANwJAIAJBADoARCAAIAIQFQsgACgCAARAIAUkAg8LIAAoAgQEQCAFJAIPCyAGQQA6AAAgBSQCDwsgACgCACIHQRBLBEAgB0EQECcLIAEoAgAiCEEQSwRAIAhBEBAnCyAAQQRqIQsCQAJAIAcgCEYEQCAAIAFHBEAgCyABQQRqIAdBAnQQOQRAIAchAwJAAkACQANAIANBf2ohCSADRQ0IIAlBEE8NASABQQRqIAlBAnRqKAIAIgMgAEEEaiAJQQJ0aigCACIORw0CIAkhAwwACwALQbwLIAlBEBAoDAELIAMgDkkNBQwECwsLIABBATYCACAGQQA6AAAgC0EANgIAIAUkAg8FIAggB08NAQsMAQsgAiAAKQIANwIAIAIgACkCCDcCCCACIAApAhA3AhAgAiAAKQIYNwIYIAIgACkCIDcCICACIAApAig3AiggAiAAKQIwNwIwIAIgACkCODcCOCACIAApAkA3AkAgACABKQIANwIAIAAgASkCCDcCCCAAIAEpAhA3AhAgACABKQIYNwIYIAAgASkCIDcCICAAIAEpAig3AiggACABKQIwNwIwIAAgASkCODcCOCAAIAEpAkA3AkAgACACEBYgBkEBOgAAIAUkAg8LAkAgCAR/QgAhD0EAIQMCQAJAA0AgA0EQTw0BIABBBGogA0ECdGoiBCgCAK0gAUEEaiADQQJ0aigCAK19IA98Ig9CIIchECAEIA8+AgAgA0EBaiIEIAhJBEAgECEPIAQhAwwBCwsMAQtB+AsgA0EQECgLAkAgEEIAUiAEIAAoAgAiAUlxBEADQCAEQRBJBEAgAEEEaiAEQQJ0aiIBKAIArSAQfCIPQiCHIRAgASAPPgIAIBBCAFIgBEEBaiIEIAAoAgAiAUlxDQEgASEMIAQhCgwDCwtBhAwgBEEQECgFIAEhDCAEIQoLCyAKIAxLBH8gACAKNgIAIAoFIAwLBSAHCyIBQQFLBEACQAJAA0AgAUF/aiIBQRBPDQIgAEEEaiABQQJ0aigCAA0BIAAgATYCACABQQFLDQAgASENDAQLAAsgBSQCDwtBsAsgAUEQECgFIAEhDQsLIA0gCygCAHIEQCAFJAIPCyAGQQA6AAAgBSQCCwv1GwIofwN+AkAjAiEgIwJB0ABqJAIgACgCACIKQQhGIAEoAgAiA0EIRnEEQCAAQQRqIg0oAgAiDkH//wNxIQQgAEEIaiIPKAIAIhBB//8DcSEIIABBDGoiESgCACISQf//A3EhBSAAQRBqIhMoAgAiFEH//wNxIQkgAEEUaiIVKAIAIhZB//8DcSEGIABBGGoiFygCACIYQf//A3EhAiAAQRxqIhkoAgAiGkH//wNxIQcgAEEgaiIbKAIAIiFB//8DcSELIAEoAgQiIkH//wNxIQMgASgCCCIjQf//A3EhCiABKAIMIiRB//8DcSEMIAEoAhAiJUH//wNxIRwgASgCFCImQf//A3EhHSABKAIYIidB//8DcSEeIAEoAhwiKEH//wNxIR8gASgCICIpQf//A3EhASANICJBEHYiDSAEbK0gAyAOQRB2Ig5srXwiKkIQhkKAgPz/D4MgAyAEbK18Iis+AgAgDyANIA5srSADIAhsrXwgCiAEbK18ICpCEIh8ICtCIIh8IA0gCGytIAMgEEEQdiIPbK18ICNBEHYiECAEbK18IAogDmytfCIqQhCGQoCA/P8Pg3wiKz4CACARIA0gD2ytIAMgBWytfCAKIAhsrXwgECAObK18IAwgBGytfCAqQhCIfCANIAVsrSADIBJBEHYiEWytfCAQIAhsrXwgCiAPbK18ICRBEHYiEiAEbK18IAwgDmytfCIqQhCGQoCA/P8Pg3wgK0IgiHwiKz4CACATIA0gEWytIAMgCWytfCAKIAVsrXwgECAPbK18IAwgCGytfCASIA5srXwgHCAEbK18ICpCEIh8IA0gCWytIAMgFEEQdiITbK18IBAgBWytfCAKIBFsrXwgEiAIbK18IAwgD2ytfCAlQRB2IhQgBGytfCAcIA5srXwiKkIQhkKAgPz/D4N8ICtCIIh8Iis+AgAgFSANIBNsrSADIAZsrXwgCiAJbK18IBAgEWytfCAMIAVsrXwgEiAPbK18IBwgCGytfCAUIA5srXwgHSAEbK18ICpCEIh8IA0gBmytIAMgFkEQdiIVbK18IBAgCWytfCAKIBNsrXwgEiAFbK18IAwgEWytfCAUIAhsrXwgHCAPbK18ICZBEHYiFiAEbK18IB0gDmytfCIqQhCGQoCA/P8Pg3wgK0IgiHwiKz4CACAXIA0gFWytIAMgAmytfCAKIAZsrXwgECATbK18IAwgCWytfCASIBFsrXwgHCAFbK18IBQgD2ytfCAdIAhsrXwgFiAObK18IB4gBGytfCAqQhCIfCANIAJsrSADIBhBEHYiF2ytfCAQIAZsrXwgCiAVbK18IBIgCWytfCAMIBNsrXwgFCAFbK18IBwgEWytfCAWIAhsrXwgHSAPbK18ICdBEHYiGCAEbK18IB4gDmytfCIqQhCGQoCA/P8Pg3wgK0IgiHwiKz4CACAZIA0gF2ytIAMgB2ytfCAKIAJsrXwgECAVbK18IAwgBmytfCASIBNsrXwgHCAJbK18IBQgEWytfCAdIAVsrXwgFiAPbK18IB4gCGytfCAYIA5srXwgHyAEbK18ICpCEIh8IA0gB2ytIAMgGkEQdiIZbK18IBAgAmytfCAKIBdsrXwgEiAGbK18IAwgFWytfCAUIAlsrXwgHCATbK18IBYgBWytfCAdIBFsrXwgGCAIbK18IB4gD2ytfCAoQRB2IhogBGytfCAfIA5srXwiKkIQhkKAgPz/D4N8ICtCIIh8Iis+AgAgGyANIBlsrSADIAtsrXwgCiAHbK18IBAgF2ytfCAMIAJsrXwgEiAVbK18IBwgBmytfCAUIBNsrXwgHSAJbK18IBYgEWytfCAeIAVsrXwgGCAPbK18IB8gCGytfCAaIA5srXwgASAEbK18ICpCEIh8IA0gC2ytIAMgIUEQdiIDbK18IBAgB2ytfCAKIBlsrXwgEiACbK18IAwgF2ytfCAUIAZsrXwgHCAVbK18IBYgCWytfCAdIBNsrXwgGCAFbK18IB4gEWytfCAaIAhsrXwgHyAPbK18IClBEHYiGyAEbK18IAEgDmytfCIqQhCGQoCA/P8Pg3wgK0IgiHwiKz4CACAAIAogC2ytIA0gA2ytfCAQIBlsrXwgDCAHbK18IBIgF2ytfCAcIAJsrXwgFCAVbK18IB0gBmytfCAWIBNsrXwgHiAJbK18IBggEWytfCAfIAVsrXwgGiAPbK18IAEgCGytfCAbIA5srXwgKkIQiHwgECALbK0gCiADbK18IBIgB2ytfCAMIBlsrXwgFCACbK18IBwgF2ytfCAWIAZsrXwgHSAVbK18IBggCWytfCAeIBNsrXwgGiAFbK18IB8gEWytfCAbIAhsrXwgASAPbK18IipCEIZCgID8/w+DfCArQiCIfCIrPgIkIAAgDCALbK0gECADbK18IBIgGWytfCAcIAdsrXwgFCAXbK18IB0gAmytfCAWIBVsrXwgHiAGbK18IBggE2ytfCAfIAlsrXwgGiARbK18IAEgBWytfCAbIA9srXwgKkIQiHwgEiALbK0gDCADbK18IBQgB2ytfCAcIBlsrXwgFiACbK18IB0gF2ytfCAYIAZsrXwgHiAVbK18IBogCWytfCAfIBNsrXwgGyAFbK18IAEgEWytfCIqQhCGQoCA/P8Pg3wgK0IgiHwiKz4CKCAAIBwgC2ytIBIgA2ytfCAUIBlsrXwgHSAHbK18IBYgF2ytfCAeIAJsrXwgGCAVbK18IB8gBmytfCAaIBNsrXwgASAJbK18IBsgEWytfCAqQhCIfCAUIAtsrSAcIANsrXwgFiAHbK18IB0gGWytfCAYIAJsrXwgHiAXbK18IBogBmytfCAfIBVsrXwgGyAJbK18IAEgE2ytfCIqQhCGQoCA/P8Pg3wgK0IgiHwiKz4CLCAAIB0gC2ytIBQgA2ytfCAWIBlsrXwgHiAHbK18IBggF2ytfCAfIAJsrXwgGiAVbK18IAEgBmytfCAbIBNsrXwgKkIQiHwgFiALbK0gHSADbK18IBggB2ytfCAeIBlsrXwgGiACbK18IB8gF2ytfCAbIAZsrXwgASAVbK18IipCEIZCgID8/w+DfCArQiCIfCIrPgIwIAAgHiALbK0gFiADbK18IBggGWytfCAfIAdsrXwgGiAXbK18IAEgAmytfCAbIBVsrXwgKkIQiHwgGCALbK0gHiADbK18IBogB2ytfCAfIBlsrXwgGyACbK18IAEgF2ytfCIqQhCGQoCA/P8Pg3wgK0IgiHwiKz4CNCAAIB8gC2ytIBggA2ytfCAaIBlsrXwgASAHbK18IBsgF2ytfCAqQhCIfCAaIAtsrSAfIANsrXwgGyAHbK18IAEgGWytfCIqQhCGQoCA/P8Pg3wgK0IgiHwiKz4COCAAIBsgGWytIBogA2ytfCABIAtsrXwgKkIQiHwgGyALbK0gASADbK18IipCEIZCgID8/w+DfCArQiCIfCIrPgI8IABBDzYCACAqQhCIIBsgA2ytfCArQiCIfCIqQgBRBEAgICQCDwsgACAqPgJAIABBEDYCACAgJAIPCyAgIQIgA0EBRgRAIAEoAgQhCCACIAApAgA3AgAgAiAAKQIINwIIIAIgACkCEDcCECACIAApAhg3AhggAiAAKQIgNwIgIAIgACkCKDcCKCACIAApAjA3AjAgAiAAKQI4NwI4IAIgACkCQDcCQCACKAIAIgFBEEsEQCABQRAQJwsgAkEEaiABQQJ0aiEEIAEEQCAIrSErQgAhKiACQQRqIQADQCAAIAAoAgCtICt+IixC/////w+DICp8Iio+AgAgKkIgiCAsQiCIfCEqIABBBGoiACAERw0ACyAqQgBSBEAgAUEQSQRAIAQgKj4CACACIAFBAWo2AgAFQZwMIAFBEBAoCwsLICAkAg8LIAJBADoARCACIApBf2ogA2oiBzYCACACQQhqIgRCADcCACAEQgA3AgggBEIANwIQIARCADcCGCAEQgA3AiAgBEIANwIoIARCADcCMCAEQQA2AjggAiABKAIErSAAKAIErX4iKj4CBCAqQiCIISoCQCAHQQFLBEBBAiEEQQEhBgJAAkACQAJAA0AgKkIgiCEsICqnIQkgBkEBaiILIAprIQUgBiAKSwR/IAUFQQAiBQsgAyAGSwR/IAsFIAMiCwtJBEAgLCEqA0AgBiAFayIMQRBPDQMgBUEQTw0EIAFBBGogBUECdGooAgCtIABBBGogDEECdGooAgCtfiAJrXwiLEIgiCAqfCEqICynIQkgBUEBaiIFIAtJDQALBSAsISoLIAZBEE8NAyACQQRqIAZBAnRqIAk2AgAgBEEBaiEJIAQgB0kEQCAEIQUgCSEEIAUhBgwBBSAqISsMBwsACwALQagMIAxBEBAoDAILQbQMIAVBEBAoDAELQcAMIAZBEBAoCwUgKiErCwsgK0IAUQRAIAchCAUgB0EQSQRAIAJBBGogB0ECdGogKz4CACACIAogA2oiCDYCAAVBzAwgB0EQECgLCyAIQQFLBEAgCCEBAkACQAJAA0AgAUF/aiIEQRBPDQEgAkEEaiAEQQJ0aigCAA0CIARBAUsEQCAEIQEMAQUgBCEBDAMLAAsAC0GwCyAEQRAQKAwBCyACIAE2AgALCyAAIAIpAgA3AgAgACACKQIINwIIIAAgAikCEDcCECAAIAIpAhg3AhggACACKQIgNwIgIAAgAikCKDcCKCAAIAIpAjA3AjAgACACKQI4NwI4IAAgAikCQDcCQCAgJAILCyQAIAEEfyAAQYCAgIB4RiABQX9GcQR/QQAFIAAgAW0LBUEACwv5CQIOfwZ+AkAjAiEJIwJB0ARqJAIgCSIIQQBBhAQQOhpBASACQQFqQRh0QRh1QR9xdCIFQQIQGCEOIAlBiARqIgMgASkCADcCACADIAEpAgg3AgggAyABKQIQNwIQIAMgASkCGDcCGCADIAEpAiA3AiAgAyABKQIoNwIoIAMgASkCMDcCMCADIAEpAjg3AjggAyABKQJANwJAIAMoAgAiAUEBRyADQQRqIgcoAgAiBEEAR3JFBEAgACAIQYQEEDwaIAkkAg8LIAVBf2ohECAIQYAEaiEFIAJB/wFxIg9BP3GtIRNBICAPa0E/ca0hFCABIQIDQAJAAkACQCAEaCIBBEAgBSAFKAIAIAFqNgIAIAJBEEsEQEEGIQEMBAtBICABayEEIAIEQCABrSEVIARBP3GtIRZCACERIANBBGogAkECdGohAQNAIAFBfGoiASgCAK0hEiABIBIgFYggEYQ+AgAgEiAWhiERIAEgB0cNAAsgAygCACIBQQFNDQMgAUF/aiINQRBPBEBBDCEBDAULIANBBGogDUECdGooAgAEQCABIQIFIAMgDTYCACANIQEMBAsFQQAhAgsFIAUoAgAiCkGABEkhBiAEIBBxIgEgDkwEQCAGRQRAQSUhAQwFCyAIIApqIAE6AAAgBSAFKAIAIgZBAWo2AgAgByAEIAFrIgE2AgAgAUEARyACQQFHckUEQEEBIQEMBAsgBSAPIAZqNgIAIAJBEEsEQEEqIQEMBQsgAkUEQEEAIQIMAwtCACERIANBBGogAkECdGohAQNAIAFBfGoiASgCAK0hEiABIBIgE4ggEYQ+AgAgEiAUhiERIAEgB0cNAAsgAygCACIBQQFNDQMgAUF/aiILQRBPBEBBMCEBDAULIANBBGogC0ECdGooAgAEQCABIQIMAwsgAyALNgIAIAshAQwDCyAGRQRAQREhAQwECyAIIApqIA4gAWs6AAAgBSAFKAIAQQFqNgIAIAJBEEsEQEETIQEMBAsgA0EEaiACQQJ0aiEGIAEgDmutIREgByEBAkACQAJAA0AgASAGRg0BIAFBBGohBCABIAEoAgCtIBF8IhE+AgAgEUIgiCIRQgBRDQIgBCEBDAALAAsgAkEQTwRAQRkhAQwGCyAGIBE+AgAgAyACQQFqIgE2AgAMAQsgAkEQSwRAQRshAQwFCyACBEAgAiEBBUEAIQIMAwsLQQAhBCADQQRqIAFBAnRqIQEDQCABQXxqIgEoAgAhBiABIAZBAXYgBHI2AgAgBkEfdCEEIAEgB0cNAAsgAygCACIBQQFNDQIgAUF/aiIMQRBPBEBBISEBDAQLIANBBGogDEECdGooAgAEQCABIQIFIAMgDDYCACAMIQEMAwsLCyAHKAIAIQQMAgsgAUEBRyAHKAIAIgRyBEAgASECDAIFQQMhAQsLCwJAAkACQAJAAkACQAJAAkACQAJAAkACQCABQQNrDi4ACwsBCwsLCwsCCwsLCwMLBAsLCwsLBQsGCwsLCwsHCwsLCAsLCwsJCwsLCwsKCwsgACAIQYQEEDwaIAkkAg8LIAJBEBAnDAkLQbALIA1BEBAoDAgLQawNIApBgAQQKAwHCyACQRAQJwwGC0GQDCACQRAQKAwFCyACQRAQJwwEC0GwCyAMQRAQKAwDC0GsDSAKQYAEECgMAgsgAkEQECcMAQtBsAsgC0EQECgLCwuhAgIFfwF+AkAgACgCACIBQRBLBEAgAUEQECcLIAFFBEAPCyAAQQRqIAFBAnRqIQNCACEGIABBBGohAQNAIAEgASgCAK1CAYYgBnwiBj4CACAGQiCIIQYgAUEEaiIBIANHDQALIAAoAgAhASAGQgBRBEAgASECBSABQRBJBEAgAEEEaiABQQJ0aiAGPgIAIAAgACgCAEEBaiICNgIABUGgDSABQRAQKAsLAkAgAkEIRgRAQQghAgJAAkADQCACQX9qIQEgAkUNBCABQRBPDQEgAEEEaiABQQJ0aigCACIEIAFBAnRBxAlqKAIAIgVGBEAgASECDAELCwwBC0G8CyABQRAQKAsgBCAFSQRADwsFIAJBCEkEQA8LCwsgAEHACRAWCwukBQEHfwJAIwIhBCMCQZABaiQCIAQhASAAKAIAIgJBCUkEQCABQdgMKQIANwIAIAFB4AwpAgA3AgggAUHoDCkCADcCECABQfAMKQIANwIYIAFB+AwpAgA3AiAgAUGADSkCADcCKCABQYgNKQIANwIwIAFBkA0pAgA3AjggAUGYDSkCADcCQAUgAEEINgIAIAEgAkF4ajYCACABQQRqIgIgAEEkaiIDKQIANwIAIAIgAykCCDcCCCACIAMpAhA3AhAgAiADKQIYNwIYIAFBJGoiAkIANwIAIAJCADcCCCACQgA3AhAgAkIANwIYIAJBADoAIAsgBEHIAGohAiABEBwgACABEBUgACgCACIBQQhLBEAgAEEINgIAIAIgAUF4ajYCACACQQRqIgEgAEEkaiIDKQIANwIAIAEgAykCCDcCCCABIAMpAhA3AhAgASADKQIYNwIYIAJBJGoiAUIANwIAIAFCADcCCCABQgA3AhAgAUIANwIYIAFBADoAICACEBwgACACEBUgACgCACEBCyABQQhGBEBBCCEDA0ACQCADQX9qIQIgA0UEQEEUIQMMAQsgAkEQTwRAQQshAwwBCyAAQQRqIAJBAnRqKAIAIgYgAkECdEHECWooAgAiB0YEQCACIQMMAgVBDCEDCwsLIANBC0YEQEG8CyACQRAQKAUgA0EMRgRAIAYgB0khBQUgA0EURgRAIAQkAg8LCwsFIAFBCEkhBQsgBUUEQCAAQcAJEBYgBCQCDwsgAUEBTQRAIAQkAg8LA0ACQCABQX9qIgFBEE8EQEERIQMMAQsgAEEEaiABQQJ0aigCAARAQRQhAwwBCyAAIAE2AgAgAUEBSw0BQRQhAwsLIANBEUYEQEGwCyABQRAQKAUgA0EURgRAIAQkAgsLCwuQAgICfwJ+AkAgACgCACIBQRBPBEBBxA0gAUEQECgLIABBBGogAUECdGpBADYCACAAKAIAQQFqIgFBEE8EQEG4DSABQRAQKAsgAEEEaiABQQJ0akEANgIAIAAgACgCAEECaiICNgIAIAJBEEsEQCACQRAQJwsgAEEEaiEBIAIEQEIAIQMFDwsgAEEEaiACQQJ0aiECA0AgASABKAIArSIEQtEHfiADfCIDPgIAIANCIIggBHwhAyABQQRqIgEgAkcNAAsgACgCACIBQQFNBEAPCwJAAkADQCABQX9qIgFBEE8NASAAQQRqIAFBAnRqKAIADQIgACABNgIAIAFBAUsNAAwCCwALQbALIAFBEBAoCwsL0BACD38EfgJAIwIhByMCQfACaiQCIAciAyABKQIANwIAIAMgASkCCDcCCCADIAEpAhA3AhAgAyABKQIYNwIYIAMgASkCIDcCICADIAEpAig3AiggAyABKQIwNwIwIAMgASkCODcCOCADIAEpAkA3AkAgB0HIAGoiBkHACSkDADcDACAGQcgJKQMANwMIIAZB0AkpAwA3AxAgBkHYCSkDADcDGCAGQeAJKQMANwMgIAZB6AkpAwA3AyggBkHwCSkDADcDMCAGQfgJKQMANwM4IAZBgAopAwA3A0AgB0GQAWoiBEGICikDADcDACAEQZAKKQMANwMIIARBmAopAwA3AxAgBEGgCikDADcDGCAEQagKKQMANwMgIARBsAopAwA3AyggBEG4CikDADcDMCAEQcAKKQMANwM4IARByAopAwA3A0AgB0HYAWoiBUHYDCkCADcCACAFQeAMKQIANwIIIAVB6AwpAgA3AhAgBUHwDCkCADcCGCAFQfgMKQIANwIgIAVBgA0pAgA3AiggBUGIDSkCADcCMCAFQZANKQIANwI4IAVBmA0pAgA3AkACQCADQQRqIgsoAgAiASADKAIAIgJyQQFLBEAgBkEEaiEMIAVBBGohDyAEQQRqIRACQAJAAkACQAJAAkACQAJAAkACQANAIAFoIggEQCACQRBLDQJBICAIayEBIAIEfyAIrSETIAFBP3GtIRRCACERIANBBGogAkECdGohAQNAIAFBfGoiASgCAK0hEiABIBIgE4ggEYQ+AgAgEiAUhiERIAEgC0cNAAsgAygCACIBQQFLBH8gAUF/aiIBQRBPDQUgA0EEaiABQQJ0aigCAAR/QQEFIAMgATYCAEEBCwVBAQsFQQELIQEDQCAQKAIAQQFxBEAgBEHACRAVCyAEKAIAIgJBEEsNBSACBEBBACEJIARBBGogAkECdGohAgNAIAJBfGoiAigCACEKIAIgCkEBdiAJcjYCACAKQR90IQkgAiAQRw0ACyAEKAIAIgJBAUsEQCACQX9qIgJBEE8NCCAEQQRqIAJBAnRqKAIARQRAIAQgAjYCAAsLCyABQQFqIQIgASAISQRAIAIhAQwBCwsLIAwoAgBoIggEQCAGKAIAIgFBEEsNBkEgIAhrIQIgAQR/IAitIRMgAkE/ca0hFEIAIREgBkEEaiABQQJ0aiEBA0AgAUF8aiIBKAIArSESIAEgEiATiCARhD4CACASIBSGIREgASAMRw0ACyAGKAIAIgFBAUsEfyABQX9qIgFBEE8NCSAGQQRqIAFBAnRqKAIABH9BAQUgBiABNgIAQQELBUEBCwVBAQshAQNAIA8oAgBBAXEEQCAFQcAJEBULIAUoAgAiAkEQSw0JIAIEQEEAIQkgBUEEaiACQQJ0aiECA0AgAkF8aiICKAIAIQogAiAKQQF2IAlyNgIAIApBH3QhCSACIA9HDQALIAUoAgAiAkEBSwRAIAJBf2oiAkEQTw0MIAVBBGogAkECdGooAgBFBEAgBSACNgIACwsLIAFBAWohAiABIAhJBEAgAiEBDAELCwsCQAJAAkAgAygCACIBIAYoAgAiAkYEQANAIAFBf2ohAiABRQ0CIAJBEE8NDiADQQRqIAJBAnRqKAIAIgEgBkEEaiACQQJ0aigCACIJRgRAIAIhAQwBCwsgASAJSQ0CBSABIAJJDQILCyADIAYQFiAEIAUQFgwBCyAGIAMQFiAFIAQQFgsgCygCACIBIAMoAgAiAnJBAU0EQCACIQ0gASEODA0LIAwoAgAgBigCAHJBAUsNACACIQ0gASEODAwLAAsgAkEQECcMCAtBsAsgAUEQECgMBwsgAkEQECcMBgtBsAsgAkEQECgMBQsgAUEQECcMBAtBsAsgAUEQECgMAwsgAkEQECcMAgtBsAsgAkEQECgMAQtBvAsgAkEQECgLBSACIQ0gASEOCwsgDUEBRiAOQQFGcQRAIAMgBCkDADcDACADIAQpAwg3AwggAyAEKQMQNwMQIAMgBCkDGDcDGCADIAQpAyA3AyAgAyAEKQMoNwMoIAMgBCkDMDcDMCADIAQpAzg3AzggAyAEKQNANwNABSADIAUpAwA3AwAgAyAFKQMINwMIIAMgBSkDEDcDECADIAUpAxg3AxggAyAFKQMgNwMgIAMgBSkDKDcDKCADIAUpAzA3AzAgAyAFKQM4NwM4IAMgBSkDQDcDQAsgB0GgAmohASADQcQAaiICLAAABEAgA0HACRAVIAIsAAAEQCACQQA6AAAgAxAbIAMoAgBBAUYgCygCAEVxBEAgAEHYDCkCADcCACAAQeAMKQIANwIIIABB6AwpAgA3AhAgAEHwDCkCADcCGCAAQfgMKQIANwIgIABBgA0pAgA3AiggAEGIDSkCADcCMCAAQZANKQIANwI4IABBmA0pAgA3AkAgByQCDwUgAUHACSkDADcDACABQcgJKQMANwMIIAFB0AkpAwA3AxAgAUHYCSkDADcDGCABQeAJKQMANwMgIAFB6AkpAwA3AyggAUHwCSkDADcDMCABQfgJKQMANwM4IAFBgAopAwA3A0AgASADEBYgACABKQIANwIAIAAgASkCCDcCCCAAIAEpAhA3AhAgACABKQIYNwIYIAAgASkCIDcCICAAIAEpAig3AiggACABKQIwNwIwIAAgASkCODcCOCAAIAEpAkA3AkAgByQCDwsACwsgAxAbIAAgAykCADcCACAAIAMpAgg3AgggACADKQIQNwIQIAAgAykCGDcCGCAAIAMpAiA3AiAgACADKQIoNwIoIAAgAykCMDcCMCAAIAMpAjg3AjggACADKQJANwJAIAckAgsLzx8BD38CQCMCIQwjAkGABWokAiAAQZABaiIELAAABEAgDCQCDwsgDCELIAxBuARqIgIgAEHIAGoiCikCADcCACACIAopAgg3AgggAiAKKQIQNwIQIAIgCikCGDcCGCACIAopAiA3AiAgAiAKKQIoNwIoIAIgCikCMDcCMCACIAopAjg3AjggAiAKKQJANwJAIAIgChAVIAxB8ANqIgEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAAkACQCABKAIAIgNBCEYEQEEIIQcCQAJAAkADQCAHQX9qIQMgB0UNBSADQRBPDQEgAUEEaiADQQJ0aigCACIHIANBAnRBxAlqKAIAIgVHDQIgAyEHDAALAAtBvAsgA0EQECgMAQsgByAFTw0CQQghDQsFIANBCE8NASADIQ0LDAELIAFBwAkQFiABKAIAIQ0LIAEoAgQhDiALIAFBCGoiAykCADcCACALIAMpAgg3AgggCyADKQIQNwIQIAsgAykCGDcCGCALIAMpAiA3AiAgCyADKQIoNwIoIAsgAykCMDcCMCALIAMpAjg3AjggDUEBRiAORXEEQCAEQQE6AAAgDCQCDwsgDEGoA2ohCCAMQeACaiEEIAxBmAJqIQUgDEGIAWohBiACIAApAgA3AgAgAiAAKQIINwIIIAIgACkCEDcCECACIAApAhg3AhggAiAAKQIgNwIgIAIgACkCKDcCKCACIAApAjA3AjAgAiAAKQI4NwI4IAIgACkCQDcCQCACIAAQFyABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABEBsgDEHAAGoiCSABKQMANwMAIAkgASkDCDcDCCAJIAEpAxA3AxAgCSABKQMYNwMYIAkgASkDIDcDICAJIAEpAyg3AyggCSABKQMwNwMwIAkgASkDODcDOCAJIAEpA0A3A0AgAiAJKQMANwMAIAIgCSkDCDcDCCACIAkpAxA3AxAgAiAJKQMYNwMYIAIgCSkDIDcDICACIAkpAyg3AyggAiAJKQMwNwMwIAIgCSkDODcDOCACIAkpA0A3A0AgAiAJEBUgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0ACQAJAIAEoAgAiA0EIRgRAQQghBwJAAkACQANAIAdBf2ohAyAHRQ0FIANBEE8NASABQQRqIANBAnRqKAIAIgcgA0ECdEHECWooAgAiD0cNAiADIQcMAAsAC0G8CyADQRAQKAwBCyAHIA9PDQILBSADQQhPDQELDAELIAFBwAkQFgsgBCABKQMANwMAIAQgASkDCDcDCCAEIAEpAxA3AxAgBCABKQMYNwMYIAQgASkDIDcDICAEIAEpAyg3AyggBCABKQMwNwMwIAQgASkDODcDOCAEIAEpA0A3A0AgAiAEKQMANwMAIAIgBCkDCDcDCCACIAQpAxA3AxAgAiAEKQMYNwMYIAIgBCkDIDcDICACIAQpAyg3AyggAiAEKQMwNwMwIAIgBCkDODcDOCACIAQpA0A3A0AgAiAJEBUgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0ACQAJAIAEoAgAiA0EIRgRAQQghBwJAAkACQANAIAdBf2ohAyAHRQ0FIANBEE8NASABQQRqIANBAnRqKAIAIgcgA0ECdEHECWooAgAiCUcNAiADIQcMAAsAC0G8CyADQRAQKAwBCyAHIAlPDQILBSADQQhPDQELDAELIAFBwAkQFgsgBSABKQMANwMAIAUgASkDCDcDCCAFIAEpAxA3AxAgBSABKQMYNwMYIAUgASkDIDcDICAFIAEpAyg3AyggBSABKQMwNwMwIAUgASkDODcDOCAFIAEpA0A3A0AgAiANNgIAIAIgDjYCBCACQQhqIgMgCykDADcDACADIAspAwg3AwggAyALKQMQNwMQIAMgCykDGDcDGCADIAspAyA3AyAgAyALKQMoNwMoIAMgCykDMDcDMCADIAspAzg3AzggCCACEB0gAiAFKQMANwMAIAIgBSkDCDcDCCACIAUpAxA3AxAgAiAFKQMYNwMYIAIgBSkDIDcDICACIAUpAyg3AyggAiAFKQMwNwMwIAIgBSkDODcDOCACIAUpA0A3A0AgAiAIEBcgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgARAbIAYgASkDADcDACAGIAEpAwg3AwggBiABKQMQNwMQIAYgASkDGDcDGCAGIAEpAyA3AyAgBiABKQMoNwMoIAYgASkDMDcDMCAGIAEpAzg3AzggBiABKQNANwNAIAIgBikDADcDACACIAYpAwg3AwggAiAGKQMQNwMQIAIgBikDGDcDGCACIAYpAyA3AyAgAiAGKQMoNwMoIAIgBikDMDcDMCACIAYpAzg3AzggAiAGKQNANwNAIAIgBhAXIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAIAEQGyAEIAEpAwA3AwAgBCABKQMINwMIIAQgASkDEDcDECAEIAEpAxg3AxggBCABKQMgNwMgIAQgASkDKDcDKCAEIAEpAzA3AzAgBCABKQM4NwM4IAQgASkDQDcDQCACIAApAgA3AgAgAiAAKQIINwIIIAIgACkCEDcCECACIAApAhg3AhggAiAAKQIgNwIgIAIgACkCKDcCKCACIAApAjA3AjAgAiAAKQI4NwI4IAIgACkCQDcCQCACIAAQFSABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQAJAAkAgASgCACIDQQhGBEBBCCEHAkACQAJAA0AgB0F/aiEDIAdFDQUgA0EQTw0BIAFBBGogA0ECdGooAgAiByADQQJ0QcQJaigCACILRw0CIAMhBwwACwALQbwLIANBEBAoDAELIAcgC08NAgsFIANBCE8NAQsMAQsgAUHACRAWCyAIIAEpAwA3AwAgCCABKQMINwMIIAggASkDEDcDECAIIAEpAxg3AxggCCABKQMgNwMgIAggASkDKDcDKCAIIAEpAzA3AzAgCCABKQM4NwM4IAggASkDQDcDQCACIAQpAwA3AwAgAiAEKQMINwMIIAIgBCkDEDcDECACIAQpAxg3AxggAiAEKQMgNwMgIAIgBCkDKDcDKCACIAQpAzA3AzAgAiAEKQM4NwM4IAIgBCkDQDcDQCACIAgQFiABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABLABEBEAgAUHACRAVCyAMQdABaiIDIAEpAwA3AwAgAyABKQMINwMIIAMgASkDEDcDECADIAEpAxg3AxggAyABKQMgNwMgIAMgASkDKDcDKCADIAEpAzA3AzAgAyABKQM4NwM4IAMgASkDQDcDQCACIAApAgA3AgAgAiAAKQIINwIIIAIgACkCEDcCECACIAApAhg3AhggAiAAKQIgNwIgIAIgACkCKDcCKCACIAApAjA3AjAgAiAAKQI4NwI4IAIgACkCQDcCQCACIAMQFiABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABLABEBEAgAUHACRAVCyAIIAEpAwA3AwAgCCABKQMINwMIIAggASkDEDcDECAIIAEpAxg3AxggCCABKQMgNwMgIAggASkDKDcDKCAIIAEpAzA3AzAgCCABKQM4NwM4IAggASkDQDcDQCACIAYpAwA3AwAgAiAGKQMINwMIIAIgBikDEDcDECACIAYpAxg3AxggAiAGKQMgNwMgIAIgBikDKDcDKCACIAYpAzA3AzAgAiAGKQM4NwM4IAIgBikDQDcDQCACIAgQFyABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABEBsgBCABKQMANwMAIAQgASkDCDcDCCAEIAEpAxA3AxAgBCABKQMYNwMYIAQgASkDIDcDICAEIAEpAyg3AyggBCABKQMwNwMwIAQgASkDODcDOCAEIAEpA0A3A0AgAiAEKQMANwMAIAIgBCkDCDcDCCACIAQpAxA3AxAgAiAEKQMYNwMYIAIgBCkDIDcDICACIAQpAyg3AyggAiAEKQMwNwMwIAIgBCkDODcDOCACIAQpA0A3A0AgAiAKEBYgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgASwARARAIAFBwAkQFQsgBSABKQMANwMAIAUgASkDCDcDCCAFIAEpAxA3AxAgBSABKQMYNwMYIAUgASkDIDcDICAFIAEpAyg3AyggBSABKQMwNwMwIAUgASkDODcDOCAFIAEpA0A3A0AgCiAFKQIANwIAIAogBSkCCDcCCCAKIAUpAhA3AhAgCiAFKQIYNwIYIAogBSkCIDcCICAKIAUpAig3AiggCiAFKQIwNwIwIAogBSkCODcCOCAKIAUpAkA3AkAgACADKQIANwIAIAAgAykCCDcCCCAAIAMpAhA3AhAgACADKQIYNwIYIAAgAykCIDcCICAAIAMpAig3AiggACADKQIwNwIwIAAgAykCODcCOCAAIAMpAkA3AkAgDCQCCwvCFgETfwJAIwIhCSMCQfC1AmokAiAJQZC0AmohAyAJQcizAmohBSAJQbiyAmohByAJQey1AmohCyAJIgRBCDYCACAEQZiv4LcBNgIEIARB24LKzwU2AgggBEHZ0bjuAjYCDCAEQdv57xQ2AhAgBEGHlpz0fDYCFCAEQZXFga0FNgIYIARBrPfyTjYCHCAEQf7M+c0HNgIgIARBJGoiBkIANwIAIAZCADcCCCAGQgA3AhAgBkIANwIYIAZBADoAICAEQQg2AkggBEHMAGoiD0G4qcNYNgIAIARBj6Gf4nk2AlAgBEGZqJW0ejYCVCAEQcjo3mg2AlggBEGokcTwADYCXCAEQfz3k+0FNgJgIARB5YiPtQI2AmQgBEH3tOvBBDYCaCAEQewAaiIGQgA3AgAgBkIANwIIIAZCADcCECAGQgA3AhggBkEAOgAgIARBkAFqIhBBADoAACAJQdi0AmoiASAEQZQBEDwaIAlB6JkBaiICIARBlAEQPBogAkGUAWogAUGUARA8GiACQagCaiABQZQBEDwaIAJBvANqIAFBlAEQPBogAkHQBGogAUGUARA8GiACQeQFaiABQZQBEDwaIAJB+AZqIAFBlAEQPBogAkGMCGogAUGUARA8GiACQaAJaiABQZQBEDwaIAJBtApqIAFBlAEQPBogAkHIC2ogAUGUARA8GiACQdwMaiABQZQBEDwaIAJB8A1qIAFBlAEQPBogAkGED2ogAUGUARA8GiACQZgQaiABQZQBEDwaIAJBrBFqIAFBlAEQPBogAkHAEmogAUGUARA8GiACQdQTaiABQZQBEDwaIAJB6BRqIAFBlAEQPBogAkH8FWogAUGUARA8GiACQZAXaiABQZQBEDwaIAJBpBhqIAFBlAEQPBogAkG4GWogAUGUARA8GiACQcwaaiABQZQBEDwaIAJB4BtqIAFBlAEQPBogAkH0HGogAUGUARA8GiACQYgeaiABQZQBEDwaIAJBnB9qIAFBlAEQPBogAkGwIGogAUGUARA8GiACQcQhaiABQZQBEDwaIAJB2CJqIAFBlAEQPBogAkHsI2ogAUGUARA8GiACQYAlaiABQZQBEDwaIAJBlCZqIAFBlAEQPBogAkGoJ2ogAUGUARA8GiACQbwoaiABQZQBEDwaIAJB0ClqIAFBlAEQPBogAkHkKmogAUGUARA8GiACQfgraiABQZQBEDwaIAJBjC1qIAFBlAEQPBogAkGgLmogAUGUARA8GiACQbQvaiABQZQBEDwaIAJByDBqIAFBlAEQPBogAkHcMWogAUGUARA8GiACQfAyaiABQZQBEDwaIAJBhDRqIAFBlAEQPBogAkGYNWogAUGUARA8GiACQaw2aiABQZQBEDwaIAJBwDdqIAFBlAEQPBogAkHUOGogAUGUARA8GiACQeg5aiABQZQBEDwaIAJB/DpqIAFBlAEQPBogAkGQPGogAUGUARA8GiACQaQ9aiABQZQBEDwaIAJBuD5qIAFBlAEQPBogAkHMP2ogAUGUARA8GiACQeDAAGogAUGUARA8GiACQfTBAGogAUGUARA8GiACQYjDAGogAUGUARA8GiACQZzEAGogAUGUARA8GiACQbDFAGogAUGUARA8GiACQcTGAGogAUGUARA8GiACQdjHAGogAUGUARA8GiACQezIAGogAUGUARA8GiACQYDKAGogAUGUARA8GiACQZTLAGogAUGUARA8GiAQLAAABH8gByAEQZABEDwaIAsgBEGRAWoiBi4AADsAACALIAYsAAI6AAJBAQUgBSAEKQMANwMAIAUgBCkDCDcDCCAFIAQpAxA3AxAgBSAEKQMYNwMYIAUgBCkDIDcDICAFIAQpAyg3AyggBSAEKQMwNwMwIAUgBCkDODcDOCAFIAQpA0A3A0AgBEHIAGoiBigCAEEBRiAPKAIARXEEQCADQdgMKQIANwIAIANB4AwpAgA3AgggA0HoDCkCADcCECADQfAMKQIANwIYIANB+AwpAgA3AiAgA0GADSkCADcCKCADQYgNKQIANwIwIANBkA0pAgA3AjggA0GYDSkCADcCQAUgAUHACSkDADcDACABQcgJKQMANwMIIAFB0AkpAwA3AxAgAUHYCSkDADcDGCABQeAJKQMANwMgIAFB6AkpAwA3AyggAUHwCSkDADcDMCABQfgJKQMANwM4IAFBgAopAwA3A0AgASAGEBYgAyABKQMANwMAIAMgASkDCDcDCCADIAEpAxA3AxAgAyABKQMYNwMYIAMgASkDIDcDICADIAEpAyg3AyggAyABKQMwNwMwIAMgASkDODcDOCADIAEpA0A3A0ALIAcgBSkDADcDACAHIAUpAwg3AwggByAFKQMQNwMQIAcgBSkDGDcDGCAHIAUpAyA3AyAgByAFKQMoNwMoIAcgBSkDMDcDMCAHIAUpAzg3AzggByAFKQNANwNAIAdByABqIgYgAykDADcDACAGIAMpAwg3AwggBiADKQMQNwMQIAYgAykDGDcDGCAGIAMpAyA3AyAgBiADKQMoNwMoIAYgAykDMDcDMCAGIAMpAzg3AzggBiADKQNANwNAQQALIQwgCUGYAWohDSAJQZDmAWoiCkGozABqIQggCiEGA0AgBiAHQZABEDwaIAYgDDoAkAEgBkGRAWoiDiALLgAAOwAAIA4gCywAAjoAAiAGQZQBaiIGIAhHDQALIA0gAkGozAAQPBogDUGozABqIApBqMwAEDwaIA1BlAFqIRMgBEHIAGohESAHQcgAaiEIIARBkQFqIRIgDUG8zQBqIg4hAkEBIQZBACEKA0AgBBAeIAQQHiAEEB4gBBAeIBMgCkGUAWxqIARBlAEQPBogECwAAAR/IAcgBEGQARA8GiALIBIuAAA7AAAgCyASLAACOgACQQEFIAUgBCkDADcDACAFIAQpAwg3AwggBSAEKQMQNwMQIAUgBCkDGDcDGCAFIAQpAyA3AyAgBSAEKQMoNwMoIAUgBCkDMDcDMCAFIAQpAzg3AzggBSAEKQNANwNAIBEoAgBBAUYgDygCAEVxBEAgA0HYDCkCADcCACADQeAMKQIANwIIIANB6AwpAgA3AhAgA0HwDCkCADcCGCADQfgMKQIANwIgIANBgA0pAgA3AiggA0GIDSkCADcCMCADQZANKQIANwI4IANBmA0pAgA3AkAFIAFBwAkpAwA3AwAgAUHICSkDADcDCCABQdAJKQMANwMQIAFB2AkpAwA3AxggAUHgCSkDADcDICABQegJKQMANwMoIAFB8AkpAwA3AzAgAUH4CSkDADcDOCABQYAKKQMANwNAIAEgERAWIAMgASkDADcDACADIAEpAwg3AwggAyABKQMQNwMQIAMgASkDGDcDGCADIAEpAyA3AyAgAyABKQMoNwMoIAMgASkDMDcDMCADIAEpAzg3AzggAyABKQNANwNACyAHIAUpAwA3AwAgByAFKQMINwMIIAcgBSkDEDcDECAHIAUpAxg3AxggByAFKQMgNwMgIAcgBSkDKDcDKCAHIAUpAzA3AzAgByAFKQM4NwM4IAcgBSkDQDcDQCAIIAMpAwA3AwAgCCADKQMINwMIIAggAykDEDcDECAIIAMpAxg3AxggCCADKQMgNwMgIAggAykDKDcDKCAIIAMpAzA3AzAgCCADKQM4NwM4IAggAykDQDcDQEEACyEMIAIgB0GQARA8GiAOIApBlAFsaiAMOgCQASAOIApBlAFsakGRAWoiCiALLgAAOwAAIAogCywAAjoAAiAOIAZBlAFsaiECIAZBAWoiDEHCAEcEQCAGIQogDCEGDAELCyAAIA1B0JgBEDwaIAkkAgsLwgwBEH8CQCMCIQsjAkGQCmokAiALIgcgAkEBEBkgC0GQCWoiBkIANwAAIAZCADcACCAGQgA3ABAgBkIANwAYIAZCADcAICAGQgA3ACggBkIANwAwIAZCADcAOCAGQgA3AEAgBkIANwBIIAZCADcAUCAGQgA3AFggBkIANwBgIAZCADcAaCAGQgA3AHAgBkIANwB4IAcoAoAEIglBgARLBEAgCUGABBAnCyALQbgHaiEOIAtB4AVqIQQgC0GIBGohBSAJRSEDIAlBBEkEfyAJBUEECyECAkAgAwRAQQAhDQUgCSACayEIIAchAyACIQkgByACaiECQQAhBwJAAkACQANAAkACQAJAAkACQAJAIAlBAWsOBAMCAQAECyADLAACQQJ0Qf8BcSADLAADQQN0Qf8BcWpBGHRBGHUgAywAAUEBdEH/AXFqQRh0QRh1IAMsAABqQRh0QRh1IQMMBAsgAywAAUEBdEH/AXEgAywAAkECdEH/AXFqQRh0QRh1IAMsAABqQRh0QRh1IQMMAwsgAywAAUEBdEH/AXEgAywAAGpBGHRBGHUhAwwCCyADLAAAIQMMAQsMAgsgB0GAAU8NAiAGIAdqIAM6AAAgB0EBaiEHIAhFIQwgCCAIQQRJBH8gCAVBBAsiCmshCCACIgMgCmohDyAMBEBBACEICyAMBEAgAiEPCyAMRQRAIAohCQsgDCACRXIEQCAHIQ0MBgUgDyECDAELAAsAC0HQDRAuDAELQeQNIAdBgAEQKAsLCyAFQYgKKQMANwMAIAVBkAopAwA3AwggBUGYCikDADcDECAFQaAKKQMANwMYIAVBqAopAwA3AyAgBUGwCikDADcDKCAFQbgKKQMANwMwIAVBwAopAwA3AzggBUHICikDADcDQCAFQcgAaiICQYgKKQMANwMAIAJBkAopAwA3AwggAkGYCikDADcDECACQaAKKQMANwMYIAJBqAopAwA3AyAgAkGwCikDADcDKCACQbgKKQMANwMwIAJBwAopAwA3AzggAkHICikDADcDQCAFQZABaiICQdgMKQIANwIAIAJB4AwpAgA3AgggAkHoDCkCADcCECACQfAMKQIANwIYIAJB+AwpAgA3AiAgAkGADSkCADcCKCACQYgNKQIANwIwIAJBkA0pAgA3AjggAkGYDSkCADcCQCAEQYgKKQMANwMAIARBkAopAwA3AwggBEGYCikDADcDECAEQaAKKQMANwMYIARBqAopAwA3AyAgBEGwCikDADcDKCAEQbgKKQMANwMwIARBwAopAwA3AzggBEHICikDADcDQCAEQcgAaiICQYgKKQMANwMAIAJBkAopAwA3AwggAkGYCikDADcDECACQaAKKQMANwMYIAJBqAopAwA3AyAgAkGwCikDADcDKCACQbgKKQMANwMwIAJBwAopAwA3AzggAkHICikDADcDQCAEQZABaiICQdgMKQIANwIAIAJB4AwpAgA3AgggAkHoDCkCADcCECACQfAMKQIANwIYIAJB+AwpAgA3AiAgAkGADSkCADcCKCACQYgNKQIANwIwIAJBkA0pAgA3AjggAkGYDSkCADcCQCANRSICBEAgBSAEECEgBSAEECEgBSAEECEgBSAEECEgBSAEECEgBSAEECEgBSAEECEgBSAEECEgBSAEECEgBSAEECEgDiAFQdgBEDwaIAAgDhAiIAskAg8FQQohCgsgBiANaiERIAYhCSAGQQFqIQMgAgR/IAkFIAMLIQYgAkEBc0EBcSEMAkACQAJAAkADQEEAIAprQRh0QRh1IRJBACEIIAYhAiAJIQMgDCEHA0AgAywAACIDIApBGHRBGHVGBEAgCEHCAE8NBCAEIAEgCEGUAWxqECMFIAMgEkYEQCAIQcIATw0GIAQgAUGozABqIAhBlAFsahAjCwsgAiIDIBFGIRAgA0EBaiEDIBAEfyACBSADCyEPIBBBAXMgB2ohDSAQRQRAIAchCAsgAkUgEHJFBEAgAiEDIA8hAiANIQcMAQsLIAUgBBAhIApBf2pBGHRBGHUhAiAKQRh0QRh1QQFMDQEgAiEKDAALAAsgDiAFQdgBEDwaIAAgDhAiIAskAg8LQfANIAhBwgAQKAwBC0H8DSAIQcIAECgLCwu9OgEPfwJAIwIhDCMCQeAKaiQCIAAoApABQQFGBEAgACgClAFFBEAgACABQdgBEDwaIAwkAg8LCyABKAKQAUEBRgRAIAEoApQBRQRAIAwkAg8LCyAMQYAJaiICIAFBkAFqIg4pAgA3AgAgAiAOKQIINwIIIAIgDikCEDcCECACIA4pAhg3AhggAiAOKQIgNwIgIAIgDikCKDcCKCACIA4pAjA3AjAgAiAOKQI4NwI4IAIgDikCQDcCQCACIA4QFyAMQbgIaiIDIAIpAwA3AwAgAyACKQMINwMIIAMgAikDEDcDECADIAIpAxg3AxggAyACKQMgNwMgIAMgAikDKDcDKCADIAIpAzA3AzAgAyACKQM4NwM4IAMgAikDQDcDQCADEBsgDCIGIAMpAwA3AwAgBiADKQMINwMIIAYgAykDEDcDECAGIAMpAxg3AxggBiADKQMgNwMgIAYgAykDKDcDKCAGIAMpAzA3AzAgBiADKQM4NwM4IAYgAykDQDcDQCACIABBkAFqIgkpAgA3AgAgAiAJKQIINwIIIAIgCSkCEDcCECACIAkpAhg3AhggAiAJKQIgNwIgIAIgCSkCKDcCKCACIAkpAjA3AjAgAiAJKQI4NwI4IAIgCSkCQDcCQCACIAkQFyADIAIpAwA3AwAgAyACKQMINwMIIAMgAikDEDcDECADIAIpAxg3AxggAyACKQMgNwMgIAMgAikDKDcDKCADIAIpAzA3AzAgAyACKQM4NwM4IAMgAikDQDcDQCADEBsgDEHIAGoiBSADKQMANwMAIAUgAykDCDcDCCAFIAMpAxA3AxAgBSADKQMYNwMYIAUgAykDIDcDICAFIAMpAyg3AyggBSADKQMwNwMwIAUgAykDODcDOCAFIAMpA0A3A0AgAiAAKQIANwIAIAIgACkCCDcCCCACIAApAhA3AhAgAiAAKQIYNwIYIAIgACkCIDcCICACIAApAig3AiggAiAAKQIwNwIwIAIgACkCODcCOCACIAApAkA3AkAgAiAGEBcgAyACKQMANwMAIAMgAikDCDcDCCADIAIpAxA3AxAgAyACKQMYNwMYIAMgAikDIDcDICADIAIpAyg3AyggAyACKQMwNwMwIAMgAikDODcDOCADIAIpA0A3A0AgAxAbIAxBkAFqIgcgAykDADcDACAHIAMpAwg3AwggByADKQMQNwMQIAcgAykDGDcDGCAHIAMpAyA3AyAgByADKQMoNwMoIAcgAykDMDcDMCAHIAMpAzg3AzggByADKQNANwNAIAIgASkCADcCACACIAEpAgg3AgggAiABKQIQNwIQIAIgASkCGDcCGCACIAEpAiA3AiAgAiABKQIoNwIoIAIgASkCMDcCMCACIAEpAjg3AjggAiABKQJANwJAIAIgBRAXIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAIAMQGyAMQdgBaiIIIAMpAwA3AwAgCCADKQMINwMIIAggAykDEDcDECAIIAMpAxg3AxggCCADKQMgNwMgIAggAykDKDcDKCAIIAMpAzA3AzAgCCADKQM4NwM4IAggAykDQDcDQCACIABByABqIg0pAgA3AgAgAiANKQIINwIIIAIgDSkCEDcCECACIA0pAhg3AhggAiANKQIgNwIgIAIgDSkCKDcCKCACIA0pAjA3AjAgAiANKQI4NwI4IAIgDSkCQDcCQCACIAYQFyADIAIpAwA3AwAgAyACKQMINwMIIAMgAikDEDcDECADIAIpAxg3AxggAyACKQMgNwMgIAMgAikDKDcDKCADIAIpAzA3AzAgAyACKQM4NwM4IAMgAikDQDcDQCADEBsgDEHwB2oiBCADKQMANwMAIAQgAykDCDcDCCAEIAMpAxA3AxAgBCADKQMYNwMYIAQgAykDIDcDICAEIAMpAyg3AyggBCADKQMwNwMwIAQgAykDODcDOCAEIAMpA0A3A0AgAiAEKQMANwMAIAIgBCkDCDcDCCACIAQpAxA3AxAgAiAEKQMYNwMYIAIgBCkDIDcDICACIAQpAyg3AyggAiAEKQMwNwMwIAIgBCkDODcDOCACIAQpA0A3A0AgAiAOEBcgAyACKQMANwMAIAMgAikDCDcDCCADIAIpAxA3AxAgAyACKQMYNwMYIAMgAikDIDcDICADIAIpAyg3AyggAyACKQMwNwMwIAMgAikDODcDOCADIAIpA0A3A0AgAxAbIAxBoAJqIgogAykDADcDACAKIAMpAwg3AwggCiADKQMQNwMQIAogAykDGDcDGCAKIAMpAyA3AyAgCiADKQMoNwMoIAogAykDMDcDMCAKIAMpAzg3AzggCiADKQNANwNAIAIgAUHIAGoiASkCADcCACACIAEpAgg3AgggAiABKQIQNwIQIAIgASkCGDcCGCACIAEpAiA3AiAgAiABKQIoNwIoIAIgASkCMDcCMCACIAEpAjg3AjggAiABKQJANwJAIAIgBRAXIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAIAMQGyAEIAMpAwA3AwAgBCADKQMINwMIIAQgAykDEDcDECAEIAMpAxg3AxggBCADKQMgNwMgIAQgAykDKDcDKCAEIAMpAzA3AzAgBCADKQM4NwM4IAQgAykDQDcDQCACIAQpAwA3AwAgAiAEKQMINwMIIAIgBCkDEDcDECACIAQpAxg3AxggAiAEKQMgNwMgIAIgBCkDKDcDKCACIAQpAzA3AzAgAiAEKQM4NwM4IAIgBCkDQDcDQCACIAkQFyADIAIpAwA3AwAgAyACKQMINwMIIAMgAikDEDcDECADIAIpAxg3AxggAyACKQMgNwMgIAMgAikDKDcDKCADIAIpAzA3AzAgAyACKQM4NwM4IAMgAikDQDcDQCADEBsgDEHoAmoiASADKQMANwMAIAEgAykDCDcDCCABIAMpAxA3AxAgASADKQMYNwMYIAEgAykDIDcDICABIAMpAyg3AyggASADKQMwNwMwIAEgAykDODcDOCABIAMpA0A3A0AgAiAHKQMANwMAIAIgBykDCDcDCCACIAcpAxA3AxAgAiAHKQMYNwMYIAIgBykDIDcDICACIAcpAyg3AyggAiAHKQMwNwMwIAIgBykDODcDOCACIAcpA0A3A0AgAiAIEBYgAyACKQMANwMAIAMgAikDCDcDCCADIAIpAxA3AxAgAyACKQMYNwMYIAMgAikDIDcDICADIAIpAyg3AyggAyACKQMwNwMwIAMgAikDODcDOCADIAIpA0A3A0AgAywARARAIANBwAkQFQsgDEGwA2oiCyADKQMANwMAIAsgAykDCDcDCCALIAMpAxA3AxAgCyADKQMYNwMYIAsgAykDIDcDICALIAMpAyg3AyggCyADKQMwNwMwIAsgAykDODcDOCALIAMpA0A3A0AgAiAKKQMANwMAIAIgCikDCDcDCCACIAopAxA3AxAgAiAKKQMYNwMYIAIgCikDIDcDICACIAopAyg3AyggAiAKKQMwNwMwIAIgCikDODcDOCACIAopA0A3A0AgAiABEBYgAyACKQMANwMAIAMgAikDCDcDCCADIAIpAxA3AxAgAyACKQMYNwMYIAMgAikDIDcDICADIAIpAyg3AyggAyACKQMwNwMwIAMgAikDODcDOCADIAIpA0A3A0AgAywARARAIANBwAkQFQsgDEH4A2oiCCADKQMANwMAIAggAykDCDcDCCAIIAMpAxA3AxAgCCADKQMYNwMYIAggAykDIDcDICAIIAMpAyg3AyggCCADKQMwNwMwIAggAykDODcDOCAIIAMpA0A3A0AgCygCAEEBRgRAIAsoAgRFBEACQAJAIAgoAgBBAUcNACAIKAIEDQAgABAkDAELIAJBiAopAwA3AwAgAkGQCikDADcDCCACQZgKKQMANwMQIAJBoAopAwA3AxggAkGoCikDADcDICACQbAKKQMANwMoIAJBuAopAwA3AzAgAkHACikDADcDOCACQcgKKQMANwNAIAJByABqIgFBiAopAwA3AwAgAUGQCikDADcDCCABQZgKKQMANwMQIAFBoAopAwA3AxggAUGoCikDADcDICABQbAKKQMANwMoIAFBuAopAwA3AzAgAUHACikDADcDOCABQcgKKQMANwNAIAJBkAFqIgFB2AwpAgA3AgAgAUHgDCkCADcCCCABQegMKQIANwIQIAFB8AwpAgA3AhggAUH4DCkCADcCICABQYANKQIANwIoIAFBiA0pAgA3AjAgAUGQDSkCADcCOCABQZgNKQIANwJAIAAgAkHYARA8GgsgDCQCDwsLIAxBqAdqIQUgAiALKQMANwMAIAIgCykDCDcDCCACIAspAxA3AxAgAiALKQMYNwMYIAIgCykDIDcDICACIAspAyg3AyggAiALKQMwNwMwIAIgCykDODcDOCACIAspA0A3A0AgAiALEBcgAyACKQMANwMAIAMgAikDCDcDCCADIAIpAxA3AxAgAyACKQMYNwMYIAMgAikDIDcDICADIAIpAyg3AyggAyACKQMwNwMwIAMgAikDODcDOCADIAIpA0A3A0AgAxAbIAxBwARqIgEgAykDADcDACABIAMpAwg3AwggASADKQMQNwMQIAEgAykDGDcDGCABIAMpAyA3AyAgASADKQMoNwMoIAEgAykDMDcDMCABIAMpAzg3AzggASADKQNANwNAIAIgBykDADcDACACIAcpAwg3AwggAiAHKQMQNwMQIAIgBykDGDcDGCACIAcpAyA3AyAgAiAHKQMoNwMoIAIgBykDMDcDMCACIAcpAzg3AzggAiAHKQNANwNAIAIgARAXIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAIAMQGyAMQYgFaiIHIAMpAwA3AwAgByADKQMINwMIIAcgAykDEDcDECAHIAMpAxg3AxggByADKQMgNwMgIAcgAykDKDcDKCAHIAMpAzA3AzAgByADKQM4NwM4IAcgAykDQDcDQCACIAEpAwA3AwAgAiABKQMINwMIIAIgASkDEDcDECACIAEpAxg3AxggAiABKQMgNwMgIAIgASkDKDcDKCACIAEpAzA3AzAgAiABKQM4NwM4IAIgASkDQDcDQCACIAsQFyADIAIpAwA3AwAgAyACKQMINwMIIAMgAikDEDcDECADIAIpAxg3AxggAyACKQMgNwMgIAMgAikDKDcDKCADIAIpAzA3AzAgAyACKQM4NwM4IAMgAikDQDcDQCADEBsgDEHQBWoiDyADKQMANwMAIA8gAykDCDcDCCAPIAMpAxA3AxAgDyADKQMYNwMYIA8gAykDIDcDICAPIAMpAyg3AyggDyADKQMwNwMwIA8gAykDODcDOCAPIAMpA0A3A0AgAiAIKQMANwMAIAIgCCkDCDcDCCACIAgpAxA3AxAgAiAIKQMYNwMYIAIgCCkDIDcDICACIAgpAyg3AyggAiAIKQMwNwMwIAIgCCkDODcDOCACIAgpA0A3A0AgAiAIEBcgAyACKQMANwMAIAMgAikDCDcDCCADIAIpAxA3AxAgAyACKQMYNwMYIAMgAikDIDcDICADIAIpAyg3AyggAyACKQMwNwMwIAMgAikDODcDOCADIAIpA0A3A0AgAxAbIAQgAykDADcDACAEIAMpAwg3AwggBCADKQMQNwMQIAQgAykDGDcDGCAEIAMpAyA3AyAgBCADKQMoNwMoIAQgAykDMDcDMCAEIAMpAzg3AzggBCADKQNANwNAIAIgBCkDADcDACACIAQpAwg3AwggAiAEKQMQNwMQIAIgBCkDGDcDGCACIAQpAyA3AyAgAiAEKQMoNwMoIAIgBCkDMDcDMCACIAQpAzg3AzggAiAEKQNANwNAIAIgDxAVIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAAkACQCADKAIAIgFBCEYEQEEIIQYCQAJAAkADQCAGQX9qIQEgBkUNBSABQRBPDQEgA0EEaiABQQJ0aigCACIGIAFBAnRBxAlqKAIAIhBHDQIgASEGDAALAAtBvAsgAUEQECgMAQsgBiAQTw0CCwUgAUEITw0BCwwBCyADQcAJEBYLIAUgAykDADcDACAFIAMpAwg3AwggBSADKQMQNwMQIAUgAykDGDcDGCAFIAMpAyA3AyAgBSADKQMoNwMoIAUgAykDMDcDMCAFIAMpAzg3AzggBSADKQNANwNAIAIgBSkDADcDACACIAUpAwg3AwggAiAFKQMQNwMQIAIgBSkDGDcDGCACIAUpAyA3AyAgAiAFKQMoNwMoIAIgBSkDMDcDMCACIAUpAzg3AzggAiAFKQNANwNAIAIgBxAWIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAIAMsAEQEQCADQcAJEBULIAxB4AZqIgEgAykDADcDACABIAMpAwg3AwggASADKQMQNwMQIAEgAykDGDcDGCABIAMpAyA3AyAgASADKQMoNwMoIAEgAykDMDcDMCABIAMpAzg3AzggASADKQNANwNAIAIgASkDADcDACACIAEpAwg3AwggAiABKQMQNwMQIAIgASkDGDcDGCACIAEpAyA3AyAgAiABKQMoNwMoIAIgASkDMDcDMCACIAEpAzg3AzggAiABKQNANwNAIAIgBxAWIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAIAMsAEQEQCADQcAJEBULIAxBmAZqIgYgAykDADcDACAGIAMpAwg3AwggBiADKQMQNwMQIAYgAykDGDcDGCAGIAMpAyA3AyAgBiADKQMoNwMoIAYgAykDMDcDMCAGIAMpAzg3AzggBiADKQNANwNAIAAgBikCADcCACAAIAYpAgg3AgggACAGKQIQNwIQIAAgBikCGDcCGCAAIAYpAiA3AiAgACAGKQIoNwIoIAAgBikCMDcCMCAAIAYpAjg3AjggACAGKQJANwJAIAIgBykDADcDACACIAcpAwg3AwggAiAHKQMQNwMQIAIgBykDGDcDGCACIAcpAyA3AyAgAiAHKQMoNwMoIAIgBykDMDcDMCACIAcpAzg3AzggAiAHKQNANwNAIAIgABAWIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAIAMsAEQEQCADQcAJEBULIAUgAykDADcDACAFIAMpAwg3AwggBSADKQMQNwMQIAUgAykDGDcDGCAFIAMpAyA3AyAgBSADKQMoNwMoIAUgAykDMDcDMCAFIAMpAzg3AzggBSADKQNANwNAIAIgCCkDADcDACACIAgpAwg3AwggAiAIKQMQNwMQIAIgCCkDGDcDGCACIAgpAyA3AyAgAiAIKQMoNwMoIAIgCCkDMDcDMCACIAgpAzg3AzggAiAIKQNANwNAIAIgBRAXIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAIAMQGyABIAMpAwA3AwAgASADKQMINwMIIAEgAykDEDcDECABIAMpAxg3AxggASADKQMgNwMgIAEgAykDKDcDKCABIAMpAzA3AzAgASADKQM4NwM4IAEgAykDQDcDQCACIAopAwA3AwAgAiAKKQMINwMIIAIgCikDEDcDECACIAopAxg3AxggAiAKKQMgNwMgIAIgCikDKDcDKCACIAopAzA3AzAgAiAKKQM4NwM4IAIgCikDQDcDQCACIA8QFyADIAIpAwA3AwAgAyACKQMINwMIIAMgAikDEDcDECADIAIpAxg3AxggAyACKQMgNwMgIAMgAikDKDcDKCADIAIpAzA3AzAgAyACKQM4NwM4IAMgAikDQDcDQCADEBsgBCADKQMANwMAIAQgAykDCDcDCCAEIAMpAxA3AxAgBCADKQMYNwMYIAQgAykDIDcDICAEIAMpAyg3AyggBCADKQMwNwMwIAQgAykDODcDOCAEIAMpA0A3A0AgAiABKQMANwMAIAIgASkDCDcDCCACIAEpAxA3AxAgAiABKQMYNwMYIAIgASkDIDcDICACIAEpAyg3AyggAiABKQMwNwMwIAIgASkDODcDOCACIAEpA0A3A0AgAiAEEBYgAyACKQMANwMAIAMgAikDCDcDCCADIAIpAxA3AxAgAyACKQMYNwMYIAMgAikDIDcDICADIAIpAyg3AyggAyACKQMwNwMwIAMgAikDODcDOCADIAIpA0A3A0AgAywARARAIANBwAkQFQsgBiADKQMANwMAIAYgAykDCDcDCCAGIAMpAxA3AxAgBiADKQMYNwMYIAYgAykDIDcDICAGIAMpAyg3AyggBiADKQMwNwMwIAYgAykDODcDOCAGIAMpA0A3A0AgDSAGKQIANwIAIA0gBikCCDcCCCANIAYpAhA3AhAgDSAGKQIYNwIYIA0gBikCIDcCICANIAYpAig3AiggDSAGKQIwNwIwIA0gBikCODcCOCANIAYpAkA3AkAgAiAJKQIANwIAIAIgCSkCCDcCCCACIAkpAhA3AhAgAiAJKQIYNwIYIAIgCSkCIDcCICACIAkpAig3AiggAiAJKQIwNwIwIAIgCSkCODcCOCACIAkpAkA3AkAgAiAOEBcgAyACKQMANwMAIAMgAikDCDcDCCADIAIpAxA3AxAgAyACKQMYNwMYIAMgAikDIDcDICADIAIpAyg3AyggAyACKQMwNwMwIAMgAikDODcDOCADIAIpA0A3A0AgAxAbIAQgAykDADcDACAEIAMpAwg3AwggBCADKQMQNwMQIAQgAykDGDcDGCAEIAMpAyA3AyAgBCADKQMoNwMoIAQgAykDMDcDMCAEIAMpAzg3AzggBCADKQNANwNAIAIgBCkDADcDACACIAQpAwg3AwggAiAEKQMQNwMQIAIgBCkDGDcDGCACIAQpAyA3AyAgAiAEKQMoNwMoIAIgBCkDMDcDMCACIAQpAzg3AzggAiAEKQNANwNAIAIgCxAXIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAIAMQGyAFIAMpAwA3AwAgBSADKQMINwMIIAUgAykDEDcDECAFIAMpAxg3AxggBSADKQMgNwMgIAUgAykDKDcDKCAFIAMpAzA3AzAgBSADKQM4NwM4IAUgAykDQDcDQCAJIAUpAgA3AgAgCSAFKQIINwIIIAkgBSkCEDcCECAJIAUpAhg3AhggCSAFKQIgNwIgIAkgBSkCKDcCKCAJIAUpAjA3AjAgCSAFKQI4NwI4IAkgBSkCQDcCQCAMJAILC94KAQt/AkAjAiEJIwJBgAVqJAIgCUG4BGohAiAJQfADaiEDIAlBqANqIQQgCUHgAmohBSAJQZgCaiEIIAlB0AFqIQcgCUHAAGoiCiABQZABEDwaIAEoApABIQsgASgClAEhDCAJIgYgAUGYAWoiASkCADcCACAGIAEpAgg3AgggBiABKQIQNwIQIAYgASkCGDcCGCAGIAEpAiA3AiAgBiABKQIoNwIoIAYgASkCMDcCMCAGIAEpAjg3AjggC0EBRiAMRXEEQCAAQYgOQZQBEDwaIAkkAgUgAiALNgIAIAIgDDYCBCACQQhqIgEgBikDADcDACABIAYpAwg3AwggASAGKQMQNwMQIAEgBikDGDcDGCABIAYpAyA3AyAgASAGKQMoNwMoIAEgBikDMDcDMCABIAYpAzg3AzggByACEB0gAiAHKQMANwMAIAIgBykDCDcDCCACIAcpAxA3AxAgAiAHKQMYNwMYIAIgBykDIDcDICACIAcpAyg3AyggAiAHKQMwNwMwIAIgBykDODcDOCACIAcpA0A3A0AgAiAHEBcgAyACKQMANwMAIAMgAikDCDcDCCADIAIpAxA3AxAgAyACKQMYNwMYIAMgAikDIDcDICADIAIpAyg3AyggAyACKQMwNwMwIAMgAikDODcDOCADIAIpA0A3A0AgAxAbIAggAykDADcDACAIIAMpAwg3AwggCCADKQMQNwMQIAggAykDGDcDGCAIIAMpAyA3AyAgCCADKQMoNwMoIAggAykDMDcDMCAIIAMpAzg3AzggCCADKQNANwNAIAIgCikDADcDACACIAopAwg3AwggAiAKKQMQNwMQIAIgCikDGDcDGCACIAopAyA3AyAgAiAKKQMoNwMoIAIgCikDMDcDMCACIAopAzg3AzggAiAKKQNANwNAIAIgCBAXIAMgAikDADcDACADIAIpAwg3AwggAyACKQMQNwMQIAMgAikDGDcDGCADIAIpAyA3AyAgAyACKQMoNwMoIAMgAikDMDcDMCADIAIpAzg3AzggAyACKQNANwNAIAMQGyAFIAMpAwA3AwAgBSADKQMINwMIIAUgAykDEDcDECAFIAMpAxg3AxggBSADKQMgNwMgIAUgAykDKDcDKCAFIAMpAzA3AzAgBSADKQM4NwM4IAUgAykDQDcDQCACIApByABqIgEpAwA3AwAgAiABKQMINwMIIAIgASkDEDcDECACIAEpAxg3AxggAiABKQMgNwMgIAIgASkDKDcDKCACIAEpAzA3AzAgAiABKQM4NwM4IAIgASkDQDcDQCACIAgQFyADIAIpAwA3AwAgAyACKQMINwMIIAMgAikDEDcDECADIAIpAxg3AxggAyACKQMgNwMgIAMgAikDKDcDKCADIAIpAzA3AzAgAyACKQM4NwM4IAMgAikDQDcDQCADEBsgBCADKQMANwMAIAQgAykDCDcDCCAEIAMpAxA3AxAgBCADKQMYNwMYIAQgAykDIDcDICAEIAMpAyg3AyggBCADKQMwNwMwIAQgAykDODcDOCAEIAMpA0A3A0AgBCAHEBcgBBAbIAAgBSkCADcCACAAIAUpAgg3AgggACAFKQIQNwIQIAAgBSkCGDcCGCAAIAUpAiA3AiAgACAFKQIoNwIoIAAgBSkCMDcCMCAAIAUpAjg3AjggACAFKQJANwJAIABByABqIgEgBCkCADcCACABIAQpAgg3AgggASAEKQIQNwIQIAEgBCkCGDcCGCABIAQpAiA3AiAgASAEKQIoNwIoIAEgBCkCMDcCMCABIAQpAjg3AjggASAEKQJANwJAIABBADoAkAEgCSQCCwsLhC0BDX8CQCMCIQwjAkHQCWokAiAMQbgIaiEDIAxB4AZqIQIgACgCkAFBAUYEQCAAKAKUAUUEQCABLACQASEHIAMgAUGQARA8GiAHQQFxBEAgAkGICikDADcDACACQZAKKQMANwMIIAJBmAopAwA3AxAgAkGgCikDADcDGCACQagKKQMANwMgIAJBsAopAwA3AyggAkG4CikDADcDMCACQcAKKQMANwM4IAJByAopAwA3A0AgAkHIAGoiAUGICikDADcDACABQZAKKQMANwMIIAFBmAopAwA3AxAgAUGgCikDADcDGCABQagKKQMANwMgIAFBsAopAwA3AyggAUG4CikDADcDMCABQcAKKQMANwM4IAFByAopAwA3A0AgAkGQAWoiAUHYDCkCADcCACABQeAMKQIANwIIIAFB6AwpAgA3AhAgAUHwDCkCADcCGCABQfgMKQIANwIgIAFBgA0pAgA3AiggAUGIDSkCADcCMCABQZANKQIANwI4IAFBmA0pAgA3AkAFIAIgAykDADcDACACIAMpAwg3AwggAiADKQMQNwMQIAIgAykDGDcDGCACIAMpAyA3AyAgAiADKQMoNwMoIAIgAykDMDcDMCACIAMpAzg3AzggAiADKQNANwNAIAJByABqIgEgA0HIAGoiBykDADcDACABIAcpAwg3AwggASAHKQMQNwMQIAEgBykDGDcDGCABIAcpAyA3AyAgASAHKQMoNwMoIAEgBykDMDcDMCABIAcpAzg3AzggASAHKQNANwNAIAJBkAFqIgFBiAopAwA3AwAgAUGQCikDADcDCCABQZgKKQMANwMQIAFBoAopAwA3AxggAUGoCikDADcDICABQbAKKQMANwMoIAFBuAopAwA3AzAgAUHACikDADcDOCABQcgKKQMANwNACyAAIAJB2AEQPBogDCQCDwsLIAEsAJABBEAgDCQCDwsgAyAAQZABaiIKKQIANwIAIAMgCikCCDcCCCADIAopAhA3AhAgAyAKKQIYNwIYIAMgCikCIDcCICADIAopAig3AiggAyAKKQIwNwIwIAMgCikCODcCOCADIAopAkA3AkAgAyAKEBcgAiADKQMANwMAIAIgAykDCDcDCCACIAMpAxA3AxAgAiADKQMYNwMYIAIgAykDIDcDICACIAMpAyg3AyggAiADKQMwNwMwIAIgAykDODcDOCACIAMpA0A3A0AgAhAbIAwiByACKQMANwMAIAcgAikDCDcDCCAHIAIpAxA3AxAgByACKQMYNwMYIAcgAikDIDcDICAHIAIpAyg3AyggByACKQMwNwMwIAcgAikDODcDOCAHIAIpA0A3A0AgAyABKQIANwIAIAMgASkCCDcCCCADIAEpAhA3AhAgAyABKQIYNwIYIAMgASkCIDcCICADIAEpAig3AiggAyABKQIwNwIwIAMgASkCODcCOCADIAEpAkA3AkAgAyAHEBcgAiADKQMANwMAIAIgAykDCDcDCCACIAMpAxA3AxAgAiADKQMYNwMYIAIgAykDIDcDICACIAMpAyg3AyggAiADKQMwNwMwIAIgAykDODcDOCACIAMpA0A3A0AgAhAbIAxByABqIgQgAikDADcDACAEIAIpAwg3AwggBCACKQMQNwMQIAQgAikDGDcDGCAEIAIpAyA3AyAgBCACKQMoNwMoIAQgAikDMDcDMCAEIAIpAzg3AzggBCACKQNANwNAIAMgAUHIAGoiASkCADcCACADIAEpAgg3AgggAyABKQIQNwIQIAMgASkCGDcCGCADIAEpAiA3AiAgAyABKQIoNwIoIAMgASkCMDcCMCADIAEpAjg3AjggAyABKQJANwJAIAMgBxAXIAIgAykDADcDACACIAMpAwg3AwggAiADKQMQNwMQIAIgAykDGDcDGCACIAMpAyA3AyAgAiADKQMoNwMoIAIgAykDMDcDMCACIAMpAzg3AzggAiADKQNANwNAIAIQGyAMQZABaiIBIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABIAoQFyABEBsgAyAAKQIANwIAIAMgACkCCDcCCCADIAApAhA3AhAgAyAAKQIYNwIYIAMgACkCIDcCICADIAApAig3AiggAyAAKQIwNwIwIAMgACkCODcCOCADIAApAkA3AkAgAyAEEBYgAiADKQMANwMAIAIgAykDCDcDCCACIAMpAxA3AxAgAiADKQMYNwMYIAIgAykDIDcDICACIAMpAyg3AyggAiADKQMwNwMwIAIgAykDODcDOCACIAMpA0A3A0AgAiwARARAIAJBwAkQFQsgDEHYAWoiCSACKQMANwMAIAkgAikDCDcDCCAJIAIpAxA3AxAgCSACKQMYNwMYIAkgAikDIDcDICAJIAIpAyg3AyggCSACKQMwNwMwIAkgAikDODcDOCAJIAIpA0A3A0AgAyAAQcgAaiIEKQIANwIAIAMgBCkCCDcCCCADIAQpAhA3AhAgAyAEKQIYNwIYIAMgBCkCIDcCICADIAQpAig3AiggAyAEKQIwNwIwIAMgBCkCODcCOCADIAQpAkA3AkAgAyABEBYgAiADKQMANwMAIAIgAykDCDcDCCACIAMpAxA3AxAgAiADKQMYNwMYIAIgAykDIDcDICACIAMpAyg3AyggAiADKQMwNwMwIAIgAykDODcDOCACIAMpA0A3A0AgAiwARARAIAJBwAkQFQsgDEGgAmoiBSACKQMANwMAIAUgAikDCDcDCCAFIAIpAxA3AxAgBSACKQMYNwMYIAUgAikDIDcDICAFIAIpAyg3AyggBSACKQMwNwMwIAUgAikDODcDOCAFIAIpA0A3A0AgCSgCAEEBRgRAIAkoAgRFBEACQAJAIAUoAgBBAUcNACAFKAIEDQAgABAkDAELIABBiAopAgA3AgAgAEGQCikCADcCCCAAQZgKKQIANwIQIABBoAopAgA3AhggAEGoCikCADcCICAAQbAKKQIANwIoIABBuAopAgA3AjAgAEHACikCADcCOCAAQcgKKQIANwJAIARBiAopAgA3AgAgBEGQCikCADcCCCAEQZgKKQIANwIQIARBoAopAgA3AhggBEGoCikCADcCICAEQbAKKQIANwIoIARBuAopAgA3AjAgBEHACikCADcCOCAEQcgKKQIANwJAIApB2AwpAgA3AgAgCkHgDCkCADcCCCAKQegMKQIANwIQIApB8AwpAgA3AhggCkH4DCkCADcCICAKQYANKQIANwIoIApBiA0pAgA3AjAgCkGQDSkCADcCOCAKQZgNKQIANwJACyAMJAIPCwsgDEHQBWohBiADIAkpAwA3AwAgAyAJKQMINwMIIAMgCSkDEDcDECADIAkpAxg3AxggAyAJKQMgNwMgIAMgCSkDKDcDKCADIAkpAzA3AzAgAyAJKQM4NwM4IAMgCSkDQDcDQCADIAkQFyACIAMpAwA3AwAgAiADKQMINwMIIAIgAykDEDcDECACIAMpAxg3AxggAiADKQMgNwMgIAIgAykDKDcDKCACIAMpAzA3AzAgAiADKQM4NwM4IAIgAykDQDcDQCACEBsgDEHoAmoiASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgAyAAKQIANwIAIAMgACkCCDcCCCADIAApAhA3AhAgAyAAKQIYNwIYIAMgACkCIDcCICADIAApAig3AiggAyAAKQIwNwIwIAMgACkCODcCOCADIAApAkA3AkAgAyABEBcgAiADKQMANwMAIAIgAykDCDcDCCACIAMpAxA3AxAgAiADKQMYNwMYIAIgAykDIDcDICACIAMpAyg3AyggAiADKQMwNwMwIAIgAykDODcDOCACIAMpA0A3A0AgAhAbIAxBsANqIgsgAikDADcDACALIAIpAwg3AwggCyACKQMQNwMQIAsgAikDGDcDGCALIAIpAyA3AyAgCyACKQMoNwMoIAsgAikDMDcDMCALIAIpAzg3AzggCyACKQNANwNAIAMgASkDADcDACADIAEpAwg3AwggAyABKQMQNwMQIAMgASkDGDcDGCADIAEpAyA3AyAgAyABKQMoNwMoIAMgASkDMDcDMCADIAEpAzg3AzggAyABKQNANwNAIAMgCRAXIAIgAykDADcDACACIAMpAwg3AwggAiADKQMQNwMQIAIgAykDGDcDGCACIAMpAyA3AyAgAiADKQMoNwMoIAIgAykDMDcDMCACIAMpAzg3AzggAiADKQNANwNAIAIQGyAMQfgDaiINIAIpAwA3AwAgDSACKQMINwMIIA0gAikDEDcDECANIAIpAxg3AxggDSACKQMgNwMgIA0gAikDKDcDKCANIAIpAzA3AzAgDSACKQM4NwM4IA0gAikDQDcDQCADIAUpAwA3AwAgAyAFKQMINwMIIAMgBSkDEDcDECADIAUpAxg3AxggAyAFKQMgNwMgIAMgBSkDKDcDKCADIAUpAzA3AzAgAyAFKQM4NwM4IAMgBSkDQDcDQCADIAUQFyACIAMpAwA3AwAgAiADKQMINwMIIAIgAykDEDcDECACIAMpAxg3AxggAiADKQMgNwMgIAIgAykDKDcDKCACIAMpAzA3AzAgAiADKQM4NwM4IAIgAykDQDcDQCACEBsgDEGYBmoiCCACKQMANwMAIAggAikDCDcDCCAIIAIpAxA3AxAgCCACKQMYNwMYIAggAikDIDcDICAIIAIpAyg3AyggCCACKQMwNwMwIAggAikDODcDOCAIIAIpA0A3A0AgAyAIKQMANwMAIAMgCCkDCDcDCCADIAgpAxA3AxAgAyAIKQMYNwMYIAMgCCkDIDcDICADIAgpAyg3AyggAyAIKQMwNwMwIAMgCCkDODcDOCADIAgpA0A3A0AgAyANEBUgAiADKQMANwMAIAIgAykDCDcDCCACIAMpAxA3AxAgAiADKQMYNwMYIAIgAykDIDcDICACIAMpAyg3AyggAiADKQMwNwMwIAIgAykDODcDOCACIAMpA0A3A0ACQAJAIAIoAgAiAUEIRgRAQQghBwJAAkACQANAIAdBf2ohASAHRQ0FIAFBEE8NASACQQRqIAFBAnRqKAIAIgcgAUECdEHECWooAgAiDkcNAiABIQcMAAsAC0G8CyABQRAQKAwBCyAHIA5PDQILBSABQQhPDQELDAELIAJBwAkQFgsgBiACKQMANwMAIAYgAikDCDcDCCAGIAIpAxA3AxAgBiACKQMYNwMYIAYgAikDIDcDICAGIAIpAyg3AyggBiACKQMwNwMwIAYgAikDODcDOCAGIAIpA0A3A0AgAyAGKQMANwMAIAMgBikDCDcDCCADIAYpAxA3AxAgAyAGKQMYNwMYIAMgBikDIDcDICADIAYpAyg3AyggAyAGKQMwNwMwIAMgBikDODcDOCADIAYpA0A3A0AgAyALEBYgAiADKQMANwMAIAIgAykDCDcDCCACIAMpAxA3AxAgAiADKQMYNwMYIAIgAykDIDcDICACIAMpAyg3AyggAiADKQMwNwMwIAIgAykDODcDOCACIAMpA0A3A0AgAiALEBYgAkHEAGoiASwAAARAA0AgAkHACRAVIAEsAAANAAsLIAxBiAVqIgEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAIAAgASkCADcCACAAIAEpAgg3AgggACABKQIQNwIQIAAgASkCGDcCGCAAIAEpAiA3AiAgACABKQIoNwIoIAAgASkCMDcCMCAAIAEpAjg3AjggACABKQJANwJAIAMgCykDADcDACADIAspAwg3AwggAyALKQMQNwMQIAMgCykDGDcDGCADIAspAyA3AyAgAyALKQMoNwMoIAMgCykDMDcDMCADIAspAzg3AzggAyALKQNANwNAIAMgABAWIAIgAykDADcDACACIAMpAwg3AwggAiADKQMQNwMQIAIgAykDGDcDGCACIAMpAyA3AyAgAiADKQMoNwMoIAIgAykDMDcDMCACIAMpAzg3AzggAiADKQNANwNAIAIsAEQEQCACQcAJEBULIAYgAikDADcDACAGIAIpAwg3AwggBiACKQMQNwMQIAYgAikDGDcDGCAGIAIpAyA3AyAgBiACKQMoNwMoIAYgAikDMDcDMCAGIAIpAzg3AzggBiACKQNANwNAIAMgBSkDADcDACADIAUpAwg3AwggAyAFKQMQNwMQIAMgBSkDGDcDGCADIAUpAyA3AyAgAyAFKQMoNwMoIAMgBSkDMDcDMCADIAUpAzg3AzggAyAFKQNANwNAIAMgBhAXIAIgAykDADcDACACIAMpAwg3AwggAiADKQMQNwMQIAIgAykDGDcDGCACIAMpAyA3AyAgAiADKQMoNwMoIAIgAykDMDcDMCACIAMpAzg3AzggAiADKQNANwNAIAIQGyABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCADIAQpAgA3AgAgAyAEKQIINwIIIAMgBCkCEDcCECADIAQpAhg3AhggAyAEKQIgNwIgIAMgBCkCKDcCKCADIAQpAjA3AjAgAyAEKQI4NwI4IAMgBCkCQDcCQCADIA0QFyACIAMpAwA3AwAgAiADKQMINwMIIAIgAykDEDcDECACIAMpAxg3AxggAiADKQMgNwMgIAIgAykDKDcDKCACIAMpAzA3AzAgAiADKQM4NwM4IAIgAykDQDcDQCACEBsgCCACKQMANwMAIAggAikDCDcDCCAIIAIpAxA3AxAgCCACKQMYNwMYIAggAikDIDcDICAIIAIpAyg3AyggCCACKQMwNwMwIAggAikDODcDOCAIIAIpA0A3A0AgAyABKQMANwMAIAMgASkDCDcDCCADIAEpAxA3AxAgAyABKQMYNwMYIAMgASkDIDcDICADIAEpAyg3AyggAyABKQMwNwMwIAMgASkDODcDOCADIAEpA0A3A0AgAyAIEBYgAiADKQMANwMAIAIgAykDCDcDCCACIAMpAxA3AxAgAiADKQMYNwMYIAIgAykDIDcDICACIAMpAyg3AyggAiADKQMwNwMwIAIgAykDODcDOCACIAMpA0A3A0AgAiwARARAIAJBwAkQFQsgDEHABGoiACACKQMANwMAIAAgAikDCDcDCCAAIAIpAxA3AxAgACACKQMYNwMYIAAgAikDIDcDICAAIAIpAyg3AyggACACKQMwNwMwIAAgAikDODcDOCAAIAIpA0A3A0AgBCAAKQIANwIAIAQgACkCCDcCCCAEIAApAhA3AhAgBCAAKQIYNwIYIAQgACkCIDcCICAEIAApAig3AiggBCAAKQIwNwIwIAQgACkCODcCOCAEIAApAkA3AkAgCiAJEBcgChAbIAwkAgsLklcBE38CQCMCIREjAkHwB2okAiAAKAKQAUEBRiIIBEAgACgClAFFBEAgESQCDwsLIBFBqAdqIQIgEUHgBmohASARQZgGaiEDIBFB0AVqIQUgEUGIBWohBiARQcAEaiEOIBFB+ANqIQcgEUGwA2ohCyARQegCaiENIBFBoAJqIQQgEUHYAWohCSARQZABaiEKIBFByABqIRAgESEPIABBkAFqIRICfwJAIAhFDQAgACgClAFBAUcNACACIAApAgA3AgAgAiAAKQIINwIIIAIgACkCEDcCECACIAApAhg3AhggAiAAKQIgNwIgIAIgACkCKDcCKCACIAApAjA3AjAgAiAAKQI4NwI4IAIgACkCQDcCQCACIAAQFyABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABEBsgCSABKQMANwMAIAkgASkDCDcDCCAJIAEpAxA3AxAgCSABKQMYNwMYIAkgASkDIDcDICAJIAEpAyg3AyggCSABKQMwNwMwIAkgASkDODcDOCAJIAEpA0A3A0AgAiAAQcgAaiIMKQIANwIAIAIgDCkCCDcCCCACIAwpAhA3AhAgAiAMKQIYNwIYIAIgDCkCIDcCICACIAwpAig3AiggAiAMKQIwNwIwIAIgDCkCODcCOCACIAwpAkA3AkAgAiAMEBcgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgARAbIAQgASkDADcDACAEIAEpAwg3AwggBCABKQMQNwMQIAQgASkDGDcDGCAEIAEpAyA3AyAgBCABKQMoNwMoIAQgASkDMDcDMCAEIAEpAzg3AzggBCABKQNANwNAIAIgBCkDADcDACACIAQpAwg3AwggAiAEKQMQNwMQIAIgBCkDGDcDGCACIAQpAyA3AyAgAiAEKQMoNwMoIAIgBCkDMDcDMCACIAQpAzg3AzggAiAEKQNANwNAIAIgBBAXIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAIAEQGyANIAEpAwA3AwAgDSABKQMINwMIIA0gASkDEDcDECANIAEpAxg3AxggDSABKQMgNwMgIA0gASkDKDcDKCANIAEpAzA3AzAgDSABKQM4NwM4IA0gASkDQDcDQCACIAApAgA3AgAgAiAAKQIINwIIIAIgACkCEDcCECACIAApAhg3AhggAiAAKQIgNwIgIAIgACkCKDcCKCACIAApAjA3AjAgAiAAKQI4NwI4IAIgACkCQDcCQCACIAQQFSABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQAJAAkAgASgCACIEQQhGBEBBCCEIAkACQAJAA0AgCEF/aiEEIAhFDQUgBEEQTw0BIAFBBGogBEECdGooAgAiCCAEQQJ0QcQJaigCACITRw0CIAQhCAwACwALQbwLIARBEBAoDAELIAggE08NAgsFIARBCE8NAQsMAQsgAUHACRAWCyADIAEpAwA3AwAgAyABKQMINwMIIAMgASkDEDcDECADIAEpAxg3AxggAyABKQMgNwMgIAMgASkDKDcDKCADIAEpAzA3AzAgAyABKQM4NwM4IAMgASkDQDcDQCACIAMpAwA3AwAgAiADKQMINwMIIAIgAykDEDcDECACIAMpAxg3AxggAiADKQMgNwMgIAIgAykDKDcDKCACIAMpAzA3AzAgAiADKQM4NwM4IAIgAykDQDcDQCACIAMQFyABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABEBsgBSABKQMANwMAIAUgASkDCDcDCCAFIAEpAxA3AxAgBSABKQMYNwMYIAUgASkDIDcDICAFIAEpAyg3AyggBSABKQMwNwMwIAUgASkDODcDOCAFIAEpA0A3A0AgAiAFKQMANwMAIAIgBSkDCDcDCCACIAUpAxA3AxAgAiAFKQMYNwMYIAIgBSkDIDcDICACIAUpAyg3AyggAiAFKQMwNwMwIAIgBSkDODcDOCACIAUpA0A3A0AgAiAJEBYgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgASwARARAIAFBwAkQFQsgBiABKQMANwMAIAYgASkDCDcDCCAGIAEpAxA3AxAgBiABKQMYNwMYIAYgASkDIDcDICAGIAEpAyg3AyggBiABKQMwNwMwIAYgASkDODcDOCAGIAEpA0A3A0AgAiAGKQMANwMAIAIgBikDCDcDCCACIAYpAxA3AxAgAiAGKQMYNwMYIAIgBikDIDcDICACIAYpAyg3AyggAiAGKQMwNwMwIAIgBikDODcDOCACIAYpA0A3A0AgAiANEBYgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgASwARARAIAFBwAkQFQsgCyABKQMANwMAIAsgASkDCDcDCCALIAEpAxA3AxAgCyABKQMYNwMYIAsgASkDIDcDICALIAEpAyg3AyggCyABKQMwNwMwIAsgASkDODcDOCALIAEpA0A3A0AgCxAaIAIgCSkDADcDACACIAkpAwg3AwggAiAJKQMQNwMQIAIgCSkDGDcDGCACIAkpAyA3AyAgAiAJKQMoNwMoIAIgCSkDMDcDMCACIAkpAzg3AzggAiAJKQNANwNAIAIgCRAVIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAAkACQCABKAIAIgRBCEYEQEEIIQgCQAJAAkADQCAIQX9qIQQgCEUNBSAEQRBPDQEgAUEEaiAEQQJ0aigCACIIIARBAnRBxAlqKAIAIhNHDQIgBCEIDAALAAtBvAsgBEEQECgMAQsgCCATTw0CCwUgBEEITw0BCwwBCyABQcAJEBYLIAMgASkDADcDACADIAEpAwg3AwggAyABKQMQNwMQIAMgASkDGDcDGCADIAEpAyA3AyAgAyABKQMoNwMoIAMgASkDMDcDMCADIAEpAzg3AzggAyABKQNANwNAIAIgAykDADcDACACIAMpAwg3AwggAiADKQMQNwMQIAIgAykDGDcDGCACIAMpAyA3AyAgAiADKQMoNwMoIAIgAykDMDcDMCACIAMpAzg3AzggAiADKQNANwNAIAIgCRAVIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAAkACQCABKAIAIgRBCEYEQEEIIQgCQAJAAkADQCAIQX9qIQQgCEUNBSAEQRBPDQEgAUEEaiAEQQJ0aigCACIIIARBAnRBxAlqKAIAIglHDQIgBCEIDAALAAtBvAsgBEEQECgMAQsgCCAJTw0CCwUgBEEITw0BCwwBCyABQcAJEBYLIAcgASkDADcDACAHIAEpAwg3AwggByABKQMQNwMQIAcgASkDGDcDGCAHIAEpAyA3AyAgByABKQMoNwMoIAcgASkDMDcDMCAHIAEpAzg3AzggByABKQNANwNAIAIgBykDADcDACACIAcpAwg3AwggAiAHKQMQNwMQIAIgBykDGDcDGCACIAcpAyA3AyAgAiAHKQMoNwMoIAIgBykDMDcDMCACIAcpAzg3AzggAiAHKQNANwNAIAIgBxAXIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAIAEQGyADIAEpAwA3AwAgAyABKQMINwMIIAMgASkDEDcDECADIAEpAxg3AxggAyABKQMgNwMgIAMgASkDKDcDKCADIAEpAzA3AzAgAyABKQM4NwM4IAMgASkDQDcDQCACIAMpAwA3AwAgAiADKQMINwMIIAIgAykDEDcDECACIAMpAxg3AxggAiADKQMgNwMgIAIgAykDKDcDKCACIAMpAzA3AzAgAiADKQM4NwM4IAIgAykDQDcDQCACIAsQFiABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABLABEBEAgAUHACRAVCyAFIAEpAwA3AwAgBSABKQMINwMIIAUgASkDEDcDECAFIAEpAxg3AxggBSABKQMgNwMgIAUgASkDKDcDKCAFIAEpAzA3AzAgBSABKQM4NwM4IAUgASkDQDcDQCACIAUpAwA3AwAgAiAFKQMINwMIIAIgBSkDEDcDECACIAUpAxg3AxggAiAFKQMgNwMgIAIgBSkDKDcDKCACIAUpAzA3AzAgAiAFKQM4NwM4IAIgBSkDQDcDQCACIAsQFiABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABLABEBEAgAUHACRAVCyAOIAEpAwA3AwAgDiABKQMINwMIIA4gASkDEDcDECAOIAEpAxg3AxggDiABKQMgNwMgIA4gASkDKDcDKCAOIAEpAzA3AzAgDiABKQM4NwM4IA4gASkDQDcDQCAGIA0pAwA3AwAgBiANKQMINwMIIAYgDSkDEDcDECAGIA0pAxg3AxggBiANKQMgNwMgIAYgDSkDKDcDKCAGIA0pAzA3AzAgBiANKQM4NwM4IAYgDSkDQDcDQCAGEBogBhAaIAYQGiAPIA4pAwA3AwAgDyAOKQMINwMIIA8gDikDEDcDECAPIA4pAxg3AxggDyAOKQMgNwMgIA8gDikDKDcDKCAPIA4pAzA3AzAgDyAOKQM4NwM4IA8gDikDQDcDQCACIAspAwA3AwAgAiALKQMINwMIIAIgCykDEDcDECACIAspAxg3AxggAiALKQMgNwMgIAIgCykDKDcDKCACIAspAzA3AzAgAiALKQM4NwM4IAIgCykDQDcDQCACIA4QFiABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABLABEBEAgAUHACRAVCyADIAEpAwA3AwAgAyABKQMINwMIIAMgASkDEDcDECADIAEpAxg3AxggAyABKQMgNwMgIAMgASkDKDcDKCADIAEpAzA3AzAgAyABKQM4NwM4IAMgASkDQDcDQCACIAcpAwA3AwAgAiAHKQMINwMIIAIgBykDEDcDECACIAcpAxg3AxggAiAHKQMgNwMgIAIgBykDKDcDKCACIAcpAzA3AzAgAiAHKQM4NwM4IAIgBykDQDcDQCACIAMQFyABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABEBsgBSABKQMANwMAIAUgASkDCDcDCCAFIAEpAxA3AxAgBSABKQMYNwMYIAUgASkDIDcDICAFIAEpAyg3AyggBSABKQMwNwMwIAUgASkDODcDOCAFIAEpA0A3A0AgAiAFKQMANwMAIAIgBSkDCDcDCCACIAUpAxA3AxAgAiAFKQMYNwMYIAIgBSkDIDcDICACIAUpAyg3AyggAiAFKQMwNwMwIAIgBSkDODcDOCACIAUpA0A3A0AgAiAGEBYgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgASwARARAIAFBwAkQFQsgECABKQMANwMAIBAgASkDCDcDCCAQIAEpAxA3AxAgECABKQMYNwMYIBAgASkDIDcDICAQIAEpAyg3AyggECABKQMwNwMwIBAgASkDODcDOCAQIAEpA0A3A0AgAiAMKQIANwIAIAIgDCkCCDcCCCACIAwpAhA3AhAgAiAMKQIYNwIYIAIgDCkCIDcCICACIAwpAig3AiggAiAMKQIwNwIwIAIgDCkCODcCOCACIAwpAkA3AkAgAiAMEBUgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0ACQAJAIAEoAgAiBEEIRgRAQQghCAJAAkACQANAIAhBf2ohBCAIRQ0FIARBEE8NASABQQRqIARBAnRqKAIAIgggBEECdEHECWooAgAiAkcNAiAEIQgMAAsAC0G8CyAEQRAQKAwBCyAIIAJPDQILBSAEQQhPDQELDAELIAFBwAkQFgsgCiABKQMANwMAIAogASkDCDcDCCAKIAEpAxA3AxAgCiABKQMYNwMYIAogASkDIDcDICAKIAEpAyg3AyggCiABKQMwNwMwIAogASkDODcDOCAKIAEpA0A3A0AgDAwBCyACIAApAgA3AgAgAiAAKQIINwIIIAIgACkCEDcCECACIAApAhg3AhggAiAAKQIgNwIgIAIgACkCKDcCKCACIAApAjA3AjAgAiAAKQI4NwI4IAIgACkCQDcCQCACIAAQFyABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABEBsgCSABKQMANwMAIAkgASkDCDcDCCAJIAEpAxA3AxAgCSABKQMYNwMYIAkgASkDIDcDICAJIAEpAyg3AyggCSABKQMwNwMwIAkgASkDODcDOCAJIAEpA0A3A0AgAiAAQcgAaiIMKQIANwIAIAIgDCkCCDcCCCACIAwpAhA3AhAgAiAMKQIYNwIYIAIgDCkCIDcCICACIAwpAig3AiggAiAMKQIwNwIwIAIgDCkCODcCOCACIAwpAkA3AkAgAiAMEBcgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgARAbIAQgASkDADcDACAEIAEpAwg3AwggBCABKQMQNwMQIAQgASkDGDcDGCAEIAEpAyA3AyAgBCABKQMoNwMoIAQgASkDMDcDMCAEIAEpAzg3AzggBCABKQNANwNAIAIgBCkDADcDACACIAQpAwg3AwggAiAEKQMQNwMQIAIgBCkDGDcDGCACIAQpAyA3AyAgAiAEKQMoNwMoIAIgBCkDMDcDMCACIAQpAzg3AzggAiAEKQNANwNAIAIgBBAXIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAIAEQGyANIAEpAwA3AwAgDSABKQMINwMIIA0gASkDEDcDECANIAEpAxg3AxggDSABKQMgNwMgIA0gASkDKDcDKCANIAEpAzA3AzAgDSABKQM4NwM4IA0gASkDQDcDQCACIAApAgA3AgAgAiAAKQIINwIIIAIgACkCEDcCECACIAApAhg3AhggAiAAKQIgNwIgIAIgACkCKDcCKCACIAApAjA3AjAgAiAAKQI4NwI4IAIgACkCQDcCQCACIAQQFSABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQAJAAkAgASgCACIEQQhGBEBBCCEIAkACQAJAA0AgCEF/aiEEIAhFDQUgBEEQTw0BIAFBBGogBEECdGooAgAiCCAEQQJ0QcQJaigCACITRw0CIAQhCAwACwALQbwLIARBEBAoDAELIAggE08NAgsFIARBCE8NAQsMAQsgAUHACRAWCyADIAEpAwA3AwAgAyABKQMINwMIIAMgASkDEDcDECADIAEpAxg3AxggAyABKQMgNwMgIAMgASkDKDcDKCADIAEpAzA3AzAgAyABKQM4NwM4IAMgASkDQDcDQCACIAMpAwA3AwAgAiADKQMINwMIIAIgAykDEDcDECACIAMpAxg3AxggAiADKQMgNwMgIAIgAykDKDcDKCACIAMpAzA3AzAgAiADKQM4NwM4IAIgAykDQDcDQCACIAMQFyABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABEBsgBSABKQMANwMAIAUgASkDCDcDCCAFIAEpAxA3AxAgBSABKQMYNwMYIAUgASkDIDcDICAFIAEpAyg3AyggBSABKQMwNwMwIAUgASkDODcDOCAFIAEpA0A3A0AgAiAFKQMANwMAIAIgBSkDCDcDCCACIAUpAxA3AxAgAiAFKQMYNwMYIAIgBSkDIDcDICACIAUpAyg3AyggAiAFKQMwNwMwIAIgBSkDODcDOCACIAUpA0A3A0AgAiAJEBYgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgASwARARAIAFBwAkQFQsgBiABKQMANwMAIAYgASkDCDcDCCAGIAEpAxA3AxAgBiABKQMYNwMYIAYgASkDIDcDICAGIAEpAyg3AyggBiABKQMwNwMwIAYgASkDODcDOCAGIAEpA0A3A0AgAiAGKQMANwMAIAIgBikDCDcDCCACIAYpAxA3AxAgAiAGKQMYNwMYIAIgBikDIDcDICACIAYpAyg3AyggAiAGKQMwNwMwIAIgBikDODcDOCACIAYpA0A3A0AgAiANEBYgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgASwARARAIAFBwAkQFQsgCyABKQMANwMAIAsgASkDCDcDCCALIAEpAxA3AxAgCyABKQMYNwMYIAsgASkDIDcDICALIAEpAyg3AyggCyABKQMwNwMwIAsgASkDODcDOCALIAEpA0A3A0AgCxAaIAIgCSkDADcDACACIAkpAwg3AwggAiAJKQMQNwMQIAIgCSkDGDcDGCACIAkpAyA3AyAgAiAJKQMoNwMoIAIgCSkDMDcDMCACIAkpAzg3AzggAiAJKQNANwNAIAIgCRAVIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAAkACQCABKAIAIgRBCEYEQEEIIQgCQAJAAkADQCAIQX9qIQQgCEUNBSAEQRBPDQEgAUEEaiAEQQJ0aigCACIIIARBAnRBxAlqKAIAIhNHDQIgBCEIDAALAAtBvAsgBEEQECgMAQsgCCATTw0CCwUgBEEITw0BCwwBCyABQcAJEBYLIAMgASkDADcDACADIAEpAwg3AwggAyABKQMQNwMQIAMgASkDGDcDGCADIAEpAyA3AyAgAyABKQMoNwMoIAMgASkDMDcDMCADIAEpAzg3AzggAyABKQNANwNAIAIgAykDADcDACACIAMpAwg3AwggAiADKQMQNwMQIAIgAykDGDcDGCACIAMpAyA3AyAgAiADKQMoNwMoIAIgAykDMDcDMCACIAMpAzg3AzggAiADKQNANwNAIAIgCRAVIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAAkACQCABKAIAIgRBCEYEQEEIIQgCQAJAAkADQCAIQX9qIQQgCEUNBSAEQRBPDQEgAUEEaiAEQQJ0aigCACIIIARBAnRBxAlqKAIAIglHDQIgBCEIDAALAAtBvAsgBEEQECgMAQsgCCAJTw0CCwUgBEEITw0BCwwBCyABQcAJEBYLIAcgASkDADcDACAHIAEpAwg3AwggByABKQMQNwMQIAcgASkDGDcDGCAHIAEpAyA3AyAgByABKQMoNwMoIAcgASkDMDcDMCAHIAEpAzg3AzggByABKQNANwNAIAIgBykDADcDACACIAcpAwg3AwggAiAHKQMQNwMQIAIgBykDGDcDGCACIAcpAyA3AyAgAiAHKQMoNwMoIAIgBykDMDcDMCACIAcpAzg3AzggAiAHKQNANwNAIAIgBxAXIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAIAEQGyAOIAEpAwA3AwAgDiABKQMINwMIIA4gASkDEDcDECAOIAEpAxg3AxggDiABKQMgNwMgIA4gASkDKDcDKCAOIAEpAzA3AzAgDiABKQM4NwM4IA4gASkDQDcDQCAGIA0pAwA3AwAgBiANKQMINwMIIAYgDSkDEDcDECAGIA0pAxg3AxggBiANKQMgNwMgIAYgDSkDKDcDKCAGIA0pAzA3AzAgBiANKQM4NwM4IAYgDSkDQDcDQCAGEBogBhAaIAYQGiACIA4pAwA3AwAgAiAOKQMINwMIIAIgDikDEDcDECACIA4pAxg3AxggAiAOKQMgNwMgIAIgDikDKDcDKCACIA4pAzA3AzAgAiAOKQM4NwM4IAIgDikDQDcDQCACIAsQFiABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABLABEBEAgAUHACRAVCyADIAEpAwA3AwAgAyABKQMINwMIIAMgASkDEDcDECADIAEpAxg3AxggAyABKQMgNwMgIAMgASkDKDcDKCADIAEpAzA3AzAgAyABKQM4NwM4IAMgASkDQDcDQCACIAMpAwA3AwAgAiADKQMINwMIIAIgAykDEDcDECACIAMpAxg3AxggAiADKQMgNwMgIAIgAykDKDcDKCACIAMpAzA3AzAgAiADKQM4NwM4IAIgAykDQDcDQCACIAsQFiABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABLABEBEAgAUHACRAVCyAPIAEpAwA3AwAgDyABKQMINwMIIA8gASkDEDcDECAPIAEpAxg3AxggDyABKQMgNwMgIA8gASkDKDcDKCAPIAEpAzA3AzAgDyABKQM4NwM4IA8gASkDQDcDQCACIAspAwA3AwAgAiALKQMINwMIIAIgCykDEDcDECACIAspAxg3AxggAiALKQMgNwMgIAIgCykDKDcDKCACIAspAzA3AzAgAiALKQM4NwM4IAIgCykDQDcDQCACIA8QFiABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABLABEBEAgAUHACRAVCyADIAEpAwA3AwAgAyABKQMINwMIIAMgASkDEDcDECADIAEpAxg3AxggAyABKQMgNwMgIAMgASkDKDcDKCADIAEpAzA3AzAgAyABKQM4NwM4IAMgASkDQDcDQCACIAcpAwA3AwAgAiAHKQMINwMIIAIgBykDEDcDECACIAcpAxg3AxggAiAHKQMgNwMgIAIgBykDKDcDKCACIAcpAzA3AzAgAiAHKQM4NwM4IAIgBykDQDcDQCACIAMQFyABIAIpAwA3AwAgASACKQMINwMIIAEgAikDEDcDECABIAIpAxg3AxggASACKQMgNwMgIAEgAikDKDcDKCABIAIpAzA3AzAgASACKQM4NwM4IAEgAikDQDcDQCABEBsgBSABKQMANwMAIAUgASkDCDcDCCAFIAEpAxA3AxAgBSABKQMYNwMYIAUgASkDIDcDICAFIAEpAyg3AyggBSABKQMwNwMwIAUgASkDODcDOCAFIAEpA0A3A0AgAiAFKQMANwMAIAIgBSkDCDcDCCACIAUpAxA3AxAgAiAFKQMYNwMYIAIgBSkDIDcDICACIAUpAyg3AyggAiAFKQMwNwMwIAIgBSkDODcDOCACIAUpA0A3A0AgAiAGEBYgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgASwARARAIAFBwAkQFQsgECABKQMANwMAIBAgASkDCDcDCCAQIAEpAxA3AxAgECABKQMYNwMYIBAgASkDIDcDICAQIAEpAyg3AyggECABKQMwNwMwIBAgASkDODcDOCAQIAEpA0A3A0AgAiAMKQIANwIAIAIgDCkCCDcCCCACIAwpAhA3AhAgAiAMKQIYNwIYIAIgDCkCIDcCICACIAwpAig3AiggAiAMKQIwNwIwIAIgDCkCODcCOCACIAwpAkA3AkAgAiASEBcgASACKQMANwMAIAEgAikDCDcDCCABIAIpAxA3AxAgASACKQMYNwMYIAEgAikDIDcDICABIAIpAyg3AyggASACKQMwNwMwIAEgAikDODcDOCABIAIpA0A3A0AgARAbIAogASkDADcDACAKIAEpAwg3AwggCiABKQMQNwMQIAogASkDGDcDGCAKIAEpAyA3AyAgCiABKQMoNwMoIAogASkDMDcDMCAKIAEpAzg3AzggCiABKQNANwNAIAIgCikDADcDACACIAopAwg3AwggAiAKKQMQNwMQIAIgCikDGDcDGCACIAopAyA3AyAgAiAKKQMoNwMoIAIgCikDMDcDMCACIAopAzg3AzggAiAKKQNANwNAIAIgChAVIAEgAikDADcDACABIAIpAwg3AwggASACKQMQNwMQIAEgAikDGDcDGCABIAIpAyA3AyAgASACKQMoNwMoIAEgAikDMDcDMCABIAIpAzg3AzggASACKQNANwNAAkACQCABKAIAIgRBCEYEQEEIIQgCQAJAAkADQCAIQX9qIQQgCEUNBSAEQRBPDQEgAUEEaiAEQQJ0aigCACIIIARBAnRBxAlqKAIAIgJHDQIgBCEIDAALAAtBvAsgBEEQECgMAQsgCCACTw0CCwUgBEEITw0BCwwBCyABQcAJEBYLIAogASkDADcDACAKIAEpAwg3AwggCiABKQMQNwMQIAogASkDGDcDGCAKIAEpAyA3AyAgCiABKQMoNwMoIAogASkDMDcDMCAKIAEpAzg3AzggCiABKQNANwNAIAwLIQQgACAPKQIANwIAIAAgDykCCDcCCCAAIA8pAhA3AhAgACAPKQIYNwIYIAAgDykCIDcCICAAIA8pAig3AiggACAPKQIwNwIwIAAgDykCODcCOCAAIA8pAkA3AkAgBCAQKQIANwIAIAQgECkCCDcCCCAEIBApAhA3AhAgBCAQKQIYNwIYIAQgECkCIDcCICAEIBApAig3AiggBCAQKQIwNwIwIAQgECkCODcCOCAEIBApAkA3AkAgEiAKKQIANwIAIBIgCikCCDcCCCASIAopAhA3AhAgEiAKKQIYNwIYIBIgCikCIDcCICASIAopAig3AiggEiAKKQIwNwIwIBIgCikCODcCOCASIAopAkA3AkAgESQCCwukBAEQfwJ/IwIhAyMCQZABaiQCIAFBIEcEQCADJAJBAA8LIAAoAhwQOyEBIAAoAhgiAhA7IQQgACgCFCIFEDshByAAKAIQIggQOyEJIAAoAgwiChA7IQsgACgCCCIMEDshDSAAKAIEIg4QOyEPIAAoAgAiEBA7IREgA0HIAGoiAEEAOgBEIABBCDYCACAAIAE2AgQgACAENgIIIAAgBzYCDCAAIAk2AhAgACALNgIUIAAgDTYCGCAAIA82AhwgACARNgIgIABBJGoiAUIANwIAIAFCADcCCCABQgA3AhAgAUIANwIYIAAgEAR/QQgFIA4Ef0EHBSAMBH9BBgUgCgR/QQUFIAgEf0EEBSAFBH9BAwUgAgR/QQIFQQELCwsLCwsLIgE2AgAgAyICIAApAwA3AwAgAiAAKQMINwMIIAIgACkDEDcDECACIAApAxg3AxggAiAAKQMgNwMgIAIgACkDKDcDKCACIAApAzA3AzAgAiAAKQM4NwM4IAIgACkDQDcDQAJAAkACQCACKAIAIgRBCEYEQEEIIQECQAJAAkADQCABQX9qIQAgAUUNBiAAQRBPDQEgAkEEaiAAQQJ0aigCACIBIABBAnRB7ApqKAIAIgVHDQIgACEBDAALAAtBvAsgAEEQECgMAQsgASAFSQ0CDAMLBSAEQQhJDQEMAgsMAgsgBEEBRyACKAIEQQBHckUNAEEBIQYMAQtBACEGCyADJAIgBgsLvQYBD38CQCMCIQgjAkHgAWokAiADQSBJBEBBICADECcLIAghBSACKAIcEDshCSACKAIYEDshCiACKAIUEDshCyACKAIQEDshDCACKAIMEDshDSACKAIIEDshDiACKAIEEDshDyACKAIAEDshBiAIQcgAaiIEQQA6AEQgBCADQQJ2IgI2AgAgBCAJNgIEIAQgCjYCCCAEIAs2AgwgBCAMNgIQIAQgDTYCFCAEIA42AhggBCAPNgIcIAQgBjYCICAEQSRqIgNCADcCACADQgA3AgggA0IANwIQIANCADcCGAJAAkADQAJAIAJBf2oiA0EQTw0CIARBBGogA0ECdGooAgAEQCACIQcMAQsgA0EBSwRAIAMhAgwCBSADIQcLCwsMAQtBsAsgA0EQECgLIAQgBzYCACAFIAQpAwA3AwAgBSAEKQMINwMIIAUgBCkDEDcDECAFIAQpAxg3AxggBSAEKQMgNwMgIAUgBCkDKDcDKCAFIAQpAzA3AzAgBSAEKQM4NwM4IAUgBCkDQDcDQAJAAkAgBSgCACIGQQhGBEBBCCECAkACQAJAA0AgAkF/aiEDIAJFDQYgA0EQTw0BIAVBBGogA0ECdGooAgAiByADQQJ0QewKaigCACICRw0CIAMhAgwACwALQbwLIANBEBAoDAELIAcgAkkNAgsFIAZBCEkNAQsMAQsgBkEBRgRAIAUoAgRFDQELIAQgASAFECAgBCgCBBA7IRAgBCgCCBA7IREgBCgCDBA7IRIgBCgCEBA7IQkgBCgCFBA7IQogBCgCGBA7IQsgBCgCHBA7IQwgBCgCIBA7IQ0gBCgCTBA7IQ4gBCgCUBA7IQ8gBCgCVBA7IQYgBCgCWBA7IQUgBCgCXBA7IQcgBCgCYBA7IQMgBCgCZBA7IQIgBCgCaBA7IQEgAEEBOgAAIABBBDoAASAAIA02AAIgACAMNgAGIAAgCzYACiAAIAo2AA4gACAJNgASIAAgEjYAFiAAIBE2ABogACAQNgAeIAAgATYAIiAAIAI2ACYgACADNgAqIAAgBzYALiAAIAU2ADIgACAGNgA2IAAgDzYAOiAAIA42AD4gCCQCDwsgAEEAOgAAIAgkAgsLdgECfwJAIwIhAiMCQTBqJAIgAkEoaiIDIAA2AgAgAkEsaiIAIAE2AgAgAkEYaiIBIAM2AgAgAUEBNgIEIAEgADYCCCABQQE2AgwgAkGsDzYCACACQQI2AgQgAkEANgIIIAIgATYCECACQQI2AhQgAkG8DxAsCwt1AQJ/AkAjAiEDIwJBMGokAiADQShqIgQgATYCACADQSxqIgEgAjYCACADQRhqIgIgATYCACACQQE2AgQgAiAENgIIIAJBATYCDCADQZwPNgIAIANBAjYCBCADQQA2AgggAyACNgIQIANBAjYCFCADIAAQLAsLDwAgAQR/IAAgAXAFQQALCw8AIAEEfyAAIAFuBUEACwvNAgEHfwJ/IwIhBSMCQTBqJAIgBSEEIAAoAgAiAEGPzgBLBEBBJyEGA0AgAEGQzgAQKSECIABBkM4AECohAyACQeQAECpBAXQhByACQeQAEClBAXQhCCAEIAZBfGoiAmogB0GQF2ouAAA7AAAgBCAGQX5qaiAIQZAXai4AADsAACAAQf/B1y9LBEAgAiEGIAMhAAwBBSADIQALCwVBJyECCyAAQeMASgRAIABB5AAQKUEBdCEDIABB5AAQKiEAIAQgAkF+aiICaiADQZAXai4AADsAAAsgAEEKSAR/IAQgAkF/aiIDaiAAQf8BcUEwajoAACABQQFBrL8BQQAgBCADIgBqQScgAGsQLSEAIAUkAiAABSAEIAJBfmoiA2ogAEEBdEGQF2ouAAA7AAAgAUEBQay/AUEAIAQgAyIAakEnIABrEC0hACAFJAIgAAsLC3QBBH8CQCMCIQIjAkEwaiQCIAEoAgAhAyABKAIEIQQgASgCCCEFIAIiASAAKQIANwIAIAEgACkCCDcCCCABIAApAhA3AhAgAkEYaiIAIAEpAgA3AgAgACABKQIINwIIIAAgASkCEDcCECAAIAMgBCAFEA4LC/cRAQ1/An8jAiEMIwJBEGokAiAAKAIAIQgCQAJAIAEEQCAIQQFxBEBBKyEGDAIFQQAhDkEAIQYgBSEHCwVBLSEGDAELDAELQQEhDiAFQQFqIQcLIAhBBHEEfyACIANqIQsgAwRAIAIhAUEAIQkDQCABLAAAQcABcUGAAUYgCWohCSABQQFqIgEgC0cNAAsFQQAhCQsgByADaiAJayEHQQEFQQALIREgDEEEaiEBIAAoAghFBEAgDkEBRgRAIAAoAhghDSAAKAIcIQogAUEANgIAIAZBgAFJBEAgASAGOgAAQQEhBwUgBkGAEEkEf0FAIQhBASELQQIhByABBSAGQYCABEkEfyABQWA6AABBgH8hCEECIQtBAyEHIAFBAWoFIAFBcDoAACABQYB/OgABQYB/IQhBAyELQQQhByABQQJqCwsiCSAIOgAAIAEgC2ogBkE/cUGAf3I6AAALIA0gASAHIAooAgxBA3FBAmoRAABB/wFxBEAgDCQCQQEPCwsgAEEYaiEBIBEEQCABKAIAIAIgAyAAQRxqIgAoAgAoAgxBA3FBAmoRAABB/wFxBEAgDCQCQQEPCwUgAEEcaiEACyABKAIAIAQgBSAAKAIAKAIMQQNxQQJqEQAAIQAgDCQCIAAPCyAAKAIMIgogB00EQCAOQQFGBEAgACgCGCENIAAoAhwhCiABQQA2AgAgBkGAAUkEQCABIAY6AABBASEHBSAGQYAQSQR/QUAhCEEBIQtBAiEHIAEFIAZBgIAESQR/IAFBYDoAAEGAfyEIQQIhC0EDIQcgAUEBagUgAUFwOgAAIAFBgH86AAFBgH8hCEEDIQtBBCEHIAFBAmoLCyIJIAg6AAAgASALaiAGQT9xQYB/cjoAAAsgDSABIAcgCigCDEEDcUECahEAAEH/AXEEQCAMJAJBAQ8LCyAAQRhqIQEgEQRAIAEoAgAgAiADIABBHGoiACgCACgCDEEDcUECahEAAEH/AXEEQCAMJAJBAQ8LBSAAQRxqIQALIAEoAgAgBCAFIAAoAgAoAgxBA3FBAmoRAAAhACAMJAIgAA8LIAwhCSAIQQhxRQRAIAogB2shBwJAAkACQAJAIAAsADAiCEEDRgR/QQEFIAgLQQNxDgMAAgECCyAHIQhBACEHDAILIAdBAWpBAXYhCCAHQQF2IQcMAQtBACEICyAJQQA2AgAgACgCBCIKQYABSQR/IAkgCjoAAEEBBSAKQYAQSQR/IApBBnZBH3FBQHIhD0EBIRBBAiENIAkFIApBgIAESQR/IAkgCkEMdkEPcUFgcjoAACAKQQZ2QT9xQYB/ciEPQQIhEEEDIQ0gCUEBagUgCSAKQRJ2Qf8BcUFwcjoAACAJIApBDHZBP3FBgH9yOgABIApBBnZBP3FBgH9yIQ9BAyEQQQQhDSAJQQJqCwsiCyAPOgAAIAkgEGogCkE/cUGAf3I6AAAgDQshCyAAQRhqIQ0gAEEcaiEKQQAhAAJAAkADQCAAIAdJBEAgAEEBaiEAIA0oAgAgCSALIAooAgAoAgxBA3FBAmoRAABB/wFxDQIMAQsLDAELIAwkAkEBDwsCQAJAIA5BAUcNACANKAIAIRAgCigCACESIAFBADYCACAGQYABSQRAIAEgBjoAAEEBIQcFIAZBgBBJBH9BQCEOQQEhD0ECIQcgAQUgBkGAgARJBH8gAUFgOgAAQYB/IQ5BAiEPQQMhByABQQFqBSABQXA6AAAgAUGAfzoAAUGAfyEOQQMhD0EEIQcgAUECagsLIgAgDjoAACABIA9qIAZBP3FBgH9yOgAACyAQIAEgByASKAIMQQNxQQJqEQAAQf8BcUUNAAwBCyARBEAgDSgCACACIAMgCigCACgCDEEDcUECahEAAEH/AXENAQsgDSgCACAEIAUgCigCACgCDEEDcUECahEAAEH/AXFFBEBBACEAAkACQANAIAAgCE8NASAAQQFqIQAgDSgCACAJIAsgCigCACgCDEEDcUECahEAAEH/AXFFDQAMAgsACyAMJAJBAA8LIAwkAkEBDwsLIAwkAkEBDwsgAEEEaiIPQTA2AgAgAEEwaiIQQQE6AAAgDkEBRgRAIAAoAhghDiAAKAIcIRIgAUEANgIAIAZBgAFJBEAgASAGOgAAQQEhCAUgBkGAEEkEf0FAIQtBASENQQIhCCABBSAGQYCABEkEfyABQWA6AABBgH8hC0ECIQ1BAyEIIAFBAWoFIAFBcDoAACABQYB/OgABQYB/IQtBAyENQQQhCCABQQJqCwsiCSALOgAAIAEgDWogBkE/cUGAf3I6AAALIA4gASAIIBIoAgxBA3FBAmoRAABB/wFxBEAgDCQCQQEPCwsgEQRAIAAoAhggAiADIAAoAhwoAgxBA3FBAmoRAABB/wFxBEAgDCQCQQEPCwsgCiAHayECAkACQAJAAkAgECwAACIDQQNGBH9BAQUgAwtBA3EOAwACAQILIAIhA0EAIQIMAgsgAkEBakEBdiEDIAJBAXYhAgwBC0EAIQMLIAFBADYCACAPKAIAIgZBgAFJBH8gASAGOgAAQQEFIAZBgBBJBH8gBkEGdkEfcUFAciEIQQEhC0ECIQcgAQUgBkGAgARJBH8gASAGQQx2QQ9xQWByOgAAIAZBBnZBP3FBgH9yIQhBAiELQQMhByABQQFqBSABIAZBEnZB/wFxQXByOgAAIAEgBkEMdkE/cUGAf3I6AAEgBkEGdkE/cUGAf3IhCEEDIQtBBCEHIAFBAmoLCyIJIAg6AAAgASALaiAGQT9xQYB/cjoAACAHCyEJIABBGGohByAAQRxqIQZBACEAAkACQANAIAAgAkkEQCAAQQFqIQAgBygCACABIAkgBigCACgCDEEDcUECahEAAEH/AXENAgwBCwsMAQsgDCQCQQEPCyAHKAIAIAQgBSAGKAIAKAIMQQNxQQJqEQAAQf8BcQRAIAwkAkEBDwVBACEACwJAAkADQCAAIANPDQEgAEEBaiEAIAcoAgAgASAJIAYoAgAoAgxBA3FBAmoRAABB/wFxRQ0ADAILAAsgDCQCQQAPCyAMJAJBAQsLiwEBBn8CQCMCIQEjAkEwaiQCIAAoAgQhAyAAKAIIIQQgACgCDCEFIAAoAhAhBiABQRhqIgIgACgCADYCACACIAM2AgQgASIAIAI2AgAgAEEBNgIEIABBADYCCCAAQfyxATYCECAAQQA2AhQgAUEgaiIBIAQ2AgAgASAFNgIEIAEgBjYCCCAAIAEQLAsLdgECfwJAIwIhAiMCQTBqJAIgAkEoaiIDIAA2AgAgAkEsaiIAIAE2AgAgAkEYaiIBIAM2AgAgAUEBNgIEIAEgADYCCCABQQE2AgwgAkHIDzYCACACQQI2AgQgAkEANgIIIAIgATYCECACQQI2AhQgAkHYDxAsCwswAQJ/An8jAiEBIwJBEGokAiABIgIgACgCPBA4NgIAQQYgAhABEDMhACABJAIgAAsLawEDfwJ/IwIhBCMCQSBqJAIgBCEDIARBEGohBSAAQQM2AiQgACgCAEHAAHFFBEAgAyAAKAI8NgIAIANBk6gBNgIEIAMgBTYCCEE2IAMQBARAIABBfzoASwsLIAAgASACEDchACAEJAIgAAsLZQECfwJ/IwIhBCMCQSBqJAIgBCIDIAAoAjw2AgAgA0EANgIEIAMgATYCCCADIARBFGoiADYCDCADIAI2AhBBjAEgAxACEDNBAEgEfyAAQX82AgBBfwUgACgCAAshACAEJAIgAAsLGgAgAEGAYEsEfxA0QQAgAGs2AgBBfwUgAAsLCAAQNUHAAGoLBAAQNgsFAEHgEAv9AgELfwJ/IwIhBSMCQTBqJAIgBUEQaiEGIAVBIGoiAyAAQRxqIgkoAgAiBDYCACADIABBFGoiCigCACAEayIENgIEIAMgATYCCCADIAI2AgwgBSIBIABBPGoiDCgCADYCACABIAM2AgQgAUECNgIIAkACQCAEIAJqIgRBkgEgARAGEDMiAUYNAEECIQcDQCABQQBOBEAgBCABayEEIANBCGohCCABIAMoAgQiDUsiCwRAIAghAwsgC0EfdEEfdSAHaiEHIAMgAygCACABIAsEfyANBUEAC2siAWo2AgAgA0EEaiIIIAgoAgAgAWs2AgAgBiAMKAIANgIAIAYgAzYCBCAGIAc2AgggBEGSASAGEAYQMyIBRg0CDAELCyAAQQA2AhAgCUEANgIAIApBADYCACAAIAAoAgBBIHI2AgAgB0ECRgR/QQAFIAIgAygCBGsLIQIMAQsgACAAKAIsIgEgACgCMGo2AhAgCSABNgIAIAogATYCAAsgBSQCIAILCwQAIAALUAECfwJ/IAIEfwNAIAAsAAAiAyABLAAAIgRGBEAgAEEBaiEAIAFBAWohAUEAIAJBf2oiAkUNAxoMAQsLIANB/wFxIARB/wFxawVBAAsLIgALnQIBBH8CfyAAIAJqIQQgAUH/AXEhASACQcMATgRAA0AgAEEDcQRAIAAgAToAACAAQQFqIQAMAQsLIARBfHEiBUHAAGshBiABIAFBCHRyIAFBEHRyIAFBGHRyIQMDQCAAIAZMBEAgACADNgIAIAAgAzYCBCAAIAM2AgggACADNgIMIAAgAzYCECAAIAM2AhQgACADNgIYIAAgAzYCHCAAIAM2AiAgACADNgIkIAAgAzYCKCAAIAM2AiwgACADNgIwIAAgAzYCNCAAIAM2AjggACADNgI8IABBwABqIQAMAQsLA0AgACAFSARAIAAgAzYCACAAQQRqIQAMAQsLCwNAIAAgBEgEQCAAIAE6AAAgAEEBaiEADAELCyAEIAJrCwsrACAAQf8BcUEYdCAAQQh1Qf8BcUEQdHIgAEEQdUH/AXFBCHRyIABBGHZyC8kDAQN/An8gAkGAwABOBEAgACABIAIQAw8LIAAhBCAAIAJqIQMgAEEDcSABQQNxRgRAA0AgAEEDcQRAIAJFBEAgBA8LIAAgASwAADoAACAAQQFqIQAgAUEBaiEBIAJBAWshAgwBCwsgA0F8cSICQcAAayEFA0AgACAFTARAIAAgASgCADYCACAAIAEoAgQ2AgQgACABKAIINgIIIAAgASgCDDYCDCAAIAEoAhA2AhAgACABKAIUNgIUIAAgASgCGDYCGCAAIAEoAhw2AhwgACABKAIgNgIgIAAgASgCJDYCJCAAIAEoAig2AiggACABKAIsNgIsIAAgASgCMDYCMCAAIAEoAjQ2AjQgACABKAI4NgI4IAAgASgCPDYCPCAAQcAAaiEAIAFBwABqIQEMAQsLA0AgACACSARAIAAgASgCADYCACAAQQRqIQAgAUEEaiEBDAELCwUgA0EEayECA0AgACACSARAIAAgASwAADoAACAAIAEsAAE6AAEgACABLAACOgACIAAgASwAAzoAAyAAQQRqIQAgAUEEaiEBDAELCwsDQCAAIANIBEAgACABLAAAOgAAIABBAWohACABQQFqIQEMAQsLIAQLCwsAAn9BABAAQQALCwsAAn9BARAAQQALCwsAAn9BAhAAQQALCwu9DA0AQYAIC+QBAQAAAAAAAACCgAAAAAAAAIqAAAAAAACAAIAAgAAAAICLgAAAAAAAAAEAAIAAAAAAgYAAgAAAAIAJgAAAAAAAgIoAAAAAAAAAiAAAAAAAAAAJgACAAAAAAAoAAIAAAAAAi4AAgAAAAACLAAAAAAAAgImAAAAAAACAA4AAAAAAAIACgAAAAAAAgIAAAAAAAACACoAAAAAAAAAKAACAAAAAgIGAAIAAAACAgIAAAAAAAIABAACAAAAAAAiAAIAAAACACAAAAC/8///+////////////////////////////////////AEGICgsFAQAAAAEAQdAKCzyxCQAAIgAAAPYCAABYCQAAWQAAADwBAAAIAAAAQUE20Ixe0r87oEiv5tyuuv7///////////////////8AQbALC6kBMwoAACIAAADwAgAA0wkAAGAAAAA9AAAA0wkAAGAAAACBAAAA0wkAAGAAAACLAAAA0wkAAGAAAACTAAAA0wkAAGAAAACbAAAA0wkAAGAAAADvAAAA0wkAAGAAAAD3AAAA0wkAAGAAAAC6AAAA0wkAAGAAAABeAQAA0wkAAGAAAAAxAQAA0wkAAGAAAAAyAQAA0wkAAGAAAAA4AQAA0wkAAGAAAAA9AQAAAQBBoA0LadMJAABgAAAAbgMAAFUKAABcAAAAEAAAADMKAAAiAAAA9gIAANMJAABgAAAAHgQAABQLAAAoAAAAsQoAAGMAAABCAAAAsQoAAGMAAAA9AAAAsQoAAGMAAABQAAAAsQoAAGMAAABSAAAAAQBB0A4LAQEAQZgPC00BAAAAXgsAACAAAAB+CwAAEgAAAFgMAAAGAAAAXgwAACIAAAA8CwAAIgAAAKACAACADAAAFgAAAJYMAAANAAAAPAsAACIAAACmAgAABQBB8A8LAQEAQYgQCw4BAAAAAgAAALRfAAAABABBoBALAQEAQa8QCwUK/////wBBnBILAiRZAEHUEgvPBuQHAAAvaG9tZS9tYWNpZWovLmNhcmdvL3JlZ2lzdHJ5L3NyYy9naXRodWIuY29tLTFlY2M2Mjk5ZGI5ZWM4MjMvdGlueS1rZWNjYWstMS4yLjEvc3JjL2xpYi5ycy9jaGVja291dC9zcmMvbGliY29yZS9zbGljZS9tb2QucnMvaG9tZS9tYWNpZWovLmNhcmdvL3JlZ2lzdHJ5L3NyYy9naXRodWIuY29tLTFlY2M2Mjk5ZGI5ZWM4MjMvdGlueS1zZWNwMjU2azEtMC4xLjAvc3JjL2JpZ19udW0ucnMvY2hlY2tvdXQvc3JjL2xpYmNvcmUvc2xpY2UvbW9kLnJzL2hvbWUvbWFjaWVqLy5jYXJnby9yZWdpc3RyeS9zcmMvZ2l0aHViLmNvbS0xZWNjNjI5OWRiOWVjODIzL3Rpbnktc2VjcDI1NmsxLTAuMS4wL3NyYy9uYWYucnMvaG9tZS9tYWNpZWovLmNhcmdvL3JlZ2lzdHJ5L3NyYy9naXRodWIuY29tLTFlY2M2Mjk5ZGI5ZWM4MjMvdGlueS1zZWNwMjU2azEtMC4xLjAvc3JjL2VjX3BvaW50X2cucnNpbnRlcm5hbCBlcnJvcjogZW50ZXJlZCB1bnJlYWNoYWJsZSBjb2RlL2NoZWNrb3V0L3NyYy9saWJjb3JlL3NsaWNlL21vZC5yc2luZGV4IG91dCBvZiBib3VuZHM6IHRoZSBsZW4gaXMgIGJ1dCB0aGUgaW5kZXggaXMgMDAwMTAyMDMwNDA1MDYwNzA4MDkxMDExMTIxMzE0MTUxNjE3MTgxOTIwMjEyMjIzMjQyNTI2MjcyODI5MzAzMTMyMzMzNDM1MzYzNzM4Mzk0MDQxNDI0MzQ0NDU0NjQ3NDg0OTUwNTE1MjUzNTQ1NTU2NTc1ODU5NjA2MTYyNjM2NDY1NjY2NzY4Njk3MDcxNzI3Mzc0NzU3Njc3Nzg3OTgwODE4MjgzODQ4NTg2ODc4ODg5OTA5MTkyOTM5NDk1OTY5Nzk4OTlpbmRleCAgb3V0IG9mIHJhbmdlIGZvciBzbGljZSBvZiBsZW5ndGggc2xpY2UgaW5kZXggc3RhcnRzIGF0ICBidXQgZW5kcyBhdCA=', 'base64'); diff --git a/js-old/src/api/local/ethkey/index.js b/js-old/src/api/local/ethkey/index.js deleted file mode 100644 index 07ca34ba11e..00000000000 --- a/js-old/src/api/local/ethkey/index.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import workerPool from './workerPool'; - -export function createKeyObject (key, password) { - return workerPool.action('createKeyObject', { key, password }) - .then((obj) => JSON.parse(obj)); -} - -export function decryptPrivateKey (keyObject, password) { - return workerPool - .action('decryptPrivateKey', { keyObject, password }) - .then((privateKey) => { - if (privateKey) { - return Buffer.from(privateKey); - } - - return null; - }); -} - -export function phraseToAddress (phrase) { - return phraseToWallet(phrase) - .then((wallet) => wallet.address); -} - -export function phraseToWallet (phrase) { - return workerPool.action('phraseToWallet', phrase); -} - -export function verifySecret (secret) { - return workerPool.action('verifySecret', secret); -} diff --git a/js-old/src/api/local/ethkey/index.spec.js b/js-old/src/api/local/ethkey/index.spec.js deleted file mode 100644 index ce4cc29df9b..00000000000 --- a/js-old/src/api/local/ethkey/index.spec.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { randomPhrase } from '@parity/wordlist'; -import { phraseToAddress, phraseToWallet } from './'; - -// TODO: Skipping until Node.js 8.0 comes out and we can test WebAssembly -describe.skip('api/local/ethkey', () => { - describe('phraseToAddress', function () { - this.timeout(30000); - - it('generates a valid address', () => { - const phrase = randomPhrase(12); - - return phraseToAddress(phrase).then((address) => { - expect(address.length).to.be.equal(42); - expect(address.slice(0, 4)).to.be.equal('0x00'); - }); - }); - - it('generates valid address for empty phrase', () => { - return phraseToAddress('').then((address) => { - expect(address).to.be.equal('0x00a329c0648769a73afac7f9381e08fb43dbea72'); - }); - }); - }); - - describe('phraseToWallet', function () { - this.timeout(30000); - - it('generates a valid wallet object', () => { - const phrase = randomPhrase(12); - - return phraseToWallet(phrase).then((wallet) => { - expect(wallet.address.length).to.be.equal(42); - expect(wallet.secret.length).to.be.equal(66); - expect(wallet.public.length).to.be.equal(130); - - expect(wallet.address.slice(0, 4)).to.be.equal('0x00'); - expect(wallet.secret.slice(0, 2)).to.be.equal('0x'); - expect(wallet.public.slice(0, 2)).to.be.equal('0x'); - }); - }); - }); -}); diff --git a/js-old/src/api/local/ethkey/worker.js b/js-old/src/api/local/ethkey/worker.js deleted file mode 100644 index 76ccf06b227..00000000000 --- a/js-old/src/api/local/ethkey/worker.js +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { bytesToHex } from '~/api/util/format'; -import { extern, slice } from './ethkey.js'; - -const isWorker = typeof self !== 'undefined'; - -// Stay compatible between environments -if (!isWorker) { - const scope = typeof global === 'undefined' ? window : global; - - scope.self = scope; -} - -// keythereum should never be used outside of the browser -let keythereum = require('keythereum'); - -if (isWorker) { - keythereum = self.keythereum; -} - -function route ({ action, payload }) { - if (action in actions) { - return actions[action](payload); - } - - return null; -} - -const input = slice(extern._input_ptr(), 1024); -const secret = slice(extern._secret_ptr(), 32); -const publicKey = slice(extern._public_ptr(), 64); -const address = slice(extern._address_ptr(), 20); - -extern._ecpointg(); - -const actions = { - phraseToWallet (phrase) { - const phraseUtf8 = Buffer.from(phrase, 'utf8'); - - if (phraseUtf8.length > input.length) { - throw new Error('Phrase is too long!'); - } - - input.set(phraseUtf8); - - extern._brain(phraseUtf8.length); - - const wallet = { - secret: bytesToHex(secret), - public: bytesToHex(publicKey), - address: bytesToHex(address) - }; - - return wallet; - }, - - verifySecret (key) { - const keyBuf = Buffer.from(key.slice(2), 'hex'); - - secret.set(keyBuf); - - return extern._verify_secret(); - }, - - createKeyObject ({ key, password }) { - key = Buffer.from(key); - password = Buffer.from(password); - - const iv = keythereum.crypto.randomBytes(16); - const salt = keythereum.crypto.randomBytes(32); - const keyObject = keythereum.dump(password, key, salt, iv); - - return JSON.stringify(keyObject); - }, - - decryptPrivateKey ({ keyObject, password }) { - password = Buffer.from(password); - - try { - const key = keythereum.recover(password, keyObject); - - // Convert to array to safely send from the worker - return Array.from(key); - } catch (e) { - return null; - } - } -}; - -self.onmessage = function ({ data }) { - try { - const result = route(data); - - postMessage([null, result]); - } catch (err) { - console.error(err); - postMessage([err.toString(), null]); - } -}; - -// Emulate a web worker in Node.js -class KeyWorker { - postMessage (data) { - // Force async - setTimeout(() => { - try { - const result = route(data); - - this.onmessage({ data: [null, result] }); - } catch (err) { - this.onmessage({ data: [err, null] }); - } - }, 0); - } - - onmessage (event) { - // no-op to be overriden - } -} - -if (exports != null) { - exports.KeyWorker = KeyWorker; -} diff --git a/js-old/src/api/local/ethkey/workerPool.js b/js-old/src/api/local/ethkey/workerPool.js deleted file mode 100644 index d7db73b419b..00000000000 --- a/js-old/src/api/local/ethkey/workerPool.js +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -// Allow a web worker in the browser, with a fallback for Node.js -const hasWebWorkers = typeof Worker !== 'undefined'; -const KeyWorker = hasWebWorkers ? require('worker-loader!./worker') - : require('./worker').KeyWorker; - -class WorkerContainer { - busy = false; - _worker = new KeyWorker(); - - action (action, payload) { - if (this.busy) { - throw new Error('Cannot issue an action on a busy worker!'); - } - - this.busy = true; - - return new Promise((resolve, reject) => { - this._worker.postMessage({ action, payload }); - this._worker.onmessage = ({ data }) => { - const [err, result] = data; - - this.busy = false; - - if (err) { - // `err` ought to be a String - reject(new Error(err)); - } else { - resolve(result); - } - }; - }); - } -} - -class WorkerPool { - pool = [ - new WorkerContainer(), - new WorkerContainer() - ]; - - queue = []; - - _getContainer () { - return this.pool.find((container) => !container.busy); - } - - action (action, payload) { - let container = this.pool.find((container) => !container.busy); - - let promise; - - // const start = Date.now(); - - if (container) { - promise = container.action(action, payload); - } else { - promise = new Promise((resolve, reject) => { - this.queue.push([action, payload, resolve]); - }); - } - - return promise - .catch((err) => { - this.processQueue(); - - throw err; - }) - .then((result) => { - this.processQueue(); - - // console.log('Work done in ', Date.now() - start); - - return result; - }); - } - - processQueue () { - let container = this._getContainer(); - - while (container && this.queue.length > 0) { - const [action, payload, resolve] = this.queue.shift(); - - resolve(container.action(action, payload)); - container = this._getContainer(); - } - } -} - -export default new WorkerPool(); diff --git a/js-old/src/api/local/index.js b/js-old/src/api/local/index.js deleted file mode 100644 index 190a38ea4f6..00000000000 --- a/js-old/src/api/local/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default null; diff --git a/js-old/src/api/local/localAccountsMiddleware.js b/js-old/src/api/local/localAccountsMiddleware.js deleted file mode 100644 index c452f541afa..00000000000 --- a/js-old/src/api/local/localAccountsMiddleware.js +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import EthereumTx from 'ethereumjs-tx'; -import accounts from './accounts'; -import transactions from './transactions'; -import { Middleware } from '../transport'; -import { inNumber16 } from '../format/input'; -import { phraseToWallet, phraseToAddress, verifySecret } from './ethkey'; -import { randomPhrase } from '@parity/wordlist'; - -export default class LocalAccountsMiddleware extends Middleware { - constructor (transport) { - super(transport); - - const register = this.register.bind(this); - - register('eth_accounts', () => { - return accounts.accountAddresses(); - }); - - register('eth_coinbase', () => { - return accounts.lastAddress; - }); - - register('parity_accountsInfo', () => { - return accounts.map(({ name }) => { - return { name }; - }); - }); - - register('parity_allAccountsInfo', () => { - return accounts.map(({ name, meta, uuid }) => { - return { name, meta, uuid }; - }); - }); - - register('parity_changePassword', ([address, oldPassword, newPassword]) => { - const account = accounts.get(address); - - return account - .decryptPrivateKey(oldPassword) - .then((privateKey) => { - if (!privateKey) { - return false; - } - - account.changePassword(privateKey, newPassword); - - return true; - }); - }); - - register('parity_checkRequest', ([id]) => { - return transactions.hash(id) || Promise.resolve(null); - }); - - register('parity_dappsList', () => { - return []; - }); - - register('parity_defaultAccount', () => { - return accounts.dappsDefaultAddress; - }); - - register('parity_exportAccount', ([address, password]) => { - const account = accounts.get(address); - - if (!password) { - password = ''; - } - - return account.isValidPassword(password) - .then((isValid) => { - if (!isValid) { - throw new Error('Invalid password'); - } - - return account.export(); - }); - }); - - register('parity_generateSecretPhrase', () => { - return randomPhrase(12); - }); - - register('parity_getNewDappsAddresses', () => { - return accounts.accountAddresses(); - }); - - register('parity_getNewDappsDefaultAddress', () => { - return accounts.dappsDefaultAddress; - }); - - register('parity_hardwareAccountsInfo', () => { - return {}; - }); - - register('parity_newAccountFromPhrase', ([phrase, password]) => { - return phraseToWallet(phrase) - .then((wallet) => { - return accounts.create(wallet.secret, password); - }); - }); - - register('parity_newAccountFromSecret', ([secret, password]) => { - return verifySecret(secret) - .then((isValid) => { - if (!isValid) { - throw new Error('Invalid secret key'); - } - - return accounts.create(secret, password); - }); - }); - - register('parity_newAccountFromWallet', ([json, password]) => { - if (!password) { - password = ''; - } - - return accounts.restoreFromWallet(JSON.parse(json), password); - }); - - register('parity_setAccountMeta', ([address, meta]) => { - accounts.getLazyCreate(address).meta = meta; - - return true; - }); - - register('parity_setAccountName', ([address, name]) => { - accounts.getLazyCreate(address).name = name; - - return true; - }); - - register('parity_setNewDappsDefaultAddress', ([address]) => { - accounts.dappsDefaultAddress = address; - - return true; - }); - - register('parity_postTransaction', ([tx]) => { - if (!tx.from) { - tx.from = accounts.lastAddress; - } - - tx.nonce = null; - tx.condition = null; - - return transactions.add(tx); - }); - - register('parity_phraseToAddress', ([phrase]) => { - return phraseToAddress(phrase); - }); - - register('parity_useLocalAccounts', () => { - return true; - }); - - register('parity_listGethAccounts', () => { - return []; - }); - - register('parity_listOpenedVaults', () => { - return []; - }); - - register('parity_listRecentDapps', () => { - return {}; - }); - - register('parity_listVaults', () => { - return []; - }); - - register('parity_wsUrl', () => { - // This is a hack, will be replaced by a `hostname` setting on the node itself - return `${window.location.hostname}:8546`; - }); - - register('parity_dappsUrl', () => { - // This is a hack, will be replaced by a `hostname` setting on the node itself - return `${window.location.hostname}:8545`; - }); - - register('parity_hashContent', () => { - throw new Error('Functionality unavailable on a public wallet.'); - }); - - register('parity_killAccount', ([address, password]) => { - return accounts.remove(address, password); - }); - - register('parity_removeAddress', ([address]) => { - return accounts.remove(address, null); - }); - - register('parity_testPassword', ([address, password]) => { - const account = accounts.get(address); - - return account.isValidPassword(password); - }); - - register('parity_upgradeReady', () => { - return false; - }); - - register('signer_confirmRequest', ([id, modify, password]) => { - const { - gasPrice, - gas: gasLimit, - from, - to, - value, - data - } = Object.assign(transactions.get(id), modify); - - transactions.lock(id); - - const account = accounts.get(from); - - return Promise.all([ - this.rpcRequest('parity_nextNonce', [from]), - account.decryptPrivateKey(password) - ]) - .catch((err) => { - transactions.unlock(id); - - // transaction got unlocked, can propagate rejection further - throw err; - }) - .then(([nonce, privateKey]) => { - if (!privateKey) { - transactions.unlock(id); - - throw new Error('Invalid password'); - } - - const tx = new EthereumTx({ - nonce, - to, - data, - gasLimit: inNumber16(gasLimit), - gasPrice: inNumber16(gasPrice), - value: inNumber16(value) - }); - - tx.sign(privateKey); - - const serializedTx = `0x${tx.serialize().toString('hex')}`; - - return this.rpcRequest('eth_sendRawTransaction', [serializedTx]); - }) - .then((hash) => { - transactions.confirm(id, hash); - - return {}; - }); - }); - - register('signer_generateAuthorizationToken', () => { - return ''; - }); - - register('signer_rejectRequest', ([id]) => { - return transactions.reject(id); - }); - - register('signer_requestsToConfirm', () => { - return transactions.requestsToConfirm(); - }); - } -} diff --git a/js-old/src/api/local/localAccountsMiddleware.spec.js b/js-old/src/api/local/localAccountsMiddleware.spec.js deleted file mode 100644 index b3de3992d1d..00000000000 --- a/js-old/src/api/local/localAccountsMiddleware.spec.js +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import LocalAccountsMiddleware from './localAccountsMiddleware'; -import JsonRpcBase from '../transport/jsonRpcBase'; - -const RPC_RESPONSE = Symbol('RPC response'); -const ADDRESS = '0x00a329c0648769a73afac7f9381e08fb43dbea72'; -const SECRET = '0x4d5db4107d237df6a3d58ee5f70ae63d73d7658d4026f2eefd2f204c81682cb7'; -const PASSWORD = 'password'; - -const FOO_PHRASE = 'foobar'; -const FOO_PASSWORD = 'foopass'; -const FOO_ADDRESS = '0x007ef7ac1058e5955e366ab9d6b6c4ebcc937e7e'; - -class MockedTransport extends JsonRpcBase { - _execute (method, params) { - return RPC_RESPONSE; - } -} - -// Skip till all CI runs on Node 8+ -describe.skip('api/local/LocalAccountsMiddleware', function () { - this.timeout(30000); - - let transport; - - beforeEach(() => { - transport = new MockedTransport(); - transport.addMiddleware(LocalAccountsMiddleware); - - // Same as `parity_newAccountFromPhrase` with empty phrase - return transport - .execute('parity_newAccountFromSecret', SECRET, PASSWORD) - .catch((_err) => { - // Ignore the error - all instances of LocalAccountsMiddleware - // share account storage - }); - }); - - it('registers all necessary methods', () => { - return Promise - .all([ - 'eth_accounts', - 'eth_coinbase', - 'parity_accountsInfo', - 'parity_allAccountsInfo', - 'parity_changePassword', - 'parity_checkRequest', - 'parity_defaultAccount', - 'parity_generateSecretPhrase', - 'parity_getNewDappsAddresses', - 'parity_hardwareAccountsInfo', - 'parity_newAccountFromPhrase', - 'parity_newAccountFromSecret', - 'parity_setAccountMeta', - 'parity_setAccountName', - 'parity_postTransaction', - 'parity_phraseToAddress', - 'parity_useLocalAccounts', - 'parity_listGethAccounts', - 'parity_listOpenedVaults', - 'parity_listRecentDapps', - 'parity_listVaults', - 'parity_killAccount', - 'parity_testPassword', - 'signer_confirmRequest', - 'signer_rejectRequest', - 'signer_requestsToConfirm' - ].map((method) => { - return transport - .execute(method) - .then((result) => { - expect(result).not.to.be.equal(RPC_RESPONSE); - }) - // Some errors are expected here since we are calling methods - // without parameters. - .catch((_) => {}); - })); - }); - - it('allows non-registered methods through', () => { - return transport - .execute('eth_getBalance', '0x407d73d8a49eeb85d32cf465507dd71d507100c1') - .then((result) => { - expect(result).to.be.equal(RPC_RESPONSE); - }); - }); - - it('can handle `eth_accounts`', () => { - return transport - .execute('eth_accounts') - .then((accounts) => { - expect(accounts.length).to.be.equal(1); - expect(accounts[0]).to.be.equal(ADDRESS); - }); - }); - - it('can handle `parity_defaultAccount`', () => { - return transport - .execute('parity_defaultAccount') - .then((address) => { - expect(address).to.be.equal(ADDRESS); - }); - }); - - it('can handle `parity_phraseToAddress`', () => { - return transport - .execute('parity_phraseToAddress', '') - .then((address) => { - expect(address).to.be.equal(ADDRESS); - - return transport.execute('parity_phraseToAddress', FOO_PHRASE); - }) - .then((address) => { - expect(address).to.be.equal(FOO_ADDRESS); - }); - }); - - it('can create and kill an account', () => { - return transport - .execute('parity_newAccountFromPhrase', FOO_PHRASE, FOO_PASSWORD) - .then((address) => { - expect(address).to.be.equal(FOO_ADDRESS); - - return transport.execute('eth_accounts'); - }) - .then((accounts) => { - expect(accounts.length).to.be.equal(2); - expect(accounts.includes(FOO_ADDRESS)).to.be.true; - - return transport.execute('parity_killAccount', FOO_ADDRESS, FOO_PASSWORD); - }) - .then((result) => { - expect(result).to.be.true; - - return transport.execute('eth_accounts'); - }) - .then((accounts) => { - expect(accounts.length).to.be.equal(1); - expect(accounts.includes(FOO_ADDRESS)).to.be.false; - }); - }); -}); diff --git a/js-old/src/api/local/transactions.js b/js-old/src/api/local/transactions.js deleted file mode 100644 index 421e730123d..00000000000 --- a/js-old/src/api/local/transactions.js +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { toHex } from '../util/format'; -import { TransportError } from '../transport'; - -const AWAITING = Symbol('awaiting'); -const LOCKED = Symbol('locked'); -const CONFIRMED = Symbol('confirmed'); -const REJECTED = Symbol('rejected'); - -class Transactions { - constructor () { - this.reset(); - } - - // should only really be needed in the constructor and tests - reset () { - this._id = 1; - this._states = {}; - } - - nextId () { - return toHex(this._id++); - } - - add (tx) { - const id = this.nextId(); - - this._states[id] = { - status: AWAITING, - transaction: tx - }; - - return id; - } - - get (id) { - const state = this._states[id]; - - if (!state || state.status !== AWAITING) { - return null; - } - - return state.transaction; - } - - lock (id) { - const state = this._states[id]; - - if (!state || state.status !== AWAITING) { - throw new Error('Trying to lock an invalid transaction'); - } - - state.status = LOCKED; - } - - unlock (id) { - const state = this._states[id]; - - if (!state || state.status !== LOCKED) { - throw new Error('Trying to unlock an invalid transaction'); - } - - state.status = AWAITING; - } - - hash (id) { - const state = this._states[id]; - - if (!state) { - return null; - } - - switch (state.status) { - case REJECTED: - throw TransportError.requestRejected(); - case CONFIRMED: - return state.hash; - default: - return null; - } - } - - confirm (id, hash) { - const state = this._states[id]; - const status = state ? state.status : null; - - switch (status) { - case AWAITING: break; - case LOCKED: break; - default: throw new Error('Trying to confirm an invalid transaction'); - } - - state.hash = hash; - state.status = CONFIRMED; - } - - reject (id) { - const state = this._states[id]; - - if (!state) { - return false; - } - - state.status = REJECTED; - - return true; - } - - requestsToConfirm () { - const result = []; - - Object.keys(this._states).forEach((id) => { - const state = this._states[id]; - - if (state.status === AWAITING) { - result.push({ - id, - origin: { - signer: '0x0' - }, - payload: { - sendTransaction: state.transaction - } - }); - } - }); - - return result; - } -} - -export default new Transactions(); diff --git a/js-old/src/api/local/transactions.spec.js b/js-old/src/api/local/transactions.spec.js deleted file mode 100644 index 65f2d8ddc39..00000000000 --- a/js-old/src/api/local/transactions.spec.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import transactions from './transactions'; -import { TransportError } from '../transport/error'; - -const DUMMY_TX = 'dummy'; - -describe('api/local/transactions', () => { - beforeEach(() => { - transactions.reset(); - }); - - it('can store transactions', () => { - const id1 = transactions.add(DUMMY_TX); - const id2 = transactions.add(DUMMY_TX); - const requests = transactions.requestsToConfirm(); - - expect(id1).to.be.equal('0x1'); - expect(id2).to.be.equal('0x2'); - expect(requests.length).to.be.equal(2); - expect(requests[0].id).to.be.equal(id1); - expect(requests[1].id).to.be.equal(id2); - expect(requests[0].payload.sendTransaction).to.be.equal(DUMMY_TX); - expect(requests[1].payload.sendTransaction).to.be.equal(DUMMY_TX); - }); - - it('can confirm transactions', () => { - const id1 = transactions.add(DUMMY_TX); - const id2 = transactions.add(DUMMY_TX); - - const hash1 = '0x1111111111111111111111111111111111111111'; - const hash2 = '0x2222222222222222222222222222222222222222'; - - transactions.confirm(id1, hash1); - transactions.confirm(id2, hash2); - - const requests = transactions.requestsToConfirm(); - - expect(requests.length).to.be.equal(0); - expect(transactions.hash(id1)).to.be.equal(hash1); - expect(transactions.hash(id2)).to.be.equal(hash2); - }); - - it('can reject transactions', () => { - const id = transactions.add(DUMMY_TX); - - transactions.reject(id); - - const requests = transactions.requestsToConfirm(); - - expect(requests.length).to.be.equal(0); - expect(() => transactions.hash(id)).to.throw(TransportError); - }); - - it('can lock and confirm transactions', () => { - const id = transactions.add(DUMMY_TX); - const hash = '0x1111111111111111111111111111111111111111'; - - transactions.lock(id); - - const requests = transactions.requestsToConfirm(); - - expect(requests.length).to.be.equal(0); - expect(transactions.get(id)).to.be.null; - expect(transactions.hash(id)).to.be.null; - - transactions.confirm(id, hash); - - expect(transactions.hash(id)).to.be.equal(hash); - }); -}); diff --git a/js-old/src/api/pubsub/eth/eth.js b/js-old/src/api/pubsub/eth/eth.js deleted file mode 100644 index 0bbc85bec39..00000000000 --- a/js-old/src/api/pubsub/eth/eth.js +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . -import PubsubBase from '../pubsubBase'; - -import { inAddress, inBlockNumber, inHex, inNumber16, inOptions, inFilter } from '../../format/input'; -import { outAddress, outBlock, outNumber, outTransaction, outSyncing, outReceipt, outLog } from '../../format/output'; - -export default class Eth extends PubsubBase { - constructor (transport) { - super(transport); - this._api = 'parity'; - } - - newHeads (callback) { - return this.addListener('eth', 'newHeads', callback); - } - - logs (callback) { - throw Error('not supported yet'); - } - - // eth API - protocolVersion (callback) { - return this.addListener(this._api, 'eth_protocolVersion', callback); - } - - syncing (callback) { - return this.addListener(this._api, 'eth_syncing', (error, data) => { - error - ? callback(error) - : callback(null, outSyncing(data)); - }); - } - - hashrate (callback) { - return this.addListener(this._api, 'eth_hashrate', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - coinbase (callback) { - return this.addListener(this._api, 'eth_coinbase', (error, data) => { - error - ? callback(error) - : callback(null, outAddress(data)); - }); - } - - mining (callback) { - return this.addListener(this._api, 'eth_mining', callback); - } - - gasPrice (callback) { - return this.addListener(this._api, 'eth_gasPrice', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - accounts (callback) { - return this.addListener(this._api, 'eth_accounts', (error, accounts) => { - error - ? callback(error) - : callback(null, (accounts || []).map(outAddress)); - }); - } - - blockNumber (callback) { - return this.addListener(this._api, 'eth_blockNumber', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - getBalance (callback, address, blockNumber = 'latest') { - return this.addListener(this._api, 'eth_getBalance', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }, [inAddress(address), inBlockNumber(blockNumber)]); - } - - getStorageAt (callback, address, index = 0, blockNumber = 'latest') { - return this.addListener(this._api, 'eth_getStorageAt', callback, [inAddress(address), inNumber16(index), inBlockNumber(blockNumber)]); - } - - getBlockByHash (callback, hash, full = false) { - return this.addListener(this._api, 'eth_getBlockByHash', (error, data) => { - error - ? callback(error) - : callback(null, outBlock(data)); - }, [inHex(hash), full]); - } - - getBlockByNumber (callback, blockNumber = 'latest', full = false) { - return this.addListener(this._api, 'eth_getBlockByNumber', (error, data) => { - error - ? callback(error) - : callback(null, outBlock(data)); - }, [inBlockNumber(blockNumber), full]); - } - - getTransactionCount (callback, address, blockNumber = 'latest') { - return this.addListener(this._api, 'eth_getTransactionCount', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }, [inAddress(address), inBlockNumber(blockNumber)]); - } - - getBlockTransactionCountByHash (callback, hash) { - return this.addListener(this._api, 'eth_getBlockTransactionCountByHash', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }, [inHex(hash)]); - } - - getBlockTransactionCountByNumber (callback, blockNumber = 'latest') { - return this.addListener(this._api, 'eth_getBlockTransactionCountByNumber', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }, [inBlockNumber(blockNumber)]); - } - - getUncleCountByBlockHash (callback, hash) { - return this.addListener(this._api, 'eth_getUncleCountByBlockHash', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }, [inHex(hash)]); - } - - getUncleCountByBlockNumber (callback, blockNumber = 'latest') { - return this.addListener(this._api, 'eth_getUncleCountByBlockNumber', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }, [inBlockNumber(blockNumber)]); - } - - getCode (callback, address, blockNumber = 'latest') { - return this.addListener(this._api, 'eth_getCode', callback, [inAddress(address), inBlockNumber(blockNumber)]); - } - - call (callback, options, blockNumber = 'latest') { - return this.addListener(this._api, 'eth_call', callback, [inOptions(options), inBlockNumber(blockNumber)]); - } - - estimateGas (callback, options) { - return this.addListener(this._api, 'eth_estimateGas', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }, [inOptions(options)]); - } - - getTransactionByHash (callback, hash) { - return this.addListener(this._api, 'eth_getTransactionByHash', (error, data) => { - error - ? callback(error) - : callback(null, outTransaction(data)); - }, [inHex(hash)]); - } - - getTransactionByBlockHashAndIndex (callback, hash, index = 0) { - return this.addListener(this._api, 'eth_getTransactionByBlockHashAndIndex', (error, data) => { - error - ? callback(error) - : callback(null, outTransaction(data)); - }, [inHex(hash), inNumber16(index)]); - } - - getTransactionByBlockNumberAndIndex (callback, blockNumber = 'latest', index = 0) { - return this.addListener(this._api, 'eth_getTransactionByBlockNumberAndIndex', (error, data) => { - error - ? callback(error) - : callback(null, outTransaction(data)); - }, [inBlockNumber(blockNumber), inNumber16(index)]); - } - - getTransactionReceipt (callback, txhash) { - return this.addListener(this._api, 'eth_getTransactionReceipt', (error, data) => { - error - ? callback(error) - : callback(null, outReceipt(data)); - }, [inHex(txhash)]); - } - - getUncleByBlockHashAndIndex (callback, hash, index = 0) { - return this.addListener(this._api, 'eth_getUncleByBlockHashAndIndex', callback, [inHex(hash), inNumber16(index)]); - } - - getUncleByBlockNumberAndIndex (callback, blockNumber = 'latest', index = 0) { - return this.addListener(this._api, 'eth_getUncleByBlockNumberAndIndex', callback, [inBlockNumber(blockNumber), inNumber16(index)]); - } - - getLogs (callback, options) { - return this.addListener(this._api, 'eth_getLogs', (error, logs) => { - error - ? callback(error) - : callback(null, (logs) => logs.map(outLog)); - }, [inFilter(options)]); - } - - getWork (callback) { - return this.addListener(this._api, 'eth_getWork', callback); - } -} diff --git a/js-old/src/api/pubsub/eth/index.js b/js-old/src/api/pubsub/eth/index.js deleted file mode 100644 index 3b8d1994c34..00000000000 --- a/js-old/src/api/pubsub/eth/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . -export default from './eth'; diff --git a/js-old/src/api/pubsub/index.js b/js-old/src/api/pubsub/index.js deleted file mode 100644 index bf342e1de95..00000000000 --- a/js-old/src/api/pubsub/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . -export default from './pubsub'; diff --git a/js-old/src/api/pubsub/net/index.js b/js-old/src/api/pubsub/net/index.js deleted file mode 100644 index 6d13847c535..00000000000 --- a/js-old/src/api/pubsub/net/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . -export default from './net'; diff --git a/js-old/src/api/pubsub/net/net.js b/js-old/src/api/pubsub/net/net.js deleted file mode 100644 index e1dc3c4e16e..00000000000 --- a/js-old/src/api/pubsub/net/net.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . -import PubsubBase from '../pubsubBase'; - -import { outNumber } from '../../format/output'; - -export default class Net extends PubsubBase { - constructor (transport) { - super(transport); - this._api = 'parity'; - } - - // net API - version (callback) { - return this.addListener(this._api, 'net_version', callback); - } - - peerCount (callback) { - return this.addListener(this._api, 'net_peerCount', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - listening (callback) { - return this.addListener(this._api, 'net_listening', callback); - } -} diff --git a/js-old/src/api/pubsub/parity/index.js b/js-old/src/api/pubsub/parity/index.js deleted file mode 100644 index 33ce7aa7fa4..00000000000 --- a/js-old/src/api/pubsub/parity/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . -export default from './parity'; diff --git a/js-old/src/api/pubsub/parity/parity.js b/js-old/src/api/pubsub/parity/parity.js deleted file mode 100644 index 6df4a920476..00000000000 --- a/js-old/src/api/pubsub/parity/parity.js +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import PubsubBase from '../pubsubBase'; -import { inAddress, inBlockNumber, inData, inHex, inDeriveHash, inDeriveIndex } from '../../format/input'; -import { outAccountInfo, outAddress, outBlock, outChainStatus, outHistogram, outHwAccountInfo, outNodeKind, outNumber, outPeers, outTransaction, outAddresses, outRecentDapps, outVaultMeta } from '../../format/output'; - -export default class Parity extends PubsubBase { - constructor (transport) { - super(transport); - this._api = 'parity'; - } - - // parity API - accountsInfo (callback) { - return this.addListener(this._api, 'parity_accountsInfo', (error, data) => { - error - ? callback(error) - : callback(null, outAccountInfo(data)); - }); - } - - hardwareAccountsInfo (callback) { - return this.addListener(this._api, 'parity_hardwareAccountsInfo', (error, data) => { - error - ? callback(error) - : callback(null, outHwAccountInfo(data)); - }); - } - - defaultAccount (callback) { - return this.addListener(this._api, 'parity_defaultAccount', (error, data) => { - error - ? callback(error) - : callback(null, outAddress(data)); - }); - } - - transactionsLimit (callback) { - return this.addListener(this._api, 'parity_transactionsLimit', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - extraData (callback) { - return this.addListener(this._api, 'parity_extraData', callback); - } - - gasFloorTarget (callback) { - return this.addListener(this._api, 'parity_gasFloorTarget', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - gasCeilTarget (callback) { - return this.addListener(this._api, 'parity_gasCeilTarget', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - minGasPrice (callback) { - return this.addListener(this._api, 'parity_minGasPrice', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - devLogs (callback) { - return this.addListener(this._api, 'parity_devLogs', callback); - } - - devLogsLevels (callback) { - return this.addListener(this._api, 'parity_devLogsLevels', callback); - } - - netChain (callback) { - return this.addListener(this._api, 'parity_netChain', callback); - } - - netPeers (callback) { - return this.addListener(this._api, 'parity_netPeers', (error, data) => { - error - ? callback(error) - : callback(null, outPeers(data)); - }); - } - - netPort (callback) { - return this.addListener(this._api, 'parity_netPort', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - rpcSettings (callback) { - return this.addListener(this._api, 'parity_rpcSettings', callback); - } - - nodeName (callback) { - return this.addListener(this._api, 'parity_nodeName', callback); - } - - defaultExtraData (callback) { - return this.addListener(this._api, 'parity_defaultExtraData', callback); - } - - gasPriceHistogram (callback) { - return this.addListener(this._api, 'parity_gasPriceHistogram', (error, data) => { - error - ? callback(error) - : callback(null, outHistogram(data)); - }); - } - - unsignedTransactionsCount (callback) { - return this.addListener(this._api, 'parity_unsignedTransactionsCount', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }); - } - - registryAddress (callback) { - return this.addListener(this._api, 'parity_registryAddress', (error, data) => { - error - ? callback(error) - : callback(null, outAddress(data)); - }); - } - - listAccounts (callback, count, offset = null, blockNumber = 'latest') { - return this.addListener(this._api, 'parity_listAccounts', (error, data) => { - error - ? callback(error) - : callback(null, (data) => (data || []).map(outAddress)); - }, [count, inAddress(offset), inBlockNumber(blockNumber)]); - } - - listStorageKeys (callback, address, count, hash = null, blockNumber = 'latest') { - return this.addListener(this._api, 'parity_listStorageKeys', callback, [inAddress(address), count, inHex(hash), inBlockNumber(blockNumber)]); - } - - pendingTransactions (callback) { - return this.addListener(this._api, 'parity_pendingTransactions', (error, data) => { - error - ? callback(error) - : callback(null, outTransaction(data)); - }); - } - - futureTransactions (callback) { - return this.addListener(this._api, 'parity_futureTransactions', (error, data) => { - error - ? callback(error) - : callback(null, outTransaction(data)); - }); - } - - pendingTransactionsStats (callback) { - return this.addListener(this._api, 'parity_pendingTransactionsStats', callback); - } - - localTransactions (callback) { - return this.addListener(this._api, 'parity_localTransactions', (error, transactions) => { - if (error) { - return callback(error); - } - - Object.values(transactions) - .filter(tx => tx.transaction) - .map(tx => { - tx.transaction = outTransaction(tx.transaction); - }); - - callback(null, transactions); - }); - } - - dappsUrl (callback) { - return this.addListener(this._api, 'parity_dappsUrl', callback); - } - - wsUrl (callback) { - return this.addListener(this._api, 'parity_wsUrl', callback); - } - - nextNonce (callback, account) { - return this.addListener(this._api, 'parity_nextNonce', (error, data) => { - error - ? callback(error) - : callback(null, outNumber(data)); - }, [inAddress(account)]); - } - - mode (callback) { - return this.addListener(this._api, 'parity_mode', callback); - } - - chain (callback) { - return this.addListener(this._api, 'parity_chain', callback); - } - - enode (callback) { - return this.addListener(this._api, 'parity_enode', callback); - } - - consensusCapability (callback) { - return this.addListener(this._api, 'parity_consensusCapability', callback); - } - - versionInfo (callback) { - return this.addListener(this._api, 'parity_versionInfo', callback); - } - - releasesInfo (callback) { - return this.addListener(this._api, 'parity_releasesInfo', callback); - } - - chainStatus (callback) { - return this.addListener(this._api, 'parity_chainStatus', (error, data) => { - error - ? callback(error) - : callback(null, outChainStatus(data)); - }); - } - - nodeKind (callback) { - return this.addListener(this._api, 'parity_nodeKind', (error, data) => { - error - ? callback(error) - : callback(null, outNodeKind(data)); - }); - } - - getBlockHeaderByNumber (callback, blockNumber = 'latest') { - return this.addListener(this._api, 'parity_getBlockHeaderByNumber', (error, data) => { - error - ? callback(error) - : callback(null, outBlock(data)); - }, [inBlockNumber(blockNumber)]); - } - - cidV0 (callback, data) { - return this.addListener(this._api, 'parity_cidV0', callback, [inData(data)]); - } - - // parity accounts API (only secure API or configured to be exposed) - allAccountsInfo (callback) { - return this._addListener(this._api, 'parity_allAccountsInfo', (error, data) => { - error - ? callback(error) - : callback(null, outAccountInfo(data)); - }); - } - - getDappAddresses (callback, dappId) { - return this._addListener(this._api, 'parity_getDappAddresses', (error, data) => { - error - ? callback(error) - : callback(null, outAddresses(data)); - }, [dappId]); - } - - getDappDefaultAddress (callback, dappId) { - return this._addListener(this._api, 'parity_getDappDefaultAddress', (error, data) => { - error - ? callback(error) - : callback(null, outAddress(data)); - }, [dappId]); - } - - getNewDappsAddresses (callback) { - return this._addListener(this._api, 'parity_getDappDefaultAddress', (error, addresses) => { - error - ? callback(error) - : callback(null, addresses ? addresses.map(outAddress) : null); - }); - } - - getNewDappsDefaultAddress (callback) { - return this._addListener(this._api, 'parity_getNewDappsDefaultAddress', (error, data) => { - error - ? callback(error) - : callback(null, outAddress(data)); - }); - } - - listRecentDapps (callback) { - return this._addListener(this._api, 'parity_listRecentDapps', (error, data) => { - error - ? callback(error) - : callback(null, outRecentDapps(data)); - }); - } - - listGethAccounts (callback) { - return this._addListener(this._api, 'parity_listGethAccounts', (error, data) => { - error - ? callback(error) - : callback(null, outAddresses(data)); - }); - } - - listVaults (callback) { - return this._addListener(this._api, 'parity_listVaults', callback); - } - - listOpenedVaults (callback) { - return this._addListener(this._api, 'parity_listOpenedVaults', callback); - } - - getVaultMeta (callback, vaultName) { - return this._addListener(this._api, 'parity_getVaultMeta', (error, data) => { - error - ? callback(error) - : callback(null, outVaultMeta(data)); - }, [vaultName]); - } - - deriveAddressHash (callback, address, password, hash, shouldSave) { - return this._addListener(this._api, 'parity_deriveAddressHash', (error, data) => { - error - ? callback(error) - : callback(null, outAddress(data)); - }, [inAddress(address), password, inDeriveHash(hash), !!shouldSave]); - } - - deriveAddressIndex (callback, address, password, index, shouldSave) { - return this._addListener(this._api, 'parity_deriveAddressIndex', (error, data) => { - error - ? callback(error) - : callback(null, outAddress(data)); - }, [inAddress(address), password, inDeriveIndex(index), !!shouldSave]); - } -} diff --git a/js-old/src/api/pubsub/pubsub.js b/js-old/src/api/pubsub/pubsub.js deleted file mode 100644 index edbc201ae5c..00000000000 --- a/js-old/src/api/pubsub/pubsub.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Eth from './eth'; -import Parity from './parity'; -import Net from './net'; - -import { isFunction } from '../util/types'; - -export default class Pubsub { - constructor (transport) { - if (!transport || !isFunction(transport.subscribe)) { - throw new Error('Pubsub API needs transport with subscribe() function defined. (WebSocket)'); - } - - this._eth = new Eth(transport); - this._net = new Net(transport); - this._parity = new Parity(transport); - } - - get net () { - return this._net; - } - - get eth () { - return this._eth; - } - - get parity () { - return this._parity; - } - - unsubscribe (subscriptionIds) { - // subscriptions are namespace independent. Thus we can simply removeListener from any. - return this._parity.removeListener(subscriptionIds); - } -} diff --git a/js-old/src/api/pubsub/pubsub.spec.js b/js-old/src/api/pubsub/pubsub.spec.js deleted file mode 100644 index 10fcd2edb7a..00000000000 --- a/js-old/src/api/pubsub/pubsub.spec.js +++ /dev/null @@ -1,613 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; -import { TEST_WS_URL, mockWs } from '../../../test/mockRpc'; -import { isBigNumber } from '../../../test/types'; - -import Ws from '../transport/ws'; -import Pubsub from './pubsub'; - -describe('api/pubsub/Pubsub', () => { - let scope; - let instance; - const address = '0x63Cf90D3f0410092FC0fca41846f596223979195'; - - describe('accountsInfo', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: { - '0x63cf90d3f0410092fc0fca41846f596223979195': { - name: 'name', uuid: 'uuid', meta: '{"data":"data"}' - } - }, - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('retrieves the available account info', (done) => { - instance.parity.accountsInfo((error, result) => { - expect(error).to.be.null; - expect(result).to.deep.equal({ - '0x63Cf90D3f0410092FC0fca41846f596223979195': { - name: 'name', uuid: 'uuid', meta: { - data: 'data' - } - } - }); - done(); - }); - }); - }); - - describe('Unsubscribe', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2 }, - { method: 'parity_unsubscribe', reply: true }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('Promise gets resolved on success.', (done) => { - instance.parity.accountsInfo().then(s => { - instance.parity.unsubscribe(s).then(b => { - expect(b).to.be.true; - }); - }); - done(); - }); - }); - - describe('chainStatus', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: { - 'blockGap': [0x123, 0x456] - }, - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('retrieves the chain status', (done) => { - instance.parity.chainStatus((error, result) => { - expect(error).to.be.null; - expect(result).to.deep.equal({ - 'blockGap': [new BigNumber(0x123), new BigNumber(0x456)] - }); - done(); - }); - }); - }); - - describe('gasFloorTarget', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: '0x123456', - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns the gasfloor, formatted', (done) => { - instance.parity.gasFloorTarget((error, result) => { - expect(error).to.be.null; - expect(isBigNumber(result)).to.be.true; - expect(result.eq(0x123456)).to.be.true; - done(); - }); - }); - }); - - describe('transactionsLimit', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: 1024, - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns the tx limit, formatted', (done) => { - instance.parity.transactionsLimit((error, result) => { - expect(error).to.be.null; - expect(isBigNumber(result)).to.be.true; - expect(result.eq(1024)).to.be.true; - done(); - }); - }); - }); - - describe('minGasPrice', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: '0x123456', - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns the min gasprice, formatted', (done) => { - instance.parity.minGasPrice((error, result) => { - expect(error).to.be.null; - expect(isBigNumber(result)).to.be.true; - expect(result.eq(0x123456)).to.be.true; - done(); - }); - }); - }); - - describe('netPeers', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: { active: 123, connected: 456, max: 789, peers: [] }, - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns the peer structure, formatted', (done) => { - instance.parity.netPeers((error, peers) => { - expect(error).to.be.null; - expect(peers.active.eq(123)).to.be.true; - expect(peers.connected.eq(456)).to.be.true; - expect(peers.max.eq(789)).to.be.true; - done(); - }); - }); - }); - - describe('netPort', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: 33030, - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns the connected port, formatted', (done) => { - instance.parity.netPort((error, count) => { - expect(error).to.be.null; - expect(isBigNumber(count)).to.be.true; - expect(count.eq(33030)).to.be.true; - done(); - }); - }); - }); - -// Eth API - describe('accounts', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: [address.toLowerCase()], - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns a list of accounts, formatted', (done) => { - instance.eth.accounts((error, accounts) => { - expect(error).to.be.null; - expect(accounts).to.deep.equal([address]); - done(); - }); - }); - }); - - describe('newHeads', () => { - beforeEach(() => { - scope = mockWs([{ method: 'eth_subscribe', reply: 2, subscription: { - method: 'eth_subscription', - params: { - result: '0x123456', - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns newHeads for eth_subscribe', (done) => { - instance.eth.newHeads((error, blockNumber) => { - expect(error).to.be.null; - expect(blockNumber).to.equal('0x123456'); - done(); - }); - }); - }); - - describe('blockNumber', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: '0x123456', - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns the current blockNumber, formatted', (done) => { - instance.eth.blockNumber((error, blockNumber) => { - expect(error).to.be.null; - expect(isBigNumber(blockNumber)).to.be.true; - expect(blockNumber.toString(16)).to.equal('123456'); - done(); - }); - }); - }); - - describe('call', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: [], - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('formats the input options & blockNumber', (done) => { - instance.eth.call((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_call', [{ data: '0x12345678' }, 'earliest']]); - done(); - }, { data: '12345678' }, 'earliest'); - }); - - it('provides a latest blockNumber when not specified', (done) => { - instance.eth.call((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_call', [{ data: '0x12345678' }, 'latest']]); - done(); - }, { data: '12345678' }); - }); - }); - - describe('coinbase', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: address.toLowerCase(), - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns the coinbase, formatted', (done) => { - instance.eth.coinbase((error, account) => { - expect(error).to.be.null; - expect(account).to.deep.equal(address); - done(); - }); - }); - }); - - describe('estimateGas', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: '0x123', - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('converts the options correctly', (done) => { - instance.eth.estimateGas((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_estimateGas', [{ gas: '0x5208' }]]); - done(); - }, { gas: 21000 }); - }); - - it('returns the gas used, formatted', (done) => { - instance.eth.estimateGas((error, gas) => { - expect(error).to.be.null; - expect(isBigNumber(gas)).to.be.true; - expect(gas.toString(16)).to.deep.equal('123'); - done(); - }); - }); - }); - - describe('gasPrice', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: '0x123', - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns the gas price, formatted', (done) => { - instance.eth.gasPrice((error, price) => { - expect(error).to.be.null; - expect(isBigNumber(price)).to.be.true; - expect(price.toString(16)).to.deep.equal('123'); - done(); - }); - }); - }); - - describe('getBalance', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: '0x123', - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('passes in the address (default blockNumber)', (done) => { - instance.eth.getBalance((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_getBalance', [address.toLowerCase(), 'latest']]); - done(); - }, address); - }); - - it('passes in the address & blockNumber', (done) => { - instance.eth.getBalance((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_getBalance', [address.toLowerCase(), '0x456']]); - done(); - }, address, 0x456); - }); - - it('returns the balance', (done) => { - instance.eth.getBalance((error, balance) => { - expect(error).to.be.null; - expect(isBigNumber(balance)).to.be.true; - expect(balance.toString(16)).to.deep.equal('123'); - done(); - }, address); - }); - }); - - describe('getBlockByHash', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: { miner: address.toLowerCase() }, - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('formats the input hash as a hash, default full', (done) => { - instance.eth.getBlockByHash((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_getBlockByHash', ['0x1234', false]]); - done(); - }, '1234'); - }); - - it('formats the input hash as a hash, full true', (done) => { - instance.eth.getBlockByHash((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_getBlockByHash', ['0x1234', true]]); - done(); - }, '1234', true); - }); - - it('formats the output into block', (done) => { - instance.eth.getBlockByHash((error, block) => { - expect(error).to.be.null; - expect(block.miner).to.equal(address); - done(); - }, '1234'); - }); - }); - - describe('getBlockByNumber', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: { miner: address.toLowerCase() }, - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('assumes blockNumber latest & full false', (done) => { - instance.eth.getBlockByNumber((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_getBlockByNumber', ['latest', false]]); - done(); - }); - }); - - it('uses input blockNumber & full false', (done) => { - instance.eth.getBlockByNumber((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_getBlockByNumber', ['0x1234', false]]); - done(); - }, '0x1234'); - }); - - it('formats the input blockNumber, full true', (done) => { - instance.eth.getBlockByNumber((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_getBlockByNumber', ['0x1234', true]]); - done(); - }, 0x1234, true); - }); - - it('formats the output into block', (done) => { - instance.eth.getBlockByNumber((error, block) => { - expect(error).to.be.null; - expect(block.miner).to.equal(address); - done(); - }, 0x1234); - }); - }); - - describe('getTransactionCount', () => { - beforeEach(() => { - scope = mockWs([{ method: 'parity_subscribe', reply: 2, subscription: { - method: 'parity_subscription', - params: { - result: '0x123', - subscription: 2 - } - } }]); - instance = new Pubsub(new Ws(TEST_WS_URL)); - }); - - afterEach(() => { - scope.stop(); - }); - - it('passes in the address (default blockNumber)', (done) => { - instance.eth.getTransactionCount((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_getTransactionCount', [address.toLowerCase(), 'latest']]); - done(); - }, address); - }); - - it('passes in the address & blockNumber', (done) => { - instance.eth.getTransactionCount((error) => { - expect(error).to.be.null; - expect(scope.body.parity_subscribe.params).to.deep.equal(['eth_getTransactionCount', [address.toLowerCase(), '0x456']]); - done(); - }, address, 0x456); - }); - - it('returns the count, formatted', (done) => { - instance.eth.getTransactionCount((error, count) => { - expect(error).to.be.null; - expect(isBigNumber(count)).to.be.true; - expect(count.toString(16)).to.equal('123'); - done(); - }, address, 0x456); - }); - }); -}); diff --git a/js-old/src/api/pubsub/pubsubBase.js b/js-old/src/api/pubsub/pubsubBase.js deleted file mode 100644 index fcc7525d5b8..00000000000 --- a/js-old/src/api/pubsub/pubsubBase.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default class PubsubBase { - // Provider for websocket pubsub transport - constructor (transport) { - this._transport = transport; - } - - addListener (module, eventName, callback, eventParams) { - return eventParams - ? this._transport.subscribe(module, callback, eventName, eventParams) - : this._transport.subscribe(module, callback, eventName, []); - // this._transport.subscribe(module, callback, eventName); After Patch from tomac is merged to master! => eth_subscribe does not support empty array as params - } - - removeListener (subscriptionIds) { - return this._transport.unsubscribe(subscriptionIds); - } - - unsubscribe (subscriptionIds) { - return this.removeListener(subscriptionIds); - } -} diff --git a/js-old/src/api/rpc/db/db.js b/js-old/src/api/rpc/db/db.js deleted file mode 100644 index c87911b8d76..00000000000 --- a/js-old/src/api/rpc/db/db.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { inHex } from '../../format/input'; - -export default class Db { - constructor (transport) { - this._transport = transport; - } - - getHex (dbName, keyName) { - return this._transport - .execute('db_getHex', dbName, keyName); - } - - getString (dbName, keyName) { - return this._transport - .execute('db_getString', dbName, keyName); - } - - putHex (dbName, keyName, hexData) { - return this._transport - .execute('db_putHex', dbName, keyName, inHex(hexData)); - } - - putString (dbName, keyName, stringData) { - return this._transport - .execute('db_putString', dbName, keyName, stringData); - } -} diff --git a/js-old/src/api/rpc/db/db.spec.js b/js-old/src/api/rpc/db/db.spec.js deleted file mode 100644 index 94256931b97..00000000000 --- a/js-old/src/api/rpc/db/db.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { TEST_HTTP_URL, mockHttp } from '../../../../test/mockRpc'; - -import Http from '../../transport/http'; -import Db from './db'; - -const instance = new Db(new Http(TEST_HTTP_URL, -1)); - -describe('api/rpc/Db', () => { - let scope; - - describe('putHex', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'db_putHex', reply: { result: [] } }]); - }); - - it('formats the inputs correctly', () => { - return instance.putHex('db', 'key', '1234').then(() => { - expect(scope.body.db_putHex.params).to.deep.equal(['db', 'key', '0x1234']); - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/db/index.js b/js-old/src/api/rpc/db/index.js deleted file mode 100644 index 0dc25441b61..00000000000 --- a/js-old/src/api/rpc/db/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './db'; diff --git a/js-old/src/api/rpc/eth/eth.e2e.js b/js-old/src/api/rpc/eth/eth.e2e.js deleted file mode 100644 index 1c8d95a0b97..00000000000 --- a/js-old/src/api/rpc/eth/eth.e2e.js +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { createHttpApi } from '../../../../test/e2e/ethapi'; -import { isAddress } from '../../../../test/types'; - -describe('ethapi.eth', () => { - const ethapi = createHttpApi(); - const address = '0x63cf90d3f0410092fc0fca41846f596223979195'; - - let latestBlockNumber; - let latestBlockHash; - - describe('accounts', () => { - it('returns the available accounts', () => { - return ethapi.eth.accounts().then((accounts) => { - accounts.forEach((account) => { - expect(isAddress(account)).to.be.true; - }); - }); - }); - }); - - describe('blockNumber', () => { - it('returns the current blockNumber', () => { - return ethapi.eth.blockNumber().then((blockNumber) => { - latestBlockNumber = blockNumber; - expect(blockNumber.gt(0xabcde)).to.be.true; - }); - }); - }); - - describe('coinbase', () => { - it('returns the coinbase', () => { - return ethapi.eth.coinbase().then((coinbase) => { - expect(isAddress(coinbase)).to.be.true; - }); - }); - }); - - describe('gasPrice', () => { - it('returns the current gasPrice', () => { - return ethapi.eth.gasPrice().then((gasPrice) => { - expect(gasPrice.gt(0)).to.be.true; - }); - }); - }); - - describe('getBalance', () => { - it('returns the balance for latest block', () => { - return ethapi.eth.getBalance(address).then((balance) => { - expect(balance.gt(0)).to.be.true; - }); - }); - - it('returns the balance for a very early block', () => { - const atBlock = '0x65432'; - const atValue = '18e07120a6e164fee1b'; - - return ethapi.eth - .getBalance(address, atBlock) - .then((balance) => { - expect(balance.toString(16)).to.equal(atValue); - }) - .catch((error) => { - // Parity doesn't support pruned-before-block balance lookups - expect(error.message).to.match(/not supported/); - }); - }); - - it('returns the balance for a recent/out-of-pruning-range block', () => { - return ethapi.eth - .getBalance(address, latestBlockNumber.minus(1000)) - .then((balance) => { - expect(balance.gt(0)).to.be.true; - }); - }); - }); - - describe('getBlockByNumber', () => { - it('returns the latest block', () => { - return ethapi.eth.getBlockByNumber().then((block) => { - expect(block).to.be.ok; - }); - }); - - it('returns a block by blockNumber', () => { - return ethapi.eth.getBlockByNumber(latestBlockNumber).then((block) => { - latestBlockHash = block.hash; - expect(block).to.be.ok; - }); - }); - - it('returns a block by blockNumber (full)', () => { - return ethapi.eth.getBlockByNumber(latestBlockNumber, true).then((block) => { - expect(block).to.be.ok; - }); - }); - }); - - describe('getBlockByHash', () => { - it('returns the specified block', () => { - return ethapi.eth.getBlockByHash(latestBlockHash).then((block) => { - expect(block).to.be.ok; - expect(block.hash).to.equal(latestBlockHash); - }); - }); - - it('returns the specified block (full)', () => { - return ethapi.eth.getBlockByHash(latestBlockHash, true).then((block) => { - expect(block).to.be.ok; - expect(block.hash).to.equal(latestBlockHash); - }); - }); - }); - - describe('getBlockTransactionCountByHash', () => { - it('returns the transactions of the specified hash', () => { - return ethapi.eth.getBlockTransactionCountByHash(latestBlockHash).then((count) => { - expect(count).to.be.ok; - expect(count.gte(0)).to.be.true; - }); - }); - }); - - describe('getBlockTransactionCountByNumber', () => { - it('returns the transactions of latest', () => { - return ethapi.eth.getBlockTransactionCountByNumber().then((count) => { - expect(count).to.be.ok; - expect(count.gte(0)).to.be.true; - }); - }); - - it('returns the transactions of a specified number', () => { - return ethapi.eth.getBlockTransactionCountByNumber(latestBlockNumber).then((count) => { - expect(count).to.be.ok; - expect(count.gte(0)).to.be.true; - }); - }); - }); - - describe('getTransactionCount', () => { - it('returns the count for an address', () => { - return ethapi.eth.getTransactionCount(address).then((count) => { - expect(count).to.be.ok; - expect(count.gte(0x1000c2)).to.be.ok; - }); - }); - - it('returns the count for an address at specified blockNumber', () => { - return ethapi.eth.getTransactionCount(address, latestBlockNumber).then((count) => { - expect(count).to.be.ok; - expect(count.gte(0x1000c2)).to.be.ok; - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/eth/eth.js b/js-old/src/api/rpc/eth/eth.js deleted file mode 100644 index ffde938ea95..00000000000 --- a/js-old/src/api/rpc/eth/eth.js +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { inAddress, inBlockNumber, inData, inFilter, inHash, inHex, inNumber16, inOptions } from '../../format/input'; -import { outAddress, outBlock, outLog, outNumber, outReceipt, outSyncing, outTransaction } from '../../format/output'; - -export default class Eth { - constructor (transport) { - this._transport = transport; - } - - accounts () { - return this._transport - .execute('eth_accounts') - .then((accounts) => (accounts || []).map(outAddress)); - } - - blockNumber () { - return this._transport - .execute('eth_blockNumber') - .then(outNumber); - } - - call (options, blockNumber = 'latest') { - return this._transport - .execute('eth_call', inOptions(options), inBlockNumber(blockNumber)); - } - - coinbase () { - return this._transport - .execute('eth_coinbase') - .then(outAddress); - } - - compileLLL (code) { - return this._transport - .execute('eth_compileLLL', inData(code)); - } - - compileSerpent (code) { - return this._transport - .execute('eth_compileSerpent', inData(code)); - } - - compileSolidity (code) { - return this._transport - .execute('eth_compileSolidity', inData(code)); - } - - estimateGas (options) { - return this._transport - .execute('eth_estimateGas', inOptions(options)) - .then(outNumber); - } - - fetchQueuedTransactions () { - return this._transport - .execute('eth_fetchQueuedTransactions'); - } - - flush () { - return this._transport - .execute('eth_flush'); - } - - gasPrice () { - return this._transport - .execute('eth_gasPrice') - .then(outNumber); - } - - getBalance (address, blockNumber = 'latest') { - return this._transport - .execute('eth_getBalance', inAddress(address), inBlockNumber(blockNumber)) - .then(outNumber); - } - - getBlockByHash (hash, full = false) { - return this._transport - .execute('eth_getBlockByHash', inHex(hash), full) - .then(outBlock); - } - - getBlockByNumber (blockNumber = 'latest', full = false) { - return this._transport - .execute('eth_getBlockByNumber', inBlockNumber(blockNumber), full) - .then(outBlock); - } - - getBlockTransactionCountByHash (hash) { - return this._transport - .execute('eth_getBlockTransactionCountByHash', inHex(hash)) - .then(outNumber); - } - - getBlockTransactionCountByNumber (blockNumber = 'latest') { - return this._transport - .execute('eth_getBlockTransactionCountByNumber', inBlockNumber(blockNumber)) - .then(outNumber); - } - - getCode (address, blockNumber = 'latest') { - return this._transport - .execute('eth_getCode', inAddress(address), inBlockNumber(blockNumber)); - } - - getCompilers () { - return this._transport - .execute('eth_getCompilers'); - } - - getFilterChanges (filterId) { - return this._transport - .execute('eth_getFilterChanges', inNumber16(filterId)) - .then((logs) => logs.map(outLog)); - } - - getFilterChangesEx (filterId) { - return this._transport - .execute('eth_getFilterChangesEx', inNumber16(filterId)); - } - - getFilterLogs (filterId) { - return this._transport - .execute('eth_getFilterLogs', inNumber16(filterId)) - .then((logs) => logs.map(outLog)); - } - - getFilterLogsEx (filterId) { - return this._transport - .execute('eth_getFilterLogsEx', inNumber16(filterId)); - } - - getLogs (options) { - return this._transport - .execute('eth_getLogs', inFilter(options)) - .then((logs) => logs.map(outLog)); - } - - getLogsEx (options) { - return this._transport - .execute('eth_getLogsEx', inFilter(options)); - } - - getStorageAt (address, index = 0, blockNumber = 'latest') { - return this._transport - .execute('eth_getStorageAt', inAddress(address), inNumber16(index), inBlockNumber(blockNumber)); - } - - getTransactionByBlockHashAndIndex (hash, index = 0) { - return this._transport - .execute('eth_getTransactionByBlockHashAndIndex', inHex(hash), inNumber16(index)) - .then(outTransaction); - } - - getTransactionByBlockNumberAndIndex (blockNumber = 'latest', index = 0) { - return this._transport - .execute('eth_getTransactionByBlockNumberAndIndex', inBlockNumber(blockNumber), inNumber16(index)) - .then(outTransaction); - } - - getTransactionByHash (hash) { - return this._transport - .execute('eth_getTransactionByHash', inHex(hash)) - .then(outTransaction); - } - - getTransactionCount (address, blockNumber = 'latest') { - return this._transport - .execute('eth_getTransactionCount', inAddress(address), inBlockNumber(blockNumber)) - .then(outNumber); - } - - getTransactionReceipt (txhash) { - return this._transport - .execute('eth_getTransactionReceipt', inHex(txhash)) - .then(outReceipt); - } - - getUncleByBlockHashAndIndex (hash, index = 0) { - return this._transport - .execute('eth_getUncleByBlockHashAndIndex', inHex(hash), inNumber16(index)); - } - - getUncleByBlockNumberAndIndex (blockNumber = 'latest', index = 0) { - return this._transport - .execute('eth_getUncleByBlockNumberAndIndex', inBlockNumber(blockNumber), inNumber16(index)); - } - - getUncleCountByBlockHash (hash) { - return this._transport - .execute('eth_getUncleCountByBlockHash', inHex(hash)) - .then(outNumber); - } - - getUncleCountByBlockNumber (blockNumber = 'latest') { - return this._transport - .execute('eth_getUncleCountByBlockNumber', inBlockNumber(blockNumber)) - .then(outNumber); - } - - getWork () { - return this._transport - .execute('eth_getWork'); - } - - hashrate () { - return this._transport - .execute('eth_hashrate') - .then(outNumber); - } - - inspectTransaction () { - return this._transport - .execute('eth_inspectTransaction'); - } - - mining () { - return this._transport - .execute('eth_mining'); - } - - newBlockFilter () { - return this._transport - .execute('eth_newBlockFilter'); - } - - newFilter (options) { - return this._transport - .execute('eth_newFilter', inFilter(options)); - } - - newFilterEx (options) { - return this._transport - .execute('eth_newFilterEx', inFilter(options)); - } - - newPendingTransactionFilter () { - return this._transport - .execute('eth_newPendingTransactionFilter'); - } - - notePassword () { - return this._transport - .execute('eth_notePassword'); - } - - pendingTransactions () { - return this._transport - .execute('eth_pendingTransactions'); - } - - protocolVersion () { - return this._transport - .execute('eth_protocolVersion'); - } - - register () { - return this._transport - .execute('eth_register'); - } - - sendRawTransaction (data) { - return this._transport - .execute('eth_sendRawTransaction', inData(data)); - } - - sendTransaction (options) { - return this._transport - .execute('eth_sendTransaction', inOptions(options)); - } - - sign (address, hash) { - return this._transport - .execute('eth_sign', inAddress(address), inHash(hash)); - } - - signTransaction (options) { - return this._transport - .execute('eth_signTransaction', inOptions(options)); - } - - submitHashrate (hashrate, clientId) { - return this._transport - .execute('eth_submitHashrate', inNumber16(hashrate), clientId); - } - - submitWork (nonce, powHash, mixDigest) { - return this._transport - .execute('eth_submitWork', inNumber16(nonce), powHash, mixDigest); - } - - syncing () { - return this._transport - .execute('eth_syncing') - .then(outSyncing); - } - - uninstallFilter (filterId) { - return this._transport - .execute('eth_uninstallFilter', inHex(filterId)); - } - - unregister () { - return this._transport - .execute('eth_unregister'); - } -} diff --git a/js-old/src/api/rpc/eth/eth.spec.js b/js-old/src/api/rpc/eth/eth.spec.js deleted file mode 100644 index 2738fd2dea7..00000000000 --- a/js-old/src/api/rpc/eth/eth.spec.js +++ /dev/null @@ -1,474 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { TEST_HTTP_URL, mockHttp } from '../../../../test/mockRpc'; -import { isBigNumber } from '../../../../test/types'; - -import Http from '../../transport/http'; -import Eth from './eth'; - -const instance = new Eth(new Http(TEST_HTTP_URL, -1)); - -describe('rpc/Eth', () => { - const address = '0x63Cf90D3f0410092FC0fca41846f596223979195'; - let scope; - - describe('accounts', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_accounts', reply: { result: [address.toLowerCase()] } }]); - }); - - it('returns a list of accounts, formatted', () => { - return instance.accounts().then((accounts) => { - expect(accounts).to.deep.equal([address]); - }); - }); - }); - - describe('blockNumber', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_blockNumber', reply: { result: '0x123456' } }]); - }); - - it('returns the current blockNumber, formatted', () => { - return instance.blockNumber().then((blockNumber) => { - expect(isBigNumber(blockNumber)).to.be.true; - expect(blockNumber.toString(16)).to.equal('123456'); - }); - }); - }); - - describe('call', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_call', reply: { result: [] } }]); - }); - - it('formats the input options & blockNumber', () => { - return instance.call({ data: '12345678' }, 'earliest').then(() => { - expect(scope.body.eth_call.params).to.deep.equal([{ data: '0x12345678' }, 'earliest']); - }); - }); - - it('provides a latest blockNumber when not specified', () => { - return instance.call({ data: '12345678' }).then(() => { - expect(scope.body.eth_call.params).to.deep.equal([{ data: '0x12345678' }, 'latest']); - }); - }); - }); - - describe('coinbase', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_coinbase', reply: { result: address.toLowerCase() } }]); - }); - - it('returns the coinbase, formatted', () => { - return instance.coinbase().then((account) => { - expect(account).to.deep.equal(address); - }); - }); - }); - - ['LLL', 'Serpent', 'Solidity'].forEach((type) => { - const method = `compile${type}`; - - describe(method, () => { - beforeEach(() => { - scope = mockHttp([{ method: `eth_${method}`, reply: { result: '0x123' } }]); - }); - - it('formats the input as data, returns the output', () => { - return instance[method]('0xabcdef').then((result) => { - expect(scope.body[`eth_${method}`].params).to.deep.equal(['0xabcdef']); - expect(result).to.equal('0x123'); - }); - }); - }); - }); - - describe('estimateGas', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_estimateGas', reply: { result: '0x123' } }]); - }); - - it('converts the options correctly', () => { - return instance.estimateGas({ gas: 21000 }).then(() => { - expect(scope.body.eth_estimateGas.params).to.deep.equal([{ gas: '0x5208' }]); - }); - }); - - it('returns the gas used', () => { - return instance.estimateGas({}).then((gas) => { - expect(isBigNumber(gas)).to.be.true; - expect(gas.toString(16)).to.deep.equal('123'); - }); - }); - }); - - describe('gasPrice', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_gasPrice', reply: { result: '0x123' } }]); - }); - - it('returns the fomratted price', () => { - return instance.gasPrice().then((price) => { - expect(isBigNumber(price)).to.be.true; - expect(price.toString(16)).to.deep.equal('123'); - }); - }); - }); - - describe('getBalance', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getBalance', reply: { result: '0x123' } }]); - }); - - it('passes in the address (default blockNumber)', () => { - return instance.getBalance(address).then(() => { - expect(scope.body.eth_getBalance.params).to.deep.equal([address.toLowerCase(), 'latest']); - }); - }); - - it('passes in the address & blockNumber', () => { - return instance.getBalance(address, 0x456).then(() => { - expect(scope.body.eth_getBalance.params).to.deep.equal([address.toLowerCase(), '0x456']); - }); - }); - - it('returns the balance', () => { - return instance.getBalance(address, 0x123).then((balance) => { - expect(isBigNumber(balance)).to.be.true; - expect(balance.toString(16)).to.deep.equal('123'); - }); - }); - }); - - describe('getBlockByHash', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getBlockByHash', reply: { result: { miner: address.toLowerCase() } } }]); - }); - - it('formats the input hash as a hash, default full', () => { - return instance.getBlockByHash('1234').then(() => { - expect(scope.body.eth_getBlockByHash.params).to.deep.equal(['0x1234', false]); - }); - }); - - it('formats the input hash as a hash, full true', () => { - return instance.getBlockByHash('1234', true).then(() => { - expect(scope.body.eth_getBlockByHash.params).to.deep.equal(['0x1234', true]); - }); - }); - - it('formats the output into block', () => { - return instance.getBlockByHash('1234').then((block) => { - expect(block.miner).to.equal(address); - }); - }); - }); - - describe('getBlockByNumber', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getBlockByNumber', reply: { result: { miner: address.toLowerCase() } } }]); - }); - - it('assumes blockNumber latest & full false', () => { - return instance.getBlockByNumber().then(() => { - expect(scope.body.eth_getBlockByNumber.params).to.deep.equal(['latest', false]); - }); - }); - - it('uses input blockNumber & full false', () => { - return instance.getBlockByNumber('0x1234').then(() => { - expect(scope.body.eth_getBlockByNumber.params).to.deep.equal(['0x1234', false]); - }); - }); - - it('formats the input blockNumber, full true', () => { - return instance.getBlockByNumber(0x1234, true).then(() => { - expect(scope.body.eth_getBlockByNumber.params).to.deep.equal(['0x1234', true]); - }); - }); - - it('formats the output into block', () => { - return instance.getBlockByNumber(0x1234).then((block) => { - expect(block.miner).to.equal(address); - }); - }); - }); - - describe('getBlockTransactionCountByHash', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getBlockTransactionCountByHash', reply: { result: '0x123' } }]); - }); - - it('formats input hash properly', () => { - return instance.getBlockTransactionCountByHash('abcdef').then(() => { - expect(scope.body.eth_getBlockTransactionCountByHash.params).to.deep.equal(['0xabcdef']); - }); - }); - - it('formats the output number', () => { - return instance.getBlockTransactionCountByHash('0x1234').then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.toString(16)).to.equal('123'); - }); - }); - }); - - describe('getBlockTransactionCountByNumber', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getBlockTransactionCountByNumber', reply: { result: '0x123' } }]); - }); - - it('specified blockNumber latest when none specified', () => { - return instance.getBlockTransactionCountByNumber().then(() => { - expect(scope.body.eth_getBlockTransactionCountByNumber.params).to.deep.equal(['latest']); - }); - }); - - it('formats input blockNumber properly', () => { - return instance.getBlockTransactionCountByNumber(0xabcdef).then(() => { - expect(scope.body.eth_getBlockTransactionCountByNumber.params).to.deep.equal(['0xabcdef']); - }); - }); - - it('formats the output number', () => { - return instance.getBlockTransactionCountByNumber('0x1234').then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.toString(16)).to.equal('123'); - }); - }); - }); - - describe('getCode', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getCode', reply: { result: '0x1234567890' } }]); - }); - - it('passes in the address (default blockNumber)', () => { - return instance.getCode(address).then(() => { - expect(scope.body.eth_getCode.params).to.deep.equal([address.toLowerCase(), 'latest']); - }); - }); - - it('passes in the address & blockNumber', () => { - return instance.getCode(address, 0x456).then(() => { - expect(scope.body.eth_getCode.params).to.deep.equal([address.toLowerCase(), '0x456']); - }); - }); - - it('returns the code', () => { - return instance.getCode(address, 0x123).then((code) => { - expect(code).to.equal('0x1234567890'); - }); - }); - }); - - describe('getStorageAt', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getStorageAt', reply: { result: '0x1234567890' } }]); - }); - - it('passes in the address (default index& blockNumber)', () => { - return instance.getStorageAt(address).then(() => { - expect(scope.body.eth_getStorageAt.params).to.deep.equal([address.toLowerCase(), '0x0', 'latest']); - }); - }); - - it('passes in the address, index & blockNumber', () => { - return instance.getStorageAt(address, 15, 0x456).then(() => { - expect(scope.body.eth_getStorageAt.params).to.deep.equal([address.toLowerCase(), '0xf', '0x456']); - }); - }); - - it('returns the storage', () => { - return instance.getStorageAt(address, 0x123).then((storage) => { - expect(storage).to.equal('0x1234567890'); - }); - }); - }); - - describe('getTransactionByBlockHashAndIndex', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getTransactionByBlockHashAndIndex', reply: { result: { to: address.toLowerCase() } } }]); - }); - - it('passes in the hash (default index)', () => { - return instance.getTransactionByBlockHashAndIndex('12345').then(() => { - expect(scope.body.eth_getTransactionByBlockHashAndIndex.params).to.deep.equal(['0x12345', '0x0']); - }); - }); - - it('passes in the hash & specified index', () => { - return instance.getTransactionByBlockHashAndIndex('6789', 0x456).then(() => { - expect(scope.body.eth_getTransactionByBlockHashAndIndex.params).to.deep.equal(['0x6789', '0x456']); - }); - }); - - it('returns the formatted transaction', () => { - return instance.getTransactionByBlockHashAndIndex('6789', 0x123).then((tx) => { - expect(tx).to.deep.equal({ to: address }); - }); - }); - }); - - describe('getTransactionByBlockNumberAndIndex', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getTransactionByBlockNumberAndIndex', reply: { result: { to: address.toLowerCase() } } }]); - }); - - it('passes in the default parameters', () => { - return instance.getTransactionByBlockNumberAndIndex().then(() => { - expect(scope.body.eth_getTransactionByBlockNumberAndIndex.params).to.deep.equal(['latest', '0x0']); - }); - }); - - it('passes in the blockNumber & specified index', () => { - return instance.getTransactionByBlockNumberAndIndex('0x6789', 0x456).then(() => { - expect(scope.body.eth_getTransactionByBlockNumberAndIndex.params).to.deep.equal(['0x6789', '0x456']); - }); - }); - - it('returns the formatted transaction', () => { - return instance.getTransactionByBlockNumberAndIndex('0x6789', 0x123).then((tx) => { - expect(tx).to.deep.equal({ to: address }); - }); - }); - }); - - describe('getTransactionByHash', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getTransactionByHash', reply: { result: { to: address.toLowerCase() } } }]); - }); - - it('passes in the hash', () => { - return instance.getTransactionByHash('12345').then(() => { - expect(scope.body.eth_getTransactionByHash.params).to.deep.equal(['0x12345']); - }); - }); - - it('returns the formatted transaction', () => { - return instance.getTransactionByHash('6789').then((tx) => { - expect(tx).to.deep.equal({ to: address }); - }); - }); - }); - - describe('getTransactionCount', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getTransactionCount', reply: { result: '0x123' } }]); - }); - - it('passes in the address (default blockNumber)', () => { - return instance.getTransactionCount(address).then(() => { - expect(scope.body.eth_getTransactionCount.params).to.deep.equal([address.toLowerCase(), 'latest']); - }); - }); - - it('passes in the address & blockNumber', () => { - return instance.getTransactionCount(address, 0x456).then(() => { - expect(scope.body.eth_getTransactionCount.params).to.deep.equal([address.toLowerCase(), '0x456']); - }); - }); - - it('returns the count, formatted', () => { - return instance.getTransactionCount(address, 0x123).then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.toString(16)).to.equal('123'); - }); - }); - }); - - describe('getUncleByBlockHashAndIndex', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getUncleByBlockHashAndIndex', reply: { result: [] } }]); - }); - - it('passes in the hash (default index)', () => { - return instance.getUncleByBlockHashAndIndex('12345').then(() => { - expect(scope.body.eth_getUncleByBlockHashAndIndex.params).to.deep.equal(['0x12345', '0x0']); - }); - }); - - it('passes in the hash & specified index', () => { - return instance.getUncleByBlockHashAndIndex('6789', 0x456).then(() => { - expect(scope.body.eth_getUncleByBlockHashAndIndex.params).to.deep.equal(['0x6789', '0x456']); - }); - }); - }); - - describe('getUncleByBlockNumberAndIndex', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getUncleByBlockNumberAndIndex', reply: { result: [] } }]); - }); - - it('passes in the default parameters', () => { - return instance.getUncleByBlockNumberAndIndex().then(() => { - expect(scope.body.eth_getUncleByBlockNumberAndIndex.params).to.deep.equal(['latest', '0x0']); - }); - }); - - it('passes in the blockNumber & specified index', () => { - return instance.getUncleByBlockNumberAndIndex('0x6789', 0x456).then(() => { - expect(scope.body.eth_getUncleByBlockNumberAndIndex.params).to.deep.equal(['0x6789', '0x456']); - }); - }); - }); - - describe('getUncleCountByBlockHash', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getUncleCountByBlockHash', reply: { result: '0x123' } }]); - }); - - it('passes in the hash', () => { - return instance.getUncleCountByBlockHash('12345').then(() => { - expect(scope.body.eth_getUncleCountByBlockHash.params).to.deep.equal(['0x12345']); - }); - }); - - it('formats the output number', () => { - return instance.getUncleCountByBlockHash('0x1234').then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.toString(16)).to.equal('123'); - }); - }); - }); - - describe('getUncleCountByBlockNumber', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'eth_getUncleCountByBlockNumber', reply: { result: '0x123' } }]); - }); - - it('passes in the default parameters', () => { - return instance.getUncleCountByBlockNumber().then(() => { - expect(scope.body.eth_getUncleCountByBlockNumber.params).to.deep.equal(['latest']); - }); - }); - - it('passes in the blockNumber', () => { - return instance.getUncleCountByBlockNumber('0x6789').then(() => { - expect(scope.body.eth_getUncleCountByBlockNumber.params).to.deep.equal(['0x6789']); - }); - }); - - it('formats the output number', () => { - return instance.getUncleCountByBlockNumber('0x1234').then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.toString(16)).to.equal('123'); - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/eth/index.js b/js-old/src/api/rpc/eth/index.js deleted file mode 100644 index 25a7b3cb459..00000000000 --- a/js-old/src/api/rpc/eth/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './eth'; diff --git a/js-old/src/api/rpc/index.js b/js-old/src/api/rpc/index.js deleted file mode 100644 index c8fa0032bc7..00000000000 --- a/js-old/src/api/rpc/index.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export Db from './db'; -export Eth from './eth'; -export Parity from './parity'; -export Net from './net'; -export Personal from './personal'; -export Shh from './shh'; -export Signer from './signer'; -export Trace from './trace'; -export Web3 from './web3'; diff --git a/js-old/src/api/rpc/net/index.js b/js-old/src/api/rpc/net/index.js deleted file mode 100644 index 457eeed79a2..00000000000 --- a/js-old/src/api/rpc/net/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './net'; diff --git a/js-old/src/api/rpc/net/net.e2e.js b/js-old/src/api/rpc/net/net.e2e.js deleted file mode 100644 index c477e2605be..00000000000 --- a/js-old/src/api/rpc/net/net.e2e.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { createHttpApi } from '../../../../test/e2e/ethapi'; -import { isBoolean } from '../../../../test/types'; - -describe('ethapi.net', () => { - const ethapi = createHttpApi(); - - describe('listening', () => { - it('returns the listening status', () => { - return ethapi.net.listening().then((status) => { - expect(isBoolean(status)).to.be.true; - }); - }); - }); - - describe('peerCount', () => { - it('returns the peer count', () => { - return ethapi.net.peerCount().then((count) => { - expect(count.gte(0)).to.be.true; - }); - }); - }); - - describe('version', () => { - it('returns the version', () => { - return ethapi.net.version().then((version) => { - expect(version).to.be.ok; - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/net/net.js b/js-old/src/api/rpc/net/net.js deleted file mode 100644 index 9b14f69d520..00000000000 --- a/js-old/src/api/rpc/net/net.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { outNumber } from '../../format/output'; - -export default class Net { - constructor (transport) { - this._transport = transport; - } - - listening () { - return this._transport - .execute('net_listening'); - } - - peerCount () { - return this._transport - .execute('net_peerCount') - .then(outNumber); - } - - version () { - return this._transport - .execute('net_version'); - } -} diff --git a/js-old/src/api/rpc/net/net.spec.js b/js-old/src/api/rpc/net/net.spec.js deleted file mode 100644 index 07ad52076d9..00000000000 --- a/js-old/src/api/rpc/net/net.spec.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { TEST_HTTP_URL, mockHttp } from '../../../../test/mockRpc'; -import { isBigNumber } from '../../../../test/types'; - -import Http from '../../transport/http'; -import Net from './net'; - -const instance = new Net(new Http(TEST_HTTP_URL, -1)); - -describe('api/rpc/Net', () => { - describe('peerCount', () => { - it('returns the connected peers, formatted', () => { - mockHttp([{ method: 'net_peerCount', reply: { result: '0x123456' } }]); - - return instance.peerCount().then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.eq(0x123456)).to.be.true; - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/parity/index.js b/js-old/src/api/rpc/parity/index.js deleted file mode 100644 index 7fe520c606f..00000000000 --- a/js-old/src/api/rpc/parity/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './parity'; diff --git a/js-old/src/api/rpc/parity/parity.e2e.js b/js-old/src/api/rpc/parity/parity.e2e.js deleted file mode 100644 index 8820d570a64..00000000000 --- a/js-old/src/api/rpc/parity/parity.e2e.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { createHttpApi } from '../../../../test/e2e/ethapi'; - -describe('ethapi.parity', () => { - const ethapi = createHttpApi(); - - describe('chainStatus', () => { - it('returns and translates the status', () => { - return ethapi.parity.chainStatus().then((value) => { - expect(value).to.be.ok; - }); - }); - }); - - describe('gasFloorTarget', () => { - it('returns and translates the target', () => { - return ethapi.parity.gasFloorTarget().then((value) => { - expect(value.gt(0)).to.be.true; - }); - }); - }); - - describe('gasPriceHistogram', () => { - it('returns and translates the target', () => { - return ethapi.parity.gasPriceHistogram().then((result) => { - expect(Object.keys(result)).to.deep.equal(['bucketBounds', 'counts']); - expect(result.bucketBounds.length > 0).to.be.true; - expect(result.counts.length > 0).to.be.true; - }); - }); - }); - - describe('netChain', () => { - it('returns and the chain', () => { - return ethapi.parity.netChain().then((value) => { - expect(value).to.equal('morden'); - }); - }); - }); - - describe('netPort', () => { - it('returns and translates the port', () => { - return ethapi.parity.netPort().then((value) => { - expect(value.gt(0)).to.be.true; - }); - }); - }); - - describe('transactionsLimit', () => { - it('returns and translates the limit', () => { - return ethapi.parity.transactionsLimit().then((value) => { - expect(value.gt(0)).to.be.true; - }); - }); - }); - - describe('rpcSettings', () => { - it('returns and translates the settings', () => { - return ethapi.parity.rpcSettings().then((value) => { - expect(value).to.be.ok; - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/parity/parity.js b/js-old/src/api/rpc/parity/parity.js deleted file mode 100644 index 59ccb58845a..00000000000 --- a/js-old/src/api/rpc/parity/parity.js +++ /dev/null @@ -1,578 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { inAddress, inAddresses, inBlockNumber, inData, inDeriveHash, inDeriveIndex, inHex, inNumber16, inOptions } from '../../format/input'; -import { outAccountInfo, outAddress, outAddresses, outBlock, outChainStatus, outHistogram, outHwAccountInfo, outNodeKind, outNumber, outPeers, outRecentDapps, outTransaction, outVaultMeta } from '../../format/output'; - -export default class Parity { - constructor (transport) { - this._transport = transport; - } - - acceptNonReservedPeers () { - return this._transport - .execute('parity_acceptNonReservedPeers'); - } - - accountsInfo () { - return this._transport - .execute('parity_accountsInfo') - .then(outAccountInfo); - } - - allAccountsInfo () { - return this._transport - .execute('parity_allAccountsInfo') - .then(outAccountInfo); - } - - addReservedPeer (enode) { - return this._transport - .execute('parity_addReservedPeer', enode); - } - - chainStatus () { - return this._transport - .execute('parity_chainStatus') - .then(outChainStatus); - } - - changePassword (account, password, newPassword) { - return this._transport - .execute('parity_changePassword', inAddress(account), password, newPassword); - } - - changeVault (account, vaultName) { - return this._transport - .execute('parity_changeVault', inAddress(account), vaultName); - } - - changeVaultPassword (vaultName, password) { - return this._transport - .execute('parity_changeVaultPassword', vaultName, password); - } - - checkRequest (requestId) { - return this._transport - .execute('parity_checkRequest', inNumber16(requestId)); - } - - cidV0 (data) { - return this._transport - .execute('parity_cidV0', inData(data)); - } - - closeVault (vaultName) { - return this._transport - .execute('parity_closeVault', vaultName); - } - - composeTransaction (options) { - return this._transport - .execute('parity_composeTransaction', inOptions(options)); - } - - consensusCapability () { - return this._transport - .execute('parity_consensusCapability'); - } - - dappsList () { - return this._transport - .execute('parity_dappsList'); - } - - dappsRefresh () { - return this._transport - .execute('parity_dappsRefresh'); - } - - dappsUrl () { - return this._transport - .execute('parity_dappsUrl'); - } - - decryptMessage (address, data) { - return this._transport - .execute('parity_decryptMessage', inAddress(address), inHex(data)); - } - - defaultAccount () { - return this._transport - .execute('parity_defaultAccount') - .then(outAddress); - } - - defaultExtraData () { - return this._transport - .execute('parity_defaultExtraData'); - } - - devLogs () { - return this._transport - .execute('parity_devLogs'); - } - - devLogsLevels () { - return this._transport - .execute('parity_devLogsLevels'); - } - - deriveAddressHash (address, password, hash, shouldSave) { - return this._transport - .execute('parity_deriveAddressHash', inAddress(address), password, inDeriveHash(hash), !!shouldSave) - .then(outAddress); - } - - deriveAddressIndex (address, password, index, shouldSave) { - return this._transport - .execute('parity_deriveAddressIndex', inAddress(address), password, inDeriveIndex(index), !!shouldSave) - .then(outAddress); - } - - dropNonReservedPeers () { - return this._transport - .execute('parity_dropNonReservedPeers'); - } - - enode () { - return this._transport - .execute('parity_enode'); - } - - encryptMessage (pubkey, data) { - return this._transport - .execute('parity_encryptMessage', inHex(pubkey), inHex(data)); - } - - executeUpgrade () { - return this._transport - .execute('parity_executeUpgrade'); - } - - exportAccount (address, password) { - return this._transport - .execute('parity_exportAccount', inAddress(address), password); - } - - extraData () { - return this._transport - .execute('parity_extraData'); - } - - futureTransactions () { - return this._transport - .execute('parity_futureTransactions'); - } - - gasCeilTarget () { - return this._transport - .execute('parity_gasCeilTarget') - .then(outNumber); - } - - gasFloorTarget () { - return this._transport - .execute('parity_gasFloorTarget') - .then(outNumber); - } - - gasPriceHistogram () { - return this._transport - .execute('parity_gasPriceHistogram') - .then(outHistogram); - } - - generateSecretPhrase () { - return this._transport - .execute('parity_generateSecretPhrase'); - } - - getBlockHeaderByNumber (blockNumber = 'latest') { - return this._transport - .execute('parity_getBlockHeaderByNumber', inBlockNumber(blockNumber)) - .then(outBlock); - } - - getDappAddresses (dappId) { - return this._transport - .execute('parity_getDappAddresses', dappId) - .then(outAddresses); - } - - getDappDefaultAddress (dappId) { - return this._transport - .execute('parity_getDappDefaultAddress', dappId) - .then(outAddress); - } - - getNewDappsAddresses () { - return this._transport - .execute('parity_getNewDappsAddresses') - .then((addresses) => addresses ? addresses.map(outAddress) : null); - } - - getNewDappsDefaultAddress () { - return this._transport - .execute('parity_getNewDappsDefaultAddress') - .then(outAddress); - } - - getVaultMeta (vaultName) { - return this._transport - .execute('parity_getVaultMeta', vaultName) - .then(outVaultMeta); - } - - hardwareAccountsInfo () { - return this._transport - .execute('parity_hardwareAccountsInfo') - .then(outHwAccountInfo); - } - - hashContent (url) { - return this._transport - .execute('parity_hashContent', url); - } - - importGethAccounts (accounts) { - return this._transport - .execute('parity_importGethAccounts', inAddresses(accounts)) - .then(outAddresses); - } - - killAccount (account, password) { - return this._transport - .execute('parity_killAccount', inAddress(account), password); - } - - listAccounts (count, offset = null, blockNumber = 'latest') { - return this._transport - .execute('parity_listAccounts', count, inAddress(offset), inBlockNumber(blockNumber)) - .then((accounts) => (accounts || []).map(outAddress)); - } - - listOpenedVaults () { - return this._transport - .execute('parity_listOpenedVaults'); - } - - listVaults () { - return this._transport - .execute('parity_listVaults'); - } - - listRecentDapps () { - return this._transport - .execute('parity_listRecentDapps') - .then(outRecentDapps); - } - - listStorageKeys (address, count, hash = null, blockNumber = 'latest') { - return this._transport - .execute('parity_listStorageKeys', inAddress(address), count, inHex(hash), inBlockNumber(blockNumber)); - } - - removeAddress (address) { - return this._transport - .execute('parity_removeAddress', inAddress(address)); - } - - listGethAccounts () { - return this._transport - .execute('parity_listGethAccounts') - .then(outAddresses); - } - - localTransactions () { - return this._transport - .execute('parity_localTransactions') - .then(transactions => { - Object.values(transactions) - .filter(tx => tx.transaction) - .map(tx => { - tx.transaction = outTransaction(tx.transaction); - }); - return transactions; - }); - } - - minGasPrice () { - return this._transport - .execute('parity_minGasPrice') - .then(outNumber); - } - - mode () { - return this._transport - .execute('parity_mode'); - } - - // DEPRECATED - use chain instead. - netChain () { - return this._transport - .execute('parity_chain'); - } - - nodeKind () { - return this._transport - .execute('parity_nodeKind') - .then(outNodeKind); - } - - chain () { - return this._transport - .execute('parity_chain'); - } - - netPeers () { - return this._transport - .execute('parity_netPeers') - .then(outPeers); - } - - netMaxPeers () { - return this._transport - .execute('parity_netMaxPeers') - .then(outNumber); - } - - netPort () { - return this._transport - .execute('parity_netPort') - .then(outNumber); - } - - newAccountFromPhrase (phrase, password) { - return this._transport - .execute('parity_newAccountFromPhrase', phrase, password) - .then(outAddress); - } - - newAccountFromSecret (secret, password) { - return this._transport - .execute('parity_newAccountFromSecret', inHex(secret), password) - .then(outAddress); - } - - newAccountFromWallet (json, password) { - return this._transport - .execute('parity_newAccountFromWallet', json, password) - .then(outAddress); - } - - newVault (vaultName, password) { - return this._transport - .execute('parity_newVault', vaultName, password); - } - - nextNonce (account) { - return this._transport - .execute('parity_nextNonce', inAddress(account)) - .then(outNumber); - } - - nodeHealth () { - return this._transport - .execute('parity_nodeHealth'); - } - - nodeName () { - return this._transport - .execute('parity_nodeName'); - } - - openVault (vaultName, password) { - return this._transport - .execute('parity_openVault', vaultName, password); - } - - pendingTransactions () { - return this._transport - .execute('parity_pendingTransactions') - .then(data => data.map(outTransaction)); - } - - pendingTransactionsStats () { - return this._transport - .execute('parity_pendingTransactionsStats'); - } - - phraseToAddress (phrase) { - return this._transport - .execute('parity_phraseToAddress', phrase) - .then(outAddress); - } - - postSign (address, hash) { - return this._transport - .execute('parity_postSign', inAddress(address), inHex(hash)); - } - - postTransaction (options = {}) { - return this._transport - .execute('parity_postTransaction', inOptions(options)); - } - - registryAddress () { - return this._transport - .execute('parity_registryAddress') - .then(outAddress); - } - - releasesInfo () { - return this._transport - .execute('parity_releasesInfo'); - } - - removeReservedPeer (enode) { - return this._transport - .execute('parity_removeReservedPeer', enode); - } - - removeTransaction (hash) { - return this._transport - .execute('parity_removeTransaction', inHex(hash)) - .then(outTransaction); - } - - rpcSettings () { - return this._transport - .execute('parity_rpcSettings'); - } - - setAccountName (address, name) { - return this._transport - .execute('parity_setAccountName', inAddress(address), name); - } - - setAccountMeta (address, meta) { - return this._transport - .execute('parity_setAccountMeta', inAddress(address), JSON.stringify(meta)); - } - - setAuthor (address) { - return this._transport - .execute('parity_setAuthor', inAddress(address)); - } - - setDappAddresses (dappId, addresses) { - return this._transport - .execute('parity_setDappAddresses', dappId, inAddresses(addresses)); - } - - setDappDefaultAddress (dappId, address) { - return this._transport - .execute('parity_setDappDefaultAddress', dappId, address ? inAddress(address) : null); - } - - setEngineSigner (address, password) { - return this._transport - .execute('parity_setEngineSigner', inAddress(address), password); - } - - setExtraData (data) { - return this._transport - .execute('parity_setExtraData', inData(data)); - } - - setGasCeilTarget (quantity) { - return this._transport - .execute('parity_setGasCeilTarget', inNumber16(quantity)); - } - - setGasFloorTarget (quantity) { - return this._transport - .execute('parity_setGasFloorTarget', inNumber16(quantity)); - } - - setMaxTransactionGas (quantity) { - return this._transport - .execute('parity_setMaxTransactionGas', inNumber16(quantity)); - } - - setMinGasPrice (quantity) { - return this._transport - .execute('parity_setMinGasPrice', inNumber16(quantity)); - } - - setMode (mode) { - return this._transport - .execute('parity_setMode', mode); - } - - setChain (specName) { - return this._transport - .execute('parity_setChain', specName); - } - - setNewDappsAddresses (addresses) { - return this._transport - .execute('parity_setNewDappsAddresses', addresses ? inAddresses(addresses) : null); - } - - setNewDappsDefaultAddress (address) { - return this._transport - .execute('parity_setNewDappsDefaultAddress', inAddress(address)); - } - - setTransactionsLimit (quantity) { - return this._transport - .execute('parity_setTransactionsLimit', inNumber16(quantity)); - } - - setVaultMeta (vaultName, meta) { - return this._transport - .execute('parity_setVaultMeta', vaultName, JSON.stringify(meta)); - } - - signMessage (address, password, messageHash) { - return this._transport - .execute('parity_signMessage', inAddress(address), password, inHex(messageHash)); - } - - testPassword (account, password) { - return this._transport - .execute('parity_testPassword', inAddress(account), password); - } - - transactionsLimit () { - return this._transport - .execute('parity_transactionsLimit') - .then(outNumber); - } - - unsignedTransactionsCount () { - return this._transport - .execute('parity_unsignedTransactionsCount') - .then(outNumber); - } - - upgradeReady () { - return this._transport - .execute('parity_upgradeReady'); - } - - versionInfo () { - return this._transport - .execute('parity_versionInfo'); - } - - wsUrl () { - return this._transport - .execute('parity_wsUrl'); - } -} diff --git a/js-old/src/api/rpc/parity/parity.spec.js b/js-old/src/api/rpc/parity/parity.spec.js deleted file mode 100644 index 6ba7a1c83f9..00000000000 --- a/js-old/src/api/rpc/parity/parity.spec.js +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; -import { TEST_HTTP_URL, mockHttp } from '../../../../test/mockRpc'; -import { isBigNumber } from '../../../../test/types'; - -import Http from '../../transport/http'; -import Parity from './parity'; - -const instance = new Parity(new Http(TEST_HTTP_URL, -1)); - -describe('api/rpc/parity', () => { - describe('accountsInfo', () => { - it('retrieves the available account info', () => { - mockHttp([{ method: 'parity_accountsInfo', reply: { - result: { - '0x63cf90d3f0410092fc0fca41846f596223979195': { - name: 'name', uuid: 'uuid', meta: '{"data":"data"}' - } - } - } }]); - - return instance.accountsInfo().then((result) => { - expect(result).to.deep.equal({ - '0x63Cf90D3f0410092FC0fca41846f596223979195': { - name: 'name', uuid: 'uuid', meta: { - data: 'data' - } - } - }); - }); - }); - }); - - describe('chainStatus', () => { - it('retrieves the chain status', () => { - mockHttp([{ method: 'parity_chainStatus', reply: { - result: { - 'blockGap': [0x123, 0x456] - } - } }]); - - return instance.chainStatus().then((result) => { - expect(result).to.deep.equal({ - 'blockGap': [new BigNumber(0x123), new BigNumber(0x456)] - }); - }); - }); - }); - - describe('gasFloorTarget', () => { - it('returns the gasfloor, formatted', () => { - mockHttp([{ method: 'parity_gasFloorTarget', reply: { result: '0x123456' } }]); - - return instance.gasFloorTarget().then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.eq(0x123456)).to.be.true; - }); - }); - }); - - describe('importGethAccounts', () => { - const ACCOUNTS = ['0x63cf90d3f0410092fc0fca41846f596223979195']; - let scope; - - beforeEach(() => { - scope = mockHttp([{ method: 'parity_importGethAccounts', reply: { result: ACCOUNTS } }]); - }); - - it('passes the addresses through', () => { - return instance.importGethAccounts(ACCOUNTS).then((result) => { - expect(scope.body['parity_importGethAccounts'].params).to.deep.equal([ACCOUNTS]); - }); - }); - }); - - describe('minGasPrice', () => { - it('returns the min gasprice, formatted', () => { - mockHttp([{ method: 'parity_minGasPrice', reply: { result: '0x123456' } }]); - - return instance.minGasPrice().then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.eq(0x123456)).to.be.true; - }); - }); - }); - - describe('netMaxPeers', () => { - it('returns the max peers, formatted', () => { - mockHttp([{ method: 'parity_netMaxPeers', reply: { result: 25 } }]); - - return instance.netMaxPeers().then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.eq(25)).to.be.true; - }); - }); - }); - - describe('netPeers', () => { - it('returns the peer structure, formatted', () => { - mockHttp([{ method: 'parity_netPeers', reply: { result: { active: 123, connected: 456, max: 789, peers: [] } } }]); - - return instance.netPeers().then((peers) => { - expect(peers.active.eq(123)).to.be.true; - expect(peers.connected.eq(456)).to.be.true; - expect(peers.max.eq(789)).to.be.true; - }); - }); - }); - - describe('netPort', () => { - it('returns the connected port, formatted', () => { - mockHttp([{ method: 'parity_netPort', reply: { result: 33030 } }]); - - return instance.netPort().then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.eq(33030)).to.be.true; - }); - }); - }); - - describe('transactionsLimit', () => { - it('returns the tx limit, formatted', () => { - mockHttp([{ method: 'parity_transactionsLimit', reply: { result: 1024 } }]); - - return instance.transactionsLimit().then((count) => { - expect(isBigNumber(count)).to.be.true; - expect(count.eq(1024)).to.be.true; - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/personal/index.js b/js-old/src/api/rpc/personal/index.js deleted file mode 100644 index ec999344202..00000000000 --- a/js-old/src/api/rpc/personal/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './personal'; diff --git a/js-old/src/api/rpc/personal/personal.e2e.js b/js-old/src/api/rpc/personal/personal.e2e.js deleted file mode 100644 index d83e9b81114..00000000000 --- a/js-old/src/api/rpc/personal/personal.e2e.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { createHttpApi } from '../../../../test/e2e/ethapi'; -import { isAddress, isBoolean } from '../../../../test/types'; - -describe.skip('ethapi.personal', () => { - const ethapi = createHttpApi(); - const password = 'P@55word'; - let address; - - describe('newAccount', () => { - it('creates a new account', () => { - return ethapi.personal.newAccount(password).then((_address) => { - address = _address; - expect(isAddress(address)).to.be.ok; - }); - }); - }); - - describe('listAccounts', () => { - it('has the newly-created account', () => { - return ethapi.personal.listAccounts(password).then((accounts) => { - expect(accounts.filter((_address) => _address === address)).to.deep.equal([address]); - accounts.forEach((account) => { - expect(isAddress(account)).to.be.true; - }); - }); - }); - }); - - describe('unlockAccount', () => { - it('unlocks the newly-created account', () => { - return ethapi.personal.unlockAccount(address, password).then((result) => { - expect(isBoolean(result)).to.be.true; - expect(result).to.be.true; - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/personal/personal.js b/js-old/src/api/rpc/personal/personal.js deleted file mode 100644 index dd9c40f6262..00000000000 --- a/js-old/src/api/rpc/personal/personal.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { inAddress, inNumber10, inOptions } from '../../format/input'; -import { outAddress } from '../../format/output'; - -export default class Personal { - constructor (transport) { - this._transport = transport; - } - - listAccounts () { - return this._transport - .execute('personal_listAccounts') - .then((accounts) => (accounts || []).map(outAddress)); - } - - newAccount (password) { - return this._transport - .execute('personal_newAccount', password) - .then(outAddress); - } - - sendTransaction (options, password) { - return this._transport - .execute('personal_sendTransaction', inOptions(options), password); - } - - unlockAccount (account, password, duration = 1) { - return this._transport - .execute('personal_unlockAccount', inAddress(account), password, inNumber10(duration)); - } -} diff --git a/js-old/src/api/rpc/personal/personal.spec.js b/js-old/src/api/rpc/personal/personal.spec.js deleted file mode 100644 index d67bb9dec8f..00000000000 --- a/js-old/src/api/rpc/personal/personal.spec.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { TEST_HTTP_URL, mockHttp } from '../../../../test/mockRpc'; - -import Http from '../../transport/http'; -import Personal from './personal'; - -const instance = new Personal(new Http(TEST_HTTP_URL, -1)); - -describe('rpc/Personal', () => { - const account = '0x63cf90d3f0410092fc0fca41846f596223979195'; - const checksum = '0x63Cf90D3f0410092FC0fca41846f596223979195'; - let scope; - - describe('listAccounts', () => { - it('retrieves a list of available accounts', () => { - scope = mockHttp([{ method: 'personal_listAccounts', reply: { result: [account] } }]); - - return instance.listAccounts().then((result) => { - expect(result).to.deep.equal([checksum]); - }); - }); - - it('returns an empty list when none available', () => { - scope = mockHttp([{ method: 'personal_listAccounts', reply: { result: null } }]); - - return instance.listAccounts().then((result) => { - expect(result).to.deep.equal([]); - }); - }); - }); - - describe('newAccount', () => { - it('passes the password, returning the address', () => { - scope = mockHttp([{ method: 'personal_newAccount', reply: { result: account } }]); - - return instance.newAccount('password').then((result) => { - expect(scope.body.personal_newAccount.params).to.deep.equal(['password']); - expect(result).to.equal(checksum); - }); - }); - }); - - describe('unlockAccount', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'personal_unlockAccount', reply: { result: [] } }]); - }); - - it('passes account, password & duration', () => { - return instance.unlockAccount(account, 'password', 0xf).then(() => { - expect(scope.body.personal_unlockAccount.params).to.deep.equal([account, 'password', 15]); - }); - }); - - it('provides a default duration when not specified', () => { - return instance.unlockAccount(account, 'password').then(() => { - expect(scope.body.personal_unlockAccount.params).to.deep.equal([account, 'password', 1]); - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/shh/index.js b/js-old/src/api/rpc/shh/index.js deleted file mode 100644 index 1094fe4379e..00000000000 --- a/js-old/src/api/rpc/shh/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './shh'; diff --git a/js-old/src/api/rpc/shh/shh.js b/js-old/src/api/rpc/shh/shh.js deleted file mode 100644 index c58754abfb0..00000000000 --- a/js-old/src/api/rpc/shh/shh.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default class Shh { - constructor (transport) { - this._transport = transport; - } - - info () { - return this._transport - .execute('shh_info'); - } - - newKeyPair () { - return this._transport - .execute('shh_newKeyPair'); - } - - addPrivateKey (privKey) { - return this._transport - .execute('shh_addPrivateKey', privKey); - } - - newSymKey () { - return this._transport - .execute('shh_newSymKey'); - } - - getPublicKey (identity) { - return this._transport - .execute('shh_getPublicKey', identity); - } - - getPrivateKey (identity) { - return this._transport - .execute('shh_getPrivateKey', identity); - } - - getSymKey (identity) { - return this._transport - .execute('shh_getSymKey', identity); - } - - deleteKey (identity) { - return this._transport - .execute('shh_deleteKey', identity); - } - - post (messageObj) { - return this._transport - .execute('shh_post', messageObj); - } - - newMessageFilter (filterObj) { - return this._transport - .execute('shh_newMessageFilter', filterObj); - } - - getFilterMessages (filterId) { - return this._transport - .execute('shh_getFilterMessages', filterId); - } - - deleteMessageFilter (filterId) { - return this._transport - .execute('shh_deleteMessageFilter', filterId); - } - - subscribe (filterObj, callback) { - return this._transport - .subscribe('shh', callback, filterObj); - } - - unsubscribe (subscriptionId) { - return this._transport - .unsubscribe(subscriptionId); - } -} diff --git a/js-old/src/api/rpc/signer/index.js b/js-old/src/api/rpc/signer/index.js deleted file mode 100644 index cc1e4dc1c57..00000000000 --- a/js-old/src/api/rpc/signer/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './signer'; diff --git a/js-old/src/api/rpc/signer/signer.js b/js-old/src/api/rpc/signer/signer.js deleted file mode 100644 index 915b811589e..00000000000 --- a/js-old/src/api/rpc/signer/signer.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { inData, inNumber16, inOptions } from '../../format/input'; -import { outSignerRequest } from '../../format/output'; - -export default class Signer { - constructor (transport) { - this._transport = transport; - } - - confirmRequest (requestId, options, password) { - return this._transport - .execute('signer_confirmRequest', inNumber16(requestId), inOptions(options), password); - } - - confirmRequestRaw (requestId, data) { - return this._transport - .execute('signer_confirmRequestRaw', inNumber16(requestId), inData(data)); - } - - confirmRequestWithToken (requestId, options, password) { - return this._transport - .execute('signer_confirmRequestWithToken', inNumber16(requestId), inOptions(options), password); - } - - generateAuthorizationToken () { - return this._transport - .execute('signer_generateAuthorizationToken'); - } - - generateWebProxyAccessToken (domain) { - return this._transport - .execute('signer_generateWebProxyAccessToken', domain); - } - - rejectRequest (requestId) { - return this._transport - .execute('signer_rejectRequest', inNumber16(requestId)); - } - - requestsToConfirm () { - return this._transport - .execute('signer_requestsToConfirm') - .then((requests) => (requests || []).map(outSignerRequest)); - } - - signerEnabled () { - return this._transport - .execute('signer_signerEnabled'); - } -} diff --git a/js-old/src/api/rpc/trace/index.js b/js-old/src/api/rpc/trace/index.js deleted file mode 100644 index 8d02aed4521..00000000000 --- a/js-old/src/api/rpc/trace/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './trace'; diff --git a/js-old/src/api/rpc/trace/trace.e2e.js b/js-old/src/api/rpc/trace/trace.e2e.js deleted file mode 100644 index ffbef0ed68b..00000000000 --- a/js-old/src/api/rpc/trace/trace.e2e.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { createHttpApi } from '../../../../test/e2e/ethapi'; - -describe('ethapi.trace', () => { - const ethapi = createHttpApi(); - - describe('block', () => { - it('returns the latest block traces', () => { - return ethapi.trace.block().then((traces) => { - expect(traces).to.be.ok; - }); - }); - - it('returns traces for a specified block', () => { - return ethapi.trace.block('0x65432').then((traces) => { - expect(traces).to.be.ok; - }); - }); - }); - - describe('replayTransaction', () => { - it('returns traces for a specific transaction', () => { - return ethapi.eth.getBlockByNumber().then((latestBlock) => { - return ethapi.trace.replayTransaction(latestBlock.transactions[0]).then((traces) => { - expect(traces).to.be.ok; - }); - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/trace/trace.js b/js-old/src/api/rpc/trace/trace.js deleted file mode 100644 index 26b19b37892..00000000000 --- a/js-old/src/api/rpc/trace/trace.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { inBlockNumber, inData, inHex, inNumber16, inOptions, inTraceFilter, inTraceType } from '../../format/input'; -import { outTraces, outTraceReplay } from '../../format/output'; - -export default class Trace { - constructor (transport) { - this._transport = transport; - } - - block (blockNumber = 'latest') { - return this._transport - .execute('trace_block', inBlockNumber(blockNumber)) - .then(outTraces); - } - - call (options, whatTrace = ['trace'], blockNumber = 'latest') { - return this._transport - .execute('trace_call', inOptions(options), inTraceType(whatTrace), inBlockNumber(blockNumber)) - .then(outTraceReplay); - } - - filter (filterObj) { - return this._transport - .execute('trace_filter', inTraceFilter(filterObj)) - .then(outTraces); - } - - get (txHash, position) { - return this._transport - .execute('trace_get', inHex(txHash), inNumber16(position)) - .then(outTraces); - } - - rawTransaction (data, whatTrace = ['trace']) { - return this._transport - .execute('trace_rawTransaction', inData(data), inTraceType(whatTrace)) - .then(outTraceReplay); - } - - replayTransaction (txHash, whatTrace = ['trace']) { - return this._transport - .execute('trace_replayTransaction', txHash, inTraceType(whatTrace)) - .then(outTraceReplay); - } - - transaction (txHash) { - return this._transport - .execute('trace_transaction', inHex(txHash)) - .then(outTraces); - } -} diff --git a/js-old/src/api/rpc/trace/trace.spec.js b/js-old/src/api/rpc/trace/trace.spec.js deleted file mode 100644 index 267d1240f1b..00000000000 --- a/js-old/src/api/rpc/trace/trace.spec.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { TEST_HTTP_URL, mockHttp } from '../../../../test/mockRpc'; - -import Http from '../../transport/http'; -import Trace from './trace'; - -const instance = new Trace(new Http(TEST_HTTP_URL, -1)); - -describe('api/rpc/Trace', () => { - let scope; - - describe('block', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'trace_block', reply: { result: [] } }]); - }); - - it('assumes latest blockNumber when not specified', () => { - return instance.block().then(() => { - expect(scope.body.trace_block.params).to.deep.equal(['latest']); - }); - }); - - it('passed specified blockNumber', () => { - return instance.block(0x123).then(() => { - expect(scope.body.trace_block.params).to.deep.equal(['0x123']); - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/web3/index.js b/js-old/src/api/rpc/web3/index.js deleted file mode 100644 index c2590ec1150..00000000000 --- a/js-old/src/api/rpc/web3/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './web3'; diff --git a/js-old/src/api/rpc/web3/web3.e2e.js b/js-old/src/api/rpc/web3/web3.e2e.js deleted file mode 100644 index 2c8243a4fb9..00000000000 --- a/js-old/src/api/rpc/web3/web3.e2e.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { createHttpApi } from '../../../../test/e2e/ethapi'; -import { isHexNumber } from '../../../../test/types'; - -describe('ethapi.web3', () => { - const ethapi = createHttpApi(); - - describe('clientVersion', () => { - it('returns the client version', () => { - return ethapi.web3.clientVersion().then((version) => { - const [client] = version.split('/'); - - expect(client === 'Parity' || client === 'Geth').to.be.ok; - }); - }); - }); - - describe('sha3', () => { - it('returns a keccak256 sha', () => { - const sha = '0xa7916fac4f538170f7cd12c148552e2cba9fcd72329a2dd5b07a6fa906488ddf'; - const hexStr = 'baz()'.split('').map((char) => char.charCodeAt(0).toString(16)).join(''); - - return ethapi.web3.sha3(`0x${hexStr}`).then((hash) => { - expect(isHexNumber(hash)).to.be.true; - expect(hash).to.equal(sha); - }); - }); - }); -}); diff --git a/js-old/src/api/rpc/web3/web3.js b/js-old/src/api/rpc/web3/web3.js deleted file mode 100644 index 21b2d77f1e3..00000000000 --- a/js-old/src/api/rpc/web3/web3.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { inHex } from '../../format/input'; - -export default class Web3 { - constructor (transport) { - this._transport = transport; - } - - clientVersion () { - return this._transport - .execute('web3_clientVersion'); - } - - sha3 (hexStr) { - return this._transport - .execute('web3_sha3', inHex(hexStr)); - } -} diff --git a/js-old/src/api/rpc/web3/web3.spec.js b/js-old/src/api/rpc/web3/web3.spec.js deleted file mode 100644 index b46679b82a7..00000000000 --- a/js-old/src/api/rpc/web3/web3.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { TEST_HTTP_URL, mockHttp } from '../../../../test/mockRpc'; - -import Http from '../../transport/http'; -import Web3 from './web3'; - -const instance = new Web3(new Http(TEST_HTTP_URL, -1)); - -describe('api/rpc/Web3', () => { - let scope; - - describe('sha3', () => { - beforeEach(() => { - scope = mockHttp([{ method: 'web3_sha3', reply: { result: [] } }]); - }); - - it('formats the inputs correctly', () => { - return instance.sha3('1234').then(() => { - expect(scope.body.web3_sha3.params).to.deep.equal(['0x1234']); - }); - }); - }); -}); diff --git a/js-old/src/api/subscriptions/eth.js b/js-old/src/api/subscriptions/eth.js deleted file mode 100644 index 8e56f335f7e..00000000000 --- a/js-old/src/api/subscriptions/eth.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -export default class Eth { - constructor (updateSubscriptions, api) { - this._api = api; - this._updateSubscriptions = updateSubscriptions; - this._started = false; - - this._lastBlock = new BigNumber(-1); - this._pollTimerId = null; - } - - get isStarted () { - return this._started; - } - - start () { - this._started = true; - - return this._blockNumber(); - } - - _blockNumber = () => { - const nextTimeout = (timeout = 1000) => { - this._pollTimerId = setTimeout(() => { - this._blockNumber(); - }, timeout); - }; - - if (!this._api.transport.isConnected) { - nextTimeout(500); - return; - } - - return this._api.eth - .blockNumber() - .then((blockNumber) => { - if (!blockNumber.eq(this._lastBlock)) { - this._lastBlock = blockNumber; - this._updateSubscriptions('eth_blockNumber', null, blockNumber); - } - - nextTimeout(); - }) - .catch(() => nextTimeout()); - } -} diff --git a/js-old/src/api/subscriptions/eth.spec.js b/js-old/src/api/subscriptions/eth.spec.js deleted file mode 100644 index 3f5ee81d66f..00000000000 --- a/js-old/src/api/subscriptions/eth.spec.js +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; -import sinon from 'sinon'; - -import Eth from './eth'; - -const START_BLOCK = 5000; - -function stubApi (blockNumber) { - const _calls = { - blockNumber: [] - }; - - return { - _calls, - transport: { - isConnected: true - }, - eth: { - blockNumber: () => { - const stub = sinon.stub().resolves(new BigNumber(blockNumber || START_BLOCK))(); - - _calls.blockNumber.push(stub); - return stub; - } - } - }; -} - -describe('api/subscriptions/eth', () => { - let api; - let eth; - let cb; - - beforeEach(() => { - api = stubApi(); - cb = sinon.stub(); - eth = new Eth(cb, api); - }); - - describe('constructor', () => { - it('starts the instance in a stopped state', () => { - expect(eth.isStarted).to.be.false; - }); - }); - - describe('start', () => { - describe('blockNumber available', () => { - beforeEach(() => { - return eth.start(); - }); - - it('sets the started status', () => { - expect(eth.isStarted).to.be.true; - }); - - it('calls eth_blockNumber', () => { - expect(api._calls.blockNumber.length).to.be.ok; - }); - - it('updates subscribers', () => { - expect(cb).to.have.been.calledWith('eth_blockNumber', null, new BigNumber(START_BLOCK)); - }); - }); - - describe('blockNumber not available', () => { - beforeEach(() => { - api = stubApi(-1); - eth = new Eth(cb, api); - return eth.start(); - }); - - it('sets the started status', () => { - expect(eth.isStarted).to.be.true; - }); - - it('calls eth_blockNumber', () => { - expect(api._calls.blockNumber.length).to.be.ok; - }); - - it('does not update subscribers', () => { - expect(cb).not.to.been.called; - }); - }); - }); -}); diff --git a/js-old/src/api/subscriptions/index.js b/js-old/src/api/subscriptions/index.js deleted file mode 100644 index 07856faefd7..00000000000 --- a/js-old/src/api/subscriptions/index.js +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export Logging from './logging'; - -export default from './manager'; diff --git a/js-old/src/api/subscriptions/logging.js b/js-old/src/api/subscriptions/logging.js deleted file mode 100644 index 545742dff7f..00000000000 --- a/js-old/src/api/subscriptions/logging.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -let instance = null; - -export default class Logging { - constructor (updateSubscriptions) { - this._updateSubscriptions = updateSubscriptions; - - instance = this; - } - - get isStarted () { - return true; - } - - start () { - } - - static send (method, params, json) { - if (!instance) { - return; - } - - return instance._updateSubscriptions('logging', null, { - method, - params, - json - }); - } -} diff --git a/js-old/src/api/subscriptions/logging.spec.js b/js-old/src/api/subscriptions/logging.spec.js deleted file mode 100644 index f155696b779..00000000000 --- a/js-old/src/api/subscriptions/logging.spec.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import sinon from 'sinon'; - -import Logging from './logging'; - -describe('api/subscriptions/logging', () => { - let cb; - let logging; - - beforeEach(() => { - cb = sinon.stub(); - logging = new Logging(cb); - }); - - describe('constructor', () => { - it('starts the instance in a started state', () => { - expect(logging.isStarted).to.be.true; - }); - }); - - describe('send', () => { - const method = 'method'; - const params = 'params'; - const json = 'json'; - - beforeEach(() => { - Logging.send(method, params, json); - }); - - it('calls the subscription update', () => { - expect(cb).to.have.been.calledWith('logging', null, { method, params, json }); - }); - }); -}); diff --git a/js-old/src/api/subscriptions/manager.js b/js-old/src/api/subscriptions/manager.js deleted file mode 100644 index 6ca2f401502..00000000000 --- a/js-old/src/api/subscriptions/manager.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { isError } from '../util/types'; - -import Eth from './eth'; -import Logging from './logging'; -import Personal from './personal'; -import Signer from './signer'; - -const events = { - 'logging': { module: 'logging' }, - 'eth_blockNumber': { module: 'eth' }, - 'parity_accountsInfo': { module: 'personal' }, - 'parity_allAccountsInfo': { module: 'personal' }, - 'parity_defaultAccount': { module: 'personal' }, - 'parity_postTransaction': { module: 'signer' }, - 'eth_accounts': { module: 'personal' }, - 'signer_requestsToConfirm': { module: 'signer' } -}; - -export default class Manager { - constructor (api) { - this._api = api; - - this.subscriptions = []; - this.values = {}; - - Object.keys(events).forEach((subscriptionName) => { - this.values[subscriptionName] = { - error: null, - data: null - }; - }); - - this._logging = new Logging(this._updateSubscriptions); - this._eth = new Eth(this._updateSubscriptions, api); - this._personal = new Personal(this._updateSubscriptions, api, this); - this._signer = new Signer(this._updateSubscriptions, api, this); - } - - _validateType (subscriptionName) { - const subscription = events[subscriptionName]; - - if (!subscription) { - return new Error(`${subscriptionName} is not a valid interface, subscribe using one of ${Object.keys(events).join(', ')}`); - } - - return subscription; - } - - subscribe (subscriptionName, callback, autoRemove = false) { - return new Promise((resolve, reject) => { - const subscription = this._validateType(subscriptionName); - - if (isError(subscription)) { - reject(subscription); - return; - } - - const subscriptionId = this.subscriptions.length; - const { error, data } = this.values[subscriptionName]; - const engine = this[`_${subscription.module}`]; - - this.subscriptions[subscriptionId] = { - name: subscriptionName, - id: subscriptionId, - autoRemove, - callback - }; - - if (!engine.isStarted) { - engine.start(); - } else if (error !== null || data !== null) { - this._sendData(subscriptionId, error, data); - } - - resolve(subscriptionId); - }); - } - - unsubscribe (subscriptionId) { - return new Promise((resolve, reject) => { - if (!this.subscriptions[subscriptionId]) { - reject(new Error(`Cannot find subscription ${subscriptionId}`)); - return; - } - - delete this.subscriptions[subscriptionId]; - resolve(); - }); - } - - _sendData (subscriptionId, error, data) { - const { autoRemove, callback } = this.subscriptions[subscriptionId]; - let result = true; - - try { - result = callback(error, data); - } catch (error) { - console.error(`Unable to update callback for subscriptionId ${subscriptionId}`, error); - } - - if (autoRemove && result && typeof result === 'boolean') { - this.unsubscribe(subscriptionId); - } - } - - _updateSubscriptions = (subscriptionName, error, data) => { - const subscriptions = this.subscriptions - .filter(subscription => subscription.name === subscriptionName); - - this.values[subscriptionName] = { error, data }; - - subscriptions - .forEach((subscription) => { - this._sendData(subscription.id, error, data); - }); - } -} - -export { - events -}; diff --git a/js-old/src/api/subscriptions/manager.spec.js b/js-old/src/api/subscriptions/manager.spec.js deleted file mode 100644 index df708a36dcb..00000000000 --- a/js-old/src/api/subscriptions/manager.spec.js +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import sinon from 'sinon'; - -import Manager, { events } from './manager'; - -function newStub () { - const start = () => manager._updateSubscriptions(manager.__test, null, 'test'); - - const manager = new Manager({ - transport: { - isConnected: true - } - }); - - manager._eth = { - isStarted: false, - start - }; - - manager._personal = { - isStarted: false, - start - }; - - manager._signer = { - isStarted: false, - start - }; - - return manager; -} - -describe('api/subscriptions/manager', () => { - let manager; - - beforeEach(() => { - manager = newStub(); - }); - - describe('constructor', () => { - it('sets up the subscription types & defaults', () => { - expect(manager.subscriptions).to.be.an.array; - expect(Object.keys(manager.values)).to.deep.equal(Object.keys(events)); - }); - }); - - describe('subscriptions', () => { - Object - .keys(events) - .filter((eventName) => eventName.indexOf('_') !== -1) - .forEach((eventName) => { - const { module } = events[eventName]; - let engine; - let cb; - let subscriptionId; - - describe(eventName, () => { - beforeEach(() => { - engine = manager[`_${module}`]; - manager.__test = eventName; - cb = sinon.stub(); - sinon.spy(engine, 'start'); - - return manager - .subscribe(eventName, cb) - .then((_subscriptionId) => { - subscriptionId = _subscriptionId; - }); - }); - - it(`puts the ${module} engine in a started state`, () => { - expect(engine.start).to.have.been.called; - }); - - it('returns a subscriptionId', () => { - expect(subscriptionId).to.be.a.number; - }); - - it('calls the subscription callback with updated values', () => { - expect(cb).to.have.been.calledWith(null, 'test'); - }); - }); - }); - }); - - describe('unsubscriptions', () => { - Object - .keys(events) - .filter((eventName) => eventName.indexOf('_') !== -1) - .forEach((eventName) => { - const { module } = events[eventName]; - let engine; - let cb; - - describe(eventName, () => { - beforeEach(() => { - engine = manager[`_${module}`]; - manager.__test = eventName; - cb = sinon.stub(); - sinon.spy(engine, 'start'); - - return manager - .subscribe(eventName, cb) - .then((_subscriptionId) => { - manager.unsubscribe(_subscriptionId); - }) - .then(() => { - manager._updateSubscriptions(manager.__test, null, 'test2'); - }); - }); - - it('does not call the callback after unsubscription', () => { - expect(cb).to.have.been.calledWith(null, 'test'); - expect(cb).to.not.have.been.calledWith(null, 'test2'); - }); - }); - }); - }); -}); diff --git a/js-old/src/api/subscriptions/personal.js b/js-old/src/api/subscriptions/personal.js deleted file mode 100644 index fa7ae823ca9..00000000000 --- a/js-old/src/api/subscriptions/personal.js +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default class Personal { - constructor (updateSubscriptions, api, subscriber) { - this._subscriber = subscriber; - this._api = api; - this._updateSubscriptions = updateSubscriptions; - this._started = false; - - this._lastDefaultAccount = '0x0'; - this._pollTimerId = null; - } - - get isStarted () { - return this._started; - } - - start () { - this._started = true; - - return Promise.all([ - this._defaultAccount(), - this._listAccounts(), - this._accountsInfo(), - this._loggingSubscribe() - ]); - } - - // FIXME: Because of the different API instances, the "wait for valid changes" approach - // doesn't work. Since the defaultAccount is critical to operation, we poll in exactly - // same way we do in ../eth (ala eth_blockNumber) and update. This should be moved - // to pub-sub as it becomes available - _defaultAccount = (timerDisabled = false) => { - const nextTimeout = (timeout = 1000) => { - if (!timerDisabled) { - this._pollTimerId = setTimeout(() => { - this._defaultAccount(); - }, timeout); - } - }; - - if (!this._api.transport.isConnected) { - nextTimeout(500); - return; - } - - return this._api.parity - .defaultAccount() - .then((defaultAccount) => { - if (this._lastDefaultAccount !== defaultAccount) { - this._lastDefaultAccount = defaultAccount; - this._updateSubscriptions('parity_defaultAccount', null, defaultAccount); - } - - nextTimeout(); - }) - .catch(() => nextTimeout()); - } - - _listAccounts = () => { - return this._api.eth - .accounts() - .then((accounts) => { - this._updateSubscriptions('eth_accounts', null, accounts); - }); - } - - _accountsInfo = () => { - return this._api.parity - .accountsInfo() - .then((info) => { - this._updateSubscriptions('parity_accountsInfo', null, info); - - return this._api.parity - .allAccountsInfo() - .catch(() => { - // NOTE: This fails on non-secure APIs, swallow error - return {}; - }) - .then((allInfo) => { - this._updateSubscriptions('parity_allAccountsInfo', null, allInfo); - }); - }); - } - - _loggingSubscribe () { - return this._subscriber.subscribe('logging', (error, data) => { - if (error || !data) { - return; - } - - switch (data.method) { - case 'parity_closeVault': - case 'parity_openVault': - case 'parity_killAccount': - case 'parity_importGethAccounts': - case 'parity_newAccountFromPhrase': - case 'parity_newAccountFromWallet': - case 'personal_newAccount': - this._defaultAccount(true); - this._listAccounts(); - this._accountsInfo(); - return; - - case 'parity_removeAddress': - case 'parity_setAccountName': - case 'parity_setAccountMeta': - this._accountsInfo(); - return; - - case 'parity_setDappAddresses': - case 'parity_setDappDefaultAddress': - case 'parity_setNewDappsAddresses': - case 'parity_setNewDappsDefaultAddress': - this._defaultAccount(true); - this._listAccounts(); - return; - } - }); - } -} diff --git a/js-old/src/api/subscriptions/personal.spec.js b/js-old/src/api/subscriptions/personal.spec.js deleted file mode 100644 index ac046d25099..00000000000 --- a/js-old/src/api/subscriptions/personal.spec.js +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import sinon from 'sinon'; - -import Personal from './personal'; - -const TEST_DEFAULT = '0xfa64203C044691aA57251aF95f4b48d85eC00Dd5'; -const TEST_INFO = { - [TEST_DEFAULT]: { - name: 'test' - } -}; -const TEST_LIST = [TEST_DEFAULT]; - -function stubApi (accounts, info) { - const _calls = { - accountsInfo: [], - allAccountsInfo: [], - listAccounts: [], - defaultAccount: [] - }; - - return { - _calls, - transport: { - isConnected: true - }, - parity: { - accountsInfo: () => { - const stub = sinon.stub().resolves(info || TEST_INFO)(); - - _calls.accountsInfo.push(stub); - return stub; - }, - allAccountsInfo: () => { - const stub = sinon.stub().resolves(info || TEST_INFO)(); - - _calls.allAccountsInfo.push(stub); - return stub; - }, - defaultAccount: () => { - const stub = sinon.stub().resolves(Object.keys(info || TEST_INFO)[0])(); - - _calls.defaultAccount.push(stub); - return stub; - } - }, - eth: { - accounts: () => { - const stub = sinon.stub().resolves(accounts || TEST_LIST)(); - - _calls.listAccounts.push(stub); - return stub; - } - } - }; -} - -function stubLogging () { - return { - subscribe: sinon.stub() - }; -} - -describe('api/subscriptions/personal', () => { - let api; - let cb; - let logging; - let personal; - - beforeEach(() => { - api = stubApi(); - cb = sinon.stub(); - logging = stubLogging(); - personal = new Personal(cb, api, logging); - }); - - describe('constructor', () => { - it('starts the instance in a stopped state', () => { - expect(personal.isStarted).to.be.false; - }); - }); - - describe('start', () => { - describe('info available', () => { - beforeEach(() => { - return personal.start(); - }); - - it('sets the started status', () => { - expect(personal.isStarted).to.be.true; - }); - - it('calls parity_accountsInfo', () => { - expect(api._calls.accountsInfo.length).to.be.ok; - }); - - it('calls parity_allAccountsInfo', () => { - expect(api._calls.allAccountsInfo.length).to.be.ok; - }); - - it('calls eth_accounts', () => { - expect(api._calls.listAccounts.length).to.be.ok; - }); - - it('updates subscribers', () => { - expect(cb).to.have.been.calledWith('parity_defaultAccount', null, TEST_DEFAULT); - expect(cb).to.have.been.calledWith('eth_accounts', null, TEST_LIST); - expect(cb).to.have.been.calledWith('parity_accountsInfo', null, TEST_INFO); - expect(cb).to.have.been.calledWith('parity_allAccountsInfo', null, TEST_INFO); - }); - }); - - describe('info not available', () => { - beforeEach(() => { - api = stubApi([], {}); - personal = new Personal(cb, api, logging); - return personal.start(); - }); - - it('sets the started status', () => { - expect(personal.isStarted).to.be.true; - }); - - it('calls parity_defaultAccount', () => { - expect(api._calls.defaultAccount.length).to.be.ok; - }); - - it('calls personal_accountsInfo', () => { - expect(api._calls.accountsInfo.length).to.be.ok; - }); - - it('calls personal_allAccountsInfo', () => { - expect(api._calls.allAccountsInfo.length).to.be.ok; - }); - - it('calls personal_listAccounts', () => { - expect(api._calls.listAccounts.length).to.be.ok; - }); - }); - }); -}); diff --git a/js-old/src/api/subscriptions/signer.js b/js-old/src/api/subscriptions/signer.js deleted file mode 100644 index 2215ed7f3df..00000000000 --- a/js-old/src/api/subscriptions/signer.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { outTransaction } from '../format/output'; - -export default class Signer { - constructor (updateSubscriptions, api, subscriber) { - this._subscriber = subscriber; - this._api = api; - this._updateSubscriptions = updateSubscriptions; - this._started = false; - } - - get isStarted () { - return this._started; - } - - start () { - this._started = true; - - return Promise.all([ - this._listRequests(true), - this._loggingSubscribe() - ]); - } - - _listRequests = (doTimeout) => { - const nextTimeout = (timeout = 1000) => { - if (doTimeout) { - setTimeout(() => { - this._listRequests(true); - }, timeout); - } - }; - - if (!this._api.transport.isConnected) { - nextTimeout(500); - return; - } - - return this._api.signer - .requestsToConfirm() - .then((requests) => { - this._updateSubscriptions('signer_requestsToConfirm', null, requests); - nextTimeout(); - }) - .catch(() => nextTimeout()); - } - - _postTransaction (data) { - const request = { - transaction: outTransaction(data.params[0]), - requestId: data.json.result.result - }; - - this._updateSubscriptions('parity_postTransaction', null, request); - } - - _loggingSubscribe () { - return this._subscriber.subscribe('logging', (error, data) => { - if (error || !data) { - return; - } - - switch (data.method) { - case 'eth_sendTransaction': - case 'eth_sendRawTransaction': - this._listRequests(false); - return; - - case 'parity_postTransaction': - this._postTransaction(data); - this._listRequests(false); - return; - } - }); - } -} diff --git a/js-old/src/api/transport/error.js b/js-old/src/api/transport/error.js deleted file mode 100644 index 9049705fab5..00000000000 --- a/js-old/src/api/transport/error.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import ExtendableError from 'es6-error'; - -export const ERROR_CODES = { - UNSUPPORTED_REQUEST: -32000, - NO_WORK: -32001, - NO_AUTHOR: -32002, - NO_NEW_WORK: -32003, - NO_WORK_REQUIRED: -32004, - NOT_ENOUGH_DATA: -32006, - UNKNOWN_ERROR: -32009, - TRANSACTION_ERROR: -32010, - EXECUTION_ERROR: -32015, - EXCEPTION_ERROR: -32016, - ACCOUNT_LOCKED: -32020, - PASSWORD_INVALID: -32021, - ACCOUNT_ERROR: -32023, - SIGNER_DISABLED: -32030, - DAPPS_DISABLED: -32031, - NETWORK_DISABLED: -32035, - REQUEST_REJECTED: -32040, - REQUEST_REJECTED_LIMIT: -32041, - REQUEST_NOT_FOUND: -32042, - COMPILATION_ERROR: -32050, - ENCRYPTION_ERROR: -32055, - FETCH_ERROR: -32060, - INVALID_PARAMS: -32602 -}; - -export default class TransportError extends ExtendableError { - static requestRejected (method = null) { - return new TransportError(method, ERROR_CODES.REQUEST_REJECTED, 'Request has been rejected.'); - } - - constructor (method, code, message) { - const m = `${method}: ${code}: ${message}`; - - super(m); - - this.code = code; - this.type = Object.keys(ERROR_CODES).find((k) => ERROR_CODES[k] === code) || ''; - - this.method = method; - this.text = message; - } -} diff --git a/js-old/src/api/transport/http/http.e2e.js b/js-old/src/api/transport/http/http.e2e.js deleted file mode 100644 index af2fb1fbb31..00000000000 --- a/js-old/src/api/transport/http/http.e2e.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Http from './http'; - -const http = new Http('http://localhost:8545'); - -describe('transport/Http', () => { - it('connects and makes a call to web3_clientVersion', () => { - return http.execute('web3_clientVersion').then((version) => { - const [client] = version.split('/'); - - expect(client === 'Geth' || client === 'Parity').to.be.ok; - }); - }); -}); diff --git a/js-old/src/api/transport/http/http.js b/js-old/src/api/transport/http/http.js deleted file mode 100644 index 66ef2dec790..00000000000 --- a/js-old/src/api/transport/http/http.js +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { Logging } from '../../subscriptions'; -import JsonRpcBase from '../jsonRpcBase'; -import TransportError from '../error'; - -/* global fetch */ -export default class Http extends JsonRpcBase { - constructor (url, connectTimeout = 1000) { - super(); - - this._connected = true; - this._url = url; - this._connectTimeout = connectTimeout; - - this._pollConnection(); - } - - _encodeOptions (method, params) { - const json = this.encode(method, params); - - this.log(json); - - return { - method: 'POST', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Content-Length': json.length - }, - body: json - }; - } - - _execute (method, params) { - const request = this._encodeOptions(method, params); - - return fetch(this._url, request) - .catch((error) => { - this._setDisconnected(); - throw error; - }) - .then((response) => { - this._setConnected(); - - if (response.status !== 200) { - this._setDisconnected(); - this.error(JSON.stringify({ status: response.status, statusText: response.statusText })); - console.error(`${method}(${JSON.stringify(params)}): ${response.status}: ${response.statusText}`); - - throw new Error(`${response.status}: ${response.statusText}`); - } - - return response.json(); - }) - .then((response) => { - Logging.send(method, params, { request, response }); - - if (response.error) { - this.error(JSON.stringify(response)); - console.error(`${method}(${JSON.stringify(params)}): ${response.error.code}: ${response.error.message}`); - - const error = new TransportError(method, response.error.code, response.error.message); - - throw error; - } - - this.log(JSON.stringify(response)); - return response.result; - }); - } - - _pollConnection = () => { - if (this._connectTimeout <= 0) { - return; - } - - const nextTimeout = () => setTimeout(this._pollConnection, this._connectTimeout); - - this - .execute('net_listening') - .then(() => nextTimeout()) - .catch(() => nextTimeout()); - } - - set url (url) { - this._url = url; - } -} diff --git a/js-old/src/api/transport/http/http.spec.js b/js-old/src/api/transport/http/http.spec.js deleted file mode 100644 index 3d08e17a449..00000000000 --- a/js-old/src/api/transport/http/http.spec.js +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { TEST_HTTP_URL, mockHttp } from '../../../../test/mockRpc'; -import Http from './http'; - -const transport = new Http(TEST_HTTP_URL, -1); - -describe('api/transport/Http', () => { - describe('instance', () => { - it('encodes the options correctly', () => { - const opt = transport._encodeOptions('someMethod', ['param']); - const enc = { - method: 'POST', - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - 'Content-Length': 65 - }, - body: `{"jsonrpc":"2.0","method":"someMethod","params":["param"],"id":${transport._id - 1}}` - }; - - expect(opt).to.deep.equal(enc); - }); - }); - - describe('transport emitter', () => { - it('emits close event', (done) => { - transport.once('close', () => { - done(); - }); - - transport.execute('eth_call'); - }); - - it('emits open event', (done) => { - mockHttp([{ method: 'eth_call', reply: { result: '' } }]); - - transport.once('open', () => { - done(); - }); - - transport.execute('eth_call'); - }); - }); - - describe('transport', () => { - const RESULT = ['this is some result']; - - let scope; - let result; - - beforeEach(() => { - scope = mockHttp([{ method: 'eth_call', reply: { result: RESULT } }]); - - return transport - .execute('eth_call', 1, 2, 3, 'test') - .then((_result) => { - result = _result; - }); - }); - - it('makes POST', () => { - expect(scope.isDone()).to.be.true; - }); - - it('sets jsonrpc', () => { - expect(scope.body.eth_call.jsonrpc).to.equal('2.0'); - }); - - it('sets the method', () => { - expect(scope.body.eth_call.method).to.equal('eth_call'); - }); - - it('passes the params', () => { - expect(scope.body.eth_call.params).to.deep.equal([1, 2, 3, 'test']); - }); - - it('increments the id', () => { - expect(scope.body.eth_call.id).not.to.equal(0); - }); - - it('passes the actual result back', () => { - expect(result).to.deep.equal(RESULT); - }); - }); - - describe('HTTP errors', () => { - let scope; - let error; - - beforeEach(() => { - scope = mockHttp([{ method: 'eth_call', reply: {}, code: 500 }]); - - return transport - .execute('eth_call') - .catch((_error) => { - error = _error; - }); - }); - - it('returns HTTP errors as throws', () => { - expect(scope.isDone()).to.be.true; - expect(error.message).to.match(/Internal Server Error/); - }); - }); - - describe('RPC errors', () => { - const ERROR = { code: -1, message: 'ERROR: RPC failure' }; - - let scope; - let error; - - beforeEach(() => { - scope = mockHttp([{ method: 'eth_call', reply: { error: ERROR } }]); - - return transport - .execute('eth_call') - .catch((_error) => { - error = _error; - }); - }); - - it('returns RPC errors as throws', () => { - expect(scope.isDone()).to.be.true; - expect(error.message).to.match(/RPC failure/); - }); - }); -}); diff --git a/js-old/src/api/transport/http/index.js b/js-old/src/api/transport/http/index.js deleted file mode 100644 index dfd17216535..00000000000 --- a/js-old/src/api/transport/http/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './http'; diff --git a/js-old/src/api/transport/index.js b/js-old/src/api/transport/index.js deleted file mode 100644 index fdd3861a84e..00000000000 --- a/js-old/src/api/transport/index.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export Http from './http'; -export Ws from './ws'; -export TransportError from './error'; -export Middleware from './middleware'; diff --git a/js-old/src/api/transport/jsonRpcBase.js b/js-old/src/api/transport/jsonRpcBase.js deleted file mode 100644 index 819e1f496ff..00000000000 --- a/js-old/src/api/transport/jsonRpcBase.js +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import EventEmitter from 'eventemitter3'; -import { Logging } from '../subscriptions'; - -export default class JsonRpcBase extends EventEmitter { - constructor () { - super(); - - this._id = 1; - this._debug = false; - this._connected = false; - this._middlewareList = Promise.resolve([]); - } - - encode (method, params) { - const json = JSON.stringify({ - jsonrpc: '2.0', - method: method, - params: params, - id: this._id++ - }); - - return json; - } - - addMiddleware (Middleware) { - this._middlewareList = Promise - .all([ - Middleware, - this._middlewareList - ]) - .then(([Middleware, middlewareList]) => { - // Do nothing if `handlerPromise` resolves to a null-y value. - if (Middleware == null) { - return middlewareList; - } - - // don't mutate the original array - return middlewareList.concat([new Middleware(this)]); - }); - } - - _wrapSuccessResult (result) { - return { - id: this._id, - jsonrpc: '2.0', - result - }; - } - - _wrapErrorResult (error) { - return { - id: this._id, - jsonrpc: '2.0', - error: { - code: error.code, - message: error.text - } - }; - } - - execute (method, ...params) { - return this._middlewareList.then((middlewareList) => { - for (const middleware of middlewareList) { - const res = middleware.handle(method, params); - - if (res != null) { - return Promise - .resolve(res) - .then((res) => { - const result = this._wrapSuccessResult(res); - const json = this.encode(method, params); - - Logging.send(method, params, { json, result }); - - return res; - }); - } - } - - return this._execute(method, params); - }); - } - - _execute () { - throw new Error('Missing implementation of JsonRpcBase#_execute'); - } - - _setConnected () { - if (!this._connected) { - this._connected = true; - this.emit('open'); - } - } - - _setDisconnected () { - if (this._connected) { - this._connected = false; - this.emit('close'); - } - } - - get id () { - return this._id; - } - - get isDebug () { - return this._debug; - } - - get isConnected () { - return this._connected; - } - - setDebug (flag) { - this._debug = flag; - } - - error (error) { - if (this.isDebug) { - console.error(error); - } - } - - log (log) { - if (this.isDebug) { - console.log(log); - } - } -} diff --git a/js-old/src/api/transport/jsonRpcBase.spec.js b/js-old/src/api/transport/jsonRpcBase.spec.js deleted file mode 100644 index 6c3b955647e..00000000000 --- a/js-old/src/api/transport/jsonRpcBase.spec.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import sinon from 'sinon'; - -import JsonRpcBase from './jsonRpcBase'; - -const base = new JsonRpcBase(); - -describe('api/transport/JsonRpcBase', () => { - describe('encode', () => { - it('encodes the body correctly, incrementing id', () => { - const id = base.id; - const bdy = base.encode('someMethod', ['param1', 'param2']); - const enc = `{"jsonrpc":"2.0","method":"someMethod","params":["param1","param2"],"id":${id}}`; - - expect(bdy).to.equal(enc); - expect(base.id - id).to.equal(1); - }); - }); - - describe('setDebug', () => { - it('starts with disabled flag', () => { - expect(base.isDebug).to.be.false; - }); - - it('true flag switches on', () => { - base.setDebug(true); - expect(base.isDebug).to.be.true; - }); - - it('false flag switches off', () => { - base.setDebug(true); - expect(base.isDebug).to.be.true; - base.setDebug(false); - expect(base.isDebug).to.be.false; - }); - - describe('logging', () => { - beforeEach(() => { - sinon.spy(console, 'log'); - sinon.spy(console, 'error'); - }); - - afterEach(() => { - console.log.restore(); - console.error.restore(); - }); - - it('does not log errors with flag off', () => { - base.setDebug(false); - base.log('error'); - expect(console.log).to.not.be.called; - }); - - it('does not log errors with flag off', () => { - base.setDebug(false); - base.error('error'); - expect(console.error).to.not.be.called; - }); - - it('does log errors with flag on', () => { - base.setDebug(true); - base.log('error'); - expect(console.log).to.be.called; - }); - - it('does log errors with flag on', () => { - base.setDebug(true); - base.error('error'); - expect(console.error).to.be.called; - }); - }); - }); -}); diff --git a/js-old/src/api/transport/middleware.js b/js-old/src/api/transport/middleware.js deleted file mode 100644 index ef029b1cbc8..00000000000 --- a/js-old/src/api/transport/middleware.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default class Middleware { - constructor (transport) { - this._transport = transport; - this._handlers = {}; - } - - register (method, handler) { - if (method in this._handlers) { - throw new Error(`${method} is already defined in the middleware!`); - } - - this._handlers[method] = handler; - } - - handle (method, params) { - const handler = this._handlers[method]; - - if (handler != null) { - return handler(params); - } - - return null; - } - - rpcRequest (method, params) { - return this._transport._execute(method, params); - } -} diff --git a/js-old/src/api/transport/middleware.spec.js b/js-old/src/api/transport/middleware.spec.js deleted file mode 100644 index 4ae894135bc..00000000000 --- a/js-old/src/api/transport/middleware.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Middleware from './middleware'; -import JsonRpcBase from './jsonRpcBase'; - -const MOCKED = 'mocked!'; - -class MockTransport extends JsonRpcBase { - _execute () { - return Promise.resolve(MOCKED); - } -} - -class MockMiddleware extends Middleware { - constructor (transport) { - super(transport); - - this.register('mock_rpc', ([num]) => num); - this.register('mock_null', () => null); - } -} - -describe('api/transport/Middleware', () => { - let transport; - - beforeEach(() => { - transport = new MockTransport(); - transport.addMiddleware(MockMiddleware); - }); - - it('Routes requests to middleware', () => { - return transport.execute('mock_rpc', 100).then((num) => { - expect(num).to.be.equal(100); - }); - }); - - it('Passes non-mocked requests through', () => { - return transport.execute('not_moced', 200).then((result) => { - expect(result).to.be.equal(MOCKED); - }); - }); - - it('Passes mocked requests through, if middleware returns null', () => { - return transport.execute('mock_null', 300).then((result) => { - expect(result).to.be.equal(MOCKED); - }); - }); -}); diff --git a/js-old/src/api/transport/ws/index.js b/js-old/src/api/transport/ws/index.js deleted file mode 100644 index 7ab0be1310c..00000000000 --- a/js-old/src/api/transport/ws/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './ws'; diff --git a/js-old/src/api/transport/ws/ws.e2e.js b/js-old/src/api/transport/ws/ws.e2e.js deleted file mode 100644 index 42e47451c3b..00000000000 --- a/js-old/src/api/transport/ws/ws.e2e.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Ws from './ws'; - -const ws = new Ws('ws://localhost:8546/'); - -describe('transport/Ws', () => { - it('connects and makes a call to web3_clientVersion', () => { - return ws.execute('web3_clientVersion').then((version) => { - const [client] = version.split('/'); - - expect(client === 'Geth' || client === 'Parity').to.be.ok; - }); - }); -}); diff --git a/js-old/src/api/transport/ws/ws.js b/js-old/src/api/transport/ws/ws.js deleted file mode 100644 index 9c276772dc3..00000000000 --- a/js-old/src/api/transport/ws/ws.js +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { keccak_256 } from 'js-sha3'; // eslint-disable-line camelcase - -import { Logging } from '../../subscriptions'; -import JsonRpcBase from '../jsonRpcBase'; -import TransportError from '../error'; - -/* global WebSocket */ -export default class Ws extends JsonRpcBase { - // token is optional (secure API) - constructor (url, token = null, autoconnect = true) { - super(); - - this._url = url; - this._token = token; - this._messages = {}; - this._subscriptions = { 'eth_subscription': [], 'parity_subscription': [], 'shh_subscription': [] }; - this._sessionHash = null; - - this._connecting = false; - this._connected = false; - this._lastError = null; - this._autoConnect = autoconnect; - this._retries = 0; - this._reconnectTimeoutId = null; - - this._connectPromise = null; - this._connectPromiseFunctions = {}; - - if (autoconnect) { - this.connect(); - } - } - - updateToken (token, connect = true) { - this._token = token; - // this._autoConnect = true; - - if (connect) { - this.connect(); - } - } - - connect () { - if (this._connected) { - return Promise.resolve(); - } - - if (this._connecting) { - return this._connectPromise || Promise.resolve(); - } - - if (this._reconnectTimeoutId) { - window.clearTimeout(this._reconnectTimeoutId); - this._reconnectTimeoutId = null; - } - - if (this._ws) { - this._ws.onerror = null; - this._ws.onopen = null; - this._ws.onclose = null; - this._ws.onmessage = null; - this._ws.close(); - this._ws = null; - this._sessionHash = null; - } - this._connecting = true; - this._connected = false; - this._lastError = null; - - // rpc secure API - if (this._token) { - const time = parseInt(new Date().getTime() / 1000, 10); - const sha3 = keccak_256(`${this._token}:${time}`); - const hash = `${sha3}_${time}`; - - this._sessionHash = sha3; - this._ws = new WebSocket(this._url, hash); - // non-secure API - } else { - this._ws = new WebSocket(this._url); - } - - this._ws.onerror = this._onError; - this._ws.onopen = this._onOpen; - this._ws.onclose = this._onClose; - this._ws.onmessage = this._onMessage; - - // Get counts in dev mode only - if (process.env.NODE_ENV === 'development') { - this._count = 0; - this._lastCount = { - timestamp: Date.now(), - count: 0 - }; - - window.setInterval(() => { - const n = this._count - this._lastCount.count; - const t = (Date.now() - this._lastCount.timestamp) / 1000; - const s = Math.round(1000 * n / t) / 1000; - - if (this._debug) { - console.log('::parityWS', `speed: ${s} req/s`, `count: ${this._count}`, `(+${n})`); - } - - this._lastCount = { - timestamp: Date.now(), - count: this._count - }; - }, 5000); - - window._parityWS = this; - } - - this._connectPromise = new Promise((resolve, reject) => { - this._connectPromiseFunctions = { resolve, reject }; - }); - - return this._connectPromise; - } - - _onOpen = (event) => { - this._setConnected(); - this._connecting = false; - this._retries = 0; - - Object.keys(this._messages) - .filter((id) => this._messages[id].queued) - .forEach(this._send); - - this._connectPromiseFunctions.resolve(); - - this._connectPromise = null; - this._connectPromiseFunctions = {}; - } - - _onClose = (event) => { - this._setDisconnected(); - this._connecting = false; - - event.timestamp = Date.now(); - this._lastError = event; - - if (this._autoConnect) { - const timeout = this.retryTimeout; - - const time = timeout < 1000 - ? Math.round(timeout) + 'ms' - : (Math.round(timeout / 10) / 100) + 's'; - - console.log('ws:onClose', `trying again in ${time}...`); - - this._reconnectTimeoutId = setTimeout(() => { - this.connect(); - }, timeout); - - return; - } - - if (this._connectPromise) { - this._connectPromiseFunctions.reject(event); - - this._connectPromise = null; - this._connectPromiseFunctions = {}; - } - - console.log('ws:onClose'); - } - - _onError = (event) => { - // Only print error if the WS is connected - // ie. don't print if error == closed - window.setTimeout(() => { - if (this._connected) { - console.error('ws:onError'); - - event.timestamp = Date.now(); - this._lastError = event; - - if (this._connectPromise) { - this._connectPromiseFunctions.reject(event); - - this._connectPromise = null; - this._connectPromiseFunctions = {}; - } - } - }, 50); - } - - _extract = (result) => { - const { result: res, id, method, params } = result; - const msg = this._messages[id]; - - // initial pubsub ACK - if (id && msg.subscription) { - // save subscription to map subId -> messageId - this._subscriptions[msg.subscription][res] = id; - // resolve promise with messageId because subId's can collide (eth/parity) - msg.resolve(id); - // save subId for unsubscribing later - msg.subId = res; - return msg; - } - - // normal message - if (id) { - return msg; - } - - // pubsub format - if (method.includes('subscription')) { - const messageId = this._messages[this._subscriptions[method][params.subscription]]; - - if (messageId) { - return messageId; - } else { - throw Error(`Received Subscription which is already unsubscribed ${JSON.stringify(result)}`); - } - } - - throw Error(`Unknown message format: No ID or subscription ${JSON.stringify(result)}`); - } - - _onMessage = (event) => { - try { - const result = JSON.parse(event.data); - const { method, params, json, resolve, reject, callback, subscription } = this._extract(result); - - Logging.send(method, params, { json, result }); - - result.error = (result.params && result.params.error) || result.error; - if (result.error) { - this.error(event.data); - - // Don't print error if request rejected or not is not yet up... - if (!/(rejected|not yet up)/.test(result.error.message)) { - console.error(`${method}(${JSON.stringify(params)}): ${result.error.code}: ${result.error.message}`); - } - - const error = new TransportError(method, result.error.code, result.error.message); - - if (result.id) { - reject(error); - } else { - callback(error); - } - - delete this._messages[result.id]; - return; - } - - // if not initial subscription message resolve & delete - if (result.id && !subscription) { - resolve(result.result); - delete this._messages[result.id]; - } else if (result.params) { - callback(null, result.params.result); - } - } catch (e) { - console.error('ws::_onMessage', event.data, e); - } - } - - _send = (id) => { - const message = this._messages[id]; - - if (this._connected) { - if (process.env.NODE_ENV === 'development') { - this._count++; - } - - return this._ws.send(message.json); - } - - message.queued = !this._connected; - message.timestamp = Date.now(); - } - - _execute (method, params) { - return new Promise((resolve, reject) => { - const id = this.id; - const json = this.encode(method, params); - - this._messages[id] = { id, method, params, json, resolve, reject }; - this._send(id); - }); - } - - _methodsFromApi (api) { - const method = `${api}_subscribe`; - const uMethod = `${api}_unsubscribe`; - const subscription = `${api}_subscription`; - - return { method, uMethod, subscription }; - } - - subscribe (api, callback, ...params) { - return new Promise((resolve, reject) => { - const id = this.id; - const { method, uMethod, subscription } = this._methodsFromApi(api); - const json = this.encode(method, params); - - this._messages[id] = { id, method, uMethod, params, json, resolve, reject, callback, subscription }; - - this._send(id); - }); - } - - unsubscribe (messageId) { - return new Promise((resolve, reject) => { - const id = this.id; - const { subId, uMethod, subscription } = this._messages[messageId]; - const params = [subId]; - const json = this.encode(uMethod, params); - const uResolve = (v) => { - delete this._messages[messageId]; - delete this._subscriptions[subscription][subId]; - resolve(v); - }; - - this._messages[id] = { id, method: uMethod, params, json, resolve: uResolve, reject }; - this._send(id); - }); - } - - set url (url) { - this._url = url; - } - - get token () { - return this._token; - } - - get sessionHash () { - return this._sessionHash; - } - - get isAutoConnect () { - return this._autoConnect; - } - - get isConnecting () { - return this._connecting; - } - - get lastError () { - return this._lastError; - } - - /** - * Exponential Timeout for Retries - * - * @see http://dthain.blogspot.de/2009/02/exponential-backoff-in-distributed.html - */ - get retryTimeout () { - // R between 1 and 2 - const R = Math.random() + 1; - // Initial timeout (100ms) - const T = 100; - // Exponential Factor - const F = 2; - // Max timeout (4s) - const M = 4000; - // Current number of retries - const N = this._retries; - - // Increase retries number - this._retries++; - - return Math.min(R * T * Math.pow(F, N), M); - } -} diff --git a/js-old/src/api/transport/ws/ws.spec.js b/js-old/src/api/transport/ws/ws.spec.js deleted file mode 100644 index 0d3c9836f5e..00000000000 --- a/js-old/src/api/transport/ws/ws.spec.js +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { TEST_WS_URL, mockWs } from '../../../../test/mockRpc'; -import Ws from './ws'; - -describe('api/transport/Ws', () => { - let transport; - let scope; - - describe('transport emitter', () => { - const connect = () => { - const scope = mockWs(); - const transport = new Ws(TEST_WS_URL); - - return { transport, scope }; - }; - - it('emits open event', (done) => { - const { transport, scope } = connect(); - - transport.once('open', () => { - done(); - }); - - scope.stop(); - }); - - it('emits close event', (done) => { - const { transport, scope } = connect(); - - transport.once('open', () => { - scope.server.close(); - }); - - transport.once('close', () => { - done(); - }); - }); - }); - - describe('transport', () => { - let result; - - beforeEach(() => { - scope = mockWs([{ method: 'test_anyCall', reply: 'TestResult' }]); - transport = new Ws(TEST_WS_URL); - - return transport - .execute('test_anyCall', 1, 2, 3) - .then((_result) => { - result = _result; - }); - }); - - afterEach(() => { - scope.stop(); - }); - - it('makes call', () => { - expect(scope.isDone()).to.be.true; - }); - - it('sets jsonrpc', () => { - expect(scope.body.test_anyCall.jsonrpc).to.equal('2.0'); - }); - - it('sets the method', () => { - expect(scope.body.test_anyCall.method).to.equal('test_anyCall'); - }); - - it('passes the params', () => { - expect(scope.body.test_anyCall.params).to.deep.equal([1, 2, 3]); - }); - - it('increments the id', () => { - expect(scope.body.test_anyCall.id).not.to.equal(0); - }); - - it('passes the actual result back', () => { - expect(result).to.equal('TestResult'); - }); - }); - - describe('errors', () => { - beforeEach(() => { - scope = mockWs([{ method: 'test_anyCall', reply: { error: { code: 1, message: 'TestError' } } }]); - transport = new Ws(TEST_WS_URL); - }); - - afterEach(() => { - scope.stop(); - }); - - it('returns RPC errors when encountered', () => { - return transport - .execute('test_anyCall') - .catch((error) => { - expect(error).to.match(/TestError/); - }); - }); - }); -}); diff --git a/js-old/src/api/util/decode.js b/js-old/src/api/util/decode.js deleted file mode 100644 index 926a5a8a154..00000000000 --- a/js-old/src/api/util/decode.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { isHex } from './types'; - -import Func from '../../abi/spec/function'; -import { fromParamType, toParamType } from '../../abi/spec/paramType/format'; - -export function decodeCallData (data) { - if (!isHex(data)) { - throw new Error('Input to decodeCallData should be a hex value'); - } - - if (data.substr(0, 2) === '0x') { - return decodeCallData(data.slice(2)); - } - - if (data.length < 8) { - throw new Error('Input to decodeCallData should be method signature + data'); - } - - const signature = data.substr(0, 8); - const paramdata = data.substr(8); - - return { - signature: `0x${signature}`, - paramdata: `0x${paramdata}` - }; -} - -export function decodeMethodInput (methodAbi, paramdata) { - if (!methodAbi) { - throw new Error('decodeMethodInput should receive valid method-specific ABI'); - } - - if (paramdata && paramdata.length) { - if (!isHex(paramdata)) { - throw new Error('Input to decodeMethodInput should be a hex value'); - } - - if (paramdata.substr(0, 2) === '0x') { - return decodeMethodInput(methodAbi, paramdata.slice(2)); - } - } - - return new Func(methodAbi).decodeInput(paramdata).map((decoded) => decoded.value); -} - -// takes a method in form name(...,types) and returns the inferred abi definition -export function methodToAbi (method) { - const length = method.length; - const typesStart = method.indexOf('('); - const typesEnd = method.indexOf(')'); - - if (typesStart === -1) { - throw new Error(`Missing start ( in call to decodeMethod with ${method}`); - } else if (typesEnd === -1) { - throw new Error(`Missing end ) in call to decodeMethod with ${method}`); - } else if (typesEnd < typesStart) { - throw new Error(`End ) is before start ( in call to decodeMethod with ${method}`); - } else if (typesEnd !== length - 1) { - throw new Error(`Extra characters after end ) in call to decodeMethod with ${method}`); - } - - const name = method.substr(0, typesStart); - const types = method.substr(typesStart + 1, length - (typesStart + 1) - 1).split(','); - const inputs = types.filter((_type) => _type.length).map((_type) => { - const type = fromParamType(toParamType(_type)); - - return { type }; - }); - - return { type: 'function', name, inputs }; -} - -export function abiDecode (inputTypes, data) { - return decodeMethodInput({ - inputs: inputTypes.map((type) => { - return { type }; - }) - }, data); -} diff --git a/js-old/src/api/util/decode.spec.js b/js-old/src/api/util/decode.spec.js deleted file mode 100644 index 006c6a86392..00000000000 --- a/js-old/src/api/util/decode.spec.js +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; -import { abiDecode, decodeCallData, decodeMethodInput, methodToAbi } from './decode'; - -describe('api/util/decode', () => { - const METH = '0x70a08231'; - const ENCO = '0x70a082310000000000000000000000005A5eFF38DA95b0D58b6C616f2699168B480953C9'; - const DATA = '0x0000000000000000000000005A5eFF38DA95b0D58b6C616f2699168B480953C9'; - - describe('decodeCallData', () => { - it('throws on non-hex inputs', () => { - expect(() => decodeCallData('invalid')).to.throw(/should be a hex value/); - }); - - it('throws when invalid signature length', () => { - expect(() => decodeCallData(METH.slice(-6))).to.throw(/should be method signature/); - }); - - it('splits valid inputs properly', () => { - expect(decodeCallData(ENCO)).to.deep.equal({ - signature: METH, - paramdata: DATA - }); - }); - }); - - describe('decodeMethodInput', () => { - it('expects a valid ABI', () => { - expect(() => decodeMethodInput(null, null)).to.throw(/should receive valid method/); - }); - - it('expect valid hex parameter data', () => { - expect(() => decodeMethodInput({}, 'invalid')).to.throw(/should be a hex value/); - }); - - it('correctly decodes valid inputs', () => { - expect( - decodeMethodInput({ - type: 'function', - inputs: [ - { type: 'uint' } - ] - }, DATA) - ).to.deep.equal( - [ new BigNumber('0x5a5eff38da95b0d58b6c616f2699168b480953c9') ] - ); - }); - }); - - describe('methodToAbi', () => { - it('throws when no start ( specified', () => { - expect(() => methodToAbi('invalid,uint,bool)')).to.throw(/Missing start \(/); - }); - - it('throws when no end ) specified', () => { - expect(() => methodToAbi('invalid(uint,bool')).to.throw(/Missing end \)/); - }); - - it('throws when end ) is not in the last position', () => { - expect(() => methodToAbi('invalid(uint,bool)2')).to.throw(/Extra characters after end \)/); - }); - - it('throws when start ( is after end )', () => { - expect(() => methodToAbi('invalid)uint,bool(')).to.throw(/End \) is before start \(/); - }); - - it('throws when invalid types are present', () => { - expect(() => methodToAbi('method(invalidType,bool,uint)')).to.throw(/Cannot convert invalidType/); - }); - - it('returns a valid methodabi for a valid method', () => { - expect(methodToAbi('valid(uint,bool)')).to.deep.equals({ - type: 'function', - name: 'valid', - inputs: [ - { type: 'uint256' }, - { type: 'bool' } - ] - }); - }); - }); - - describe('abiDecode', () => { - it('correctly decodes valid inputs', () => { - expect(abiDecode(['uint'], DATA)).to.deep.equal( - [ new BigNumber('0x5a5eff38da95b0d58b6c616f2699168b480953c9') ] - ); - }); - }); -}); diff --git a/js-old/src/api/util/encode.js b/js-old/src/api/util/encode.js deleted file mode 100644 index f18fbbe2b7b..00000000000 --- a/js-old/src/api/util/encode.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import Abi from '~/abi'; -import Func from '~/abi/spec/function'; - -import { abiDecode } from './decode'; -import { cleanupValue } from './format'; -import { sha3 } from './sha3'; - -export function encodeMethodCallAbi (methodAbi = {}, values = []) { - const func = new Func(methodAbi); - const tokens = Abi.encodeTokens(func.inputParamTypes(), values); - const call = func.encodeCall(tokens); - - return `0x${call}`; -} - -export function abiEncode (methodName, inputTypes, data) { - const result = encodeMethodCallAbi({ - name: methodName || '', - type: 'function', - inputs: inputTypes.map((type) => { - return { type }; - }) - }, data); - - return result; -} - -export function abiUnencode (abi, data) { - const callsig = data.substr(2, 8); - const op = abi.find((field) => { - return field.type === 'function' && - abiSignature(field.name, field.inputs.map((input) => input.type)).substr(2, 8) === callsig; - }); - - if (!op) { - console.warn(`Unknown function ID: ${callsig}`); - return null; - } - - let argsByIndex = abiDecode(op.inputs.map((field) => field.type), '0x' + data.substr(10)) - .map((value, index) => cleanupValue(value, op.inputs[index].type)); - const argsByName = op.inputs.reduce((result, field, index) => { - result[field.name] = argsByIndex[index]; - - return result; - }, {}); - - return [op.name, argsByName, argsByIndex]; -} - -export function abiSignature (name, inputs) { - return sha3(`${name}(${inputs.join()})`); -} diff --git a/js-old/src/api/util/encode.spec.js b/js-old/src/api/util/encode.spec.js deleted file mode 100644 index 7847f06ecc8..00000000000 --- a/js-old/src/api/util/encode.spec.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { abiEncode, abiUnencode, abiSignature, encodeMethodCallAbi } from './encode'; - -const ABI = { - type: 'function', - name: 'valid', - inputs: [ - { type: 'uint256' }, - { type: 'bool' } - ] -}; - -const RESULT = [ - 'f87fa141', - '0000000000000000000000000000000000000000000000000000000000000123', - '0000000000000000000000000000000000000000000000000000000000000001' -].join(''); -const VARIABLE = [ - '5a6fbce0', - 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470', - '0000000000000000000000000000000000000000000000000000000000000040', - '000000000000000000000000000000000000000000000000000000000000000f', - '687474703a2f2f666f6f2e6261722f0000000000000000000000000000000000' -].join(''); - -describe('api/util/encode', () => { - describe('encodeMethodCallAbi', () => { - it('encodes calls with the correct result', () => { - expect(encodeMethodCallAbi(ABI, [0x123, true])).to.equal(`0x${RESULT}`); - }); - }); - - describe('abiEncode', () => { - it('encodes calls with the correct result', () => { - expect(abiEncode('valid', ['uint256', 'bool'], [0x123, true])).to.equal(`0x${RESULT}`); - }); - - it('encodes variable values', () => { - expect( - abiEncode( - 'hintUrl', ['bytes32', 'string'], ['0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470', 'http://foo.bar/'] - ) - ).to.equal(`0x${VARIABLE}`); - }); - - it('encodes only the data with null name', () => { - expect( - abiEncode(null, ['uint256', 'bool'], [0x123, true]) - ).to.equal(`0x${RESULT.substr(8)}`); - }); - }); - - describe('abiUnencode', () => { - it('decodes data correctly from abi', () => { - expect( - abiUnencode([{ - name: 'test', - type: 'function', - inputs: [ - { type: 'uint', name: 'arga' } - ] - }], '0x1acb6f7700000000000000000000000000000038') - ).to.deep.equal(['test', { arga: 56 }, [56]]); - }); - }); - - // Same example as in abi/util/signature.spec.js - describe('abiSignature', () => { - it('encodes baz(uint32,bool) correctly', () => { - expect( - abiSignature('baz', ['uint32', 'bool']) - ).to.equal('0xcdcd77c0992ec5bbfc459984220f8c45084cc24d9b6efed1fae540db8de801d2'); - }); - }); -}); diff --git a/js-old/src/api/util/format.js b/js-old/src/api/util/format.js deleted file mode 100644 index 6a4a81d4004..00000000000 --- a/js-old/src/api/util/format.js +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { range } from 'lodash'; - -export function bytesToHex (bytes) { - return '0x' + Buffer.from(bytes).toString('hex'); -} - -export function cleanupValue (value, type) { - // TODO: make work with arbitrary depth arrays - if (value instanceof Array && type.match(/bytes[0-9]+/)) { - // figure out if it's an ASCII string hiding in there: - let ascii = ''; - - for (let index = 0, ended = false; index < value.length && ascii !== null; ++index) { - const val = value[index]; - - if (val === 0) { - ended = true; - } else { - ascii += String.fromCharCode(val); - } - - if ((ended && val !== 0) || (!ended && (val < 32 || val >= 128))) { - ascii = null; - } - } - - value = ascii === null - ? bytesToHex(value) - : ascii; - } - - if (type.substr(0, 4) === 'uint' && +type.substr(4) <= 48) { - value = +value; - } - - return value; -} - -export function hexToBytes (hex) { - const raw = toHex(hex).slice(2); - const bytes = []; - - for (let i = 0; i < raw.length; i += 2) { - bytes.push(parseInt(raw.substr(i, 2), 16)); - } - - return bytes; -} - -export function hexToAscii (hex) { - const bytes = hexToBytes(hex); - const str = bytes.map((byte) => String.fromCharCode(byte)).join(''); - - return str; -} - -export function bytesToAscii (bytes) { - return bytes.map((b) => String.fromCharCode(b % 512)).join(''); -} - -export function asciiToHex (string) { - return '0x' + string.split('') - .map(s => s.charCodeAt(0)) - .map(s => s < 0x10 ? '0' + s.toString(16) : s.toString(16)) - .join(''); -} - -export function padRight (input, length) { - const value = toHex(input).substr(2, length * 2); - - return '0x' + value + range(length * 2 - value.length).map(() => '0').join(''); -} - -export function padLeft (input, length) { - const value = toHex(input).substr(2, length * 2); - - return '0x' + range(length * 2 - value.length).map(() => '0').join('') + value; -} - -export function toHex (str) { - if (str && str.toString) { - str = str.toString(16); - } - - if (str && str.substr(0, 2) === '0x') { - return str.toLowerCase(); - } - - return `0x${(str || '').toLowerCase()}`; -} diff --git a/js-old/src/api/util/format.spec.js b/js-old/src/api/util/format.spec.js deleted file mode 100644 index ba7a3994e04..00000000000 --- a/js-old/src/api/util/format.spec.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { bytesToHex, cleanupValue, hexToBytes, hexToAscii, bytesToAscii, asciiToHex } from './format'; - -describe('api/util/format', () => { - describe('bytesToHex', () => { - it('correctly converts an empty array', () => { - expect(bytesToHex([])).to.equal('0x'); - }); - - it('correctly converts a non-empty array', () => { - expect(bytesToHex([0, 15, 16])).to.equal('0x000f10'); - }); - }); - - describe('cleanupValue', () => { - it('returns unknown values as the original', () => { - expect(cleanupValue('original', 'unknown')).to.equal('original'); - }); - - it('returns ascii arrays as ascii', () => { - expect(cleanupValue([97, 115, 99, 105, 105, 0], 'bytes32')).to.equal('ascii'); - }); - - it('returns non-ascii arrays as hex strings', () => { - expect(cleanupValue([97, 200, 0, 0], 'bytes4')).to.equal('0x61c80000'); - }); - - it('returns uint (>48) as the original', () => { - expect(cleanupValue('original', 'uint49')).to.equal('original'); - }); - - it('returns uint (<=48) as the number value', () => { - expect(cleanupValue('12345', 'uint48')).to.equal(12345); - }); - }); - - describe('hexToBytes', () => { - it('correctly converts an empty string', () => { - expect(hexToBytes('')).to.deep.equal([]); - expect(hexToBytes('0x')).to.deep.equal([]); - }); - - it('correctly converts a non-empty string', () => { - expect(hexToBytes('0x000f10')).to.deep.equal([0, 15, 16]); - }); - }); - - describe('asciiToHex', () => { - it('correctly converts an empty string', () => { - expect(asciiToHex('')).to.equal('0x'); - }); - - it('correctly converts a non-empty string', () => { - expect(asciiToHex('abc')).to.equal('0x616263'); - expect(asciiToHex('a\nb')).to.equal('0x610a62'); - }); - }); - - describe('hexToAscii', () => { - it('correctly converts an empty string', () => { - expect(hexToAscii('')).to.equal(''); - expect(hexToAscii('0x')).to.equal(''); - }); - - it('correctly converts a non-empty string', () => { - expect(hexToAscii('0x616263')).to.equal('abc'); - }); - }); - - describe('bytesToAscii', () => { - it('correctly converts an empty string', () => { - expect(bytesToAscii([])).to.equal(''); - }); - - it('correctly converts a non-empty string', () => { - expect(bytesToAscii([97, 98, 99])).to.equal('abc'); - }); - }); -}); diff --git a/js-old/src/api/util/identity.js b/js-old/src/api/util/identity.js deleted file mode 100644 index 4df7ab9bb23..00000000000 --- a/js-old/src/api/util/identity.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import blockies from 'blockies'; - -// jsdom doesn't have all the browser features, blockies fail -const TEST_ENV = process.env.NODE_ENV === 'test'; - -export function createIdentityImg (address, scale = 8) { - return TEST_ENV - ? 'test-createIdentityImg' - : blockies({ - seed: (address || '').toLowerCase(), - size: 8, - scale - }).toDataURL(); -} diff --git a/js-old/src/api/util/index.js b/js-old/src/api/util/index.js deleted file mode 100644 index 30328856bd5..00000000000 --- a/js-old/src/api/util/index.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { isAddress as isAddressValid, toChecksumAddress } from '../../abi/util/address'; -import { abiDecode, decodeCallData, decodeMethodInput, methodToAbi } from './decode'; -import { abiEncode, abiUnencode, abiSignature, encodeMethodCallAbi } from './encode'; -import { bytesToHex, hexToAscii, hexToBytes, asciiToHex, cleanupValue } from './format'; -import { fromWei, toWei } from './wei'; -import { sha3 } from './sha3'; -import { isArray, isFunction, isHex, isInstanceOf, isString } from './types'; -import { createIdentityImg } from './identity'; - -export default { - abiDecode, - abiEncode, - abiUnencode, - abiSignature, - cleanupValue, - isAddressValid, - isArray, - isFunction, - isHex, - isInstanceOf, - isString, - bytesToHex, - hexToAscii, - hexToBytes, - asciiToHex, - createIdentityImg, - decodeCallData, - decodeMethodInput, - encodeMethodCallAbi, - methodToAbi, - fromWei, - toChecksumAddress, - toWei, - sha3 -}; diff --git a/js-old/src/api/util/sha3.js b/js-old/src/api/util/sha3.js deleted file mode 100644 index 3ca49cc8e6f..00000000000 --- a/js-old/src/api/util/sha3.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { keccak_256 } from 'js-sha3'; // eslint-disable-line - -import { hexToBytes } from './format'; -import { isHex } from './types'; - -export function sha3 (value, options) { - const forceHex = options && options.encoding === 'hex'; - - if (forceHex || (!options && isHex(value))) { - const bytes = hexToBytes(value); - - return sha3(bytes); - } - - const hash = keccak_256(value); - - return `0x${hash}`; -} - -sha3.text = (val) => sha3(val, { encoding: 'raw' }); diff --git a/js-old/src/api/util/sha3.spec.js b/js-old/src/api/util/sha3.spec.js deleted file mode 100644 index a5c93d9404a..00000000000 --- a/js-old/src/api/util/sha3.spec.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { sha3 } from './sha3'; - -describe('api/util/sha3', () => { - describe('sha3', () => { - it('constructs a correct sha3 value', () => { - expect(sha3('jacogr')).to.equal('0x2f4ff4b5a87abbd2edfed699db48a97744e028c7f7ce36444d40d29d792aa4dc'); - }); - - it('constructs a correct sha3 encoded as hex', () => { - const key = '000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298' + '0000000000000000000000000000000000000000000000000000000000000001'; - - expect(sha3(key, { encoding: 'hex' })).to.equal('0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9'); - expect(sha3(`0x${key}`, { encoding: 'hex' })).to.equal('0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9'); - }); - - it('constructs a correct sha3 from Uint8Array', () => { - expect(sha3('01020304', { encoding: 'hex' })).to.equal('0xa6885b3731702da62e8e4a8f584ac46a7f6822f4e2ba50fba902f67b1588d23b'); - expect(sha3(Uint8Array.from([1, 2, 3, 4]))).to.equal('0xa6885b3731702da62e8e4a8f584ac46a7f6822f4e2ba50fba902f67b1588d23b'); - }); - - it('should interpret as bytes by default', () => { - expect(sha3('0x01020304')).to.equal('0xa6885b3731702da62e8e4a8f584ac46a7f6822f4e2ba50fba902f67b1588d23b'); - }); - - it('should force text if option is passed', () => { - expect(sha3('0x01020304', { encoding: 'raw' })).to.equal('0x16bff43de576d28857dcba65a56fc17c5e93c09bd6a709268eff8e62025ae869'); - expect(sha3.text('0x01020304')).to.equal('0x16bff43de576d28857dcba65a56fc17c5e93c09bd6a709268eff8e62025ae869'); - }); - }); -}); diff --git a/js-old/src/api/util/types.js b/js-old/src/api/util/types.js deleted file mode 100644 index f4278cb5179..00000000000 --- a/js-old/src/api/util/types.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -const HEXDIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; - -export function isArray (test) { - return Object.prototype.toString.call(test) === '[object Array]'; -} - -export function isError (test) { - return Object.prototype.toString.call(test) === '[object Error]'; -} - -export function isFunction (test) { - return Object.prototype.toString.call(test) === '[object Function]'; -} - -export function isHex (_test) { - if (!isString(_test)) { - return false; - } - - if (_test.substr(0, 2) === '0x') { - return isHex(_test.slice(2)); - } - - const test = _test.toLowerCase(); - let hex = true; - - for (let idx = 0; hex && idx < test.length; idx++) { - hex = HEXDIGITS.includes(test[idx]); - } - - return hex; -} - -export function isObject (test) { - return Object.prototype.toString.call(test) === '[object Object]'; -} - -export function isString (test) { - return Object.prototype.toString.call(test) === '[object String]'; -} - -export function isInstanceOf (test, clazz) { - return test instanceof clazz; -} diff --git a/js-old/src/api/util/types.spec.js b/js-old/src/api/util/types.spec.js deleted file mode 100644 index c8672f8884f..00000000000 --- a/js-old/src/api/util/types.spec.js +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import sinon from 'sinon'; - -import { isArray, isError, isFunction, isHex, isInstanceOf, isObject, isString } from './types'; -import Eth from '../rpc/eth'; - -describe('api/util/types', () => { - describe('isArray', () => { - it('correctly identifies null as false', () => { - expect(isArray(null)).to.be.false; - }); - - it('correctly identifies empty array as true', () => { - expect(isArray([])).to.be.true; - }); - - it('correctly identifies array as true', () => { - expect(isArray([1, 2, 3])).to.be.true; - }); - }); - - describe('isError', () => { - it('correctly identifies null as false', () => { - expect(isError(null)).to.be.false; - }); - - it('correctly identifies Error as true', () => { - expect(isError(new Error('an error'))).to.be.true; - }); - }); - - describe('isFunction', () => { - it('correctly identifies null as false', () => { - expect(isFunction(null)).to.be.false; - }); - - it('correctly identifies function as true', () => { - expect(isFunction(sinon.stub())).to.be.true; - }); - }); - - describe('isHex', () => { - it('correctly identifies hex by leading 0x', () => { - expect(isHex('0x123')).to.be.true; - }); - - it('correctly identifies hex without leading 0x', () => { - expect(isHex('123')).to.be.true; - }); - - it('correctly identifies non-hex values', () => { - expect(isHex('123j')).to.be.false; - }); - - it('correctly indentifies non-string values', () => { - expect(isHex(false)).to.be.false; - expect(isHex()).to.be.false; - expect(isHex([1, 2, 3])).to.be.false; - }); - }); - - describe('isInstanceOf', () => { - it('correctly identifies build-in instanceof', () => { - expect(isInstanceOf(new String('123'), String)).to.be.true; // eslint-disable-line no-new-wrappers - }); - - it('correctly identifies own instanceof', () => { - expect(isInstanceOf(new Eth({}), Eth)).to.be.true; - }); - - it('correctly reports false for own', () => { - expect(isInstanceOf({}, Eth)).to.be.false; - }); - }); - - describe('isObject', () => { - it('correctly identifies empty object as object', () => { - expect(isObject({})).to.be.true; - }); - - it('correctly identifies non-empty object as object', () => { - expect(isObject({ data: '123' })).to.be.true; - }); - - it('correctly identifies Arrays as non-objects', () => { - expect(isObject([1, 2, 3])).to.be.false; - }); - - it('correctly identifies Strings as non-objects', () => { - expect(isObject('123')).to.be.false; - }); - }); - - describe('isString', () => { - it('correctly identifies empty string as string', () => { - expect(isString('')).to.be.true; - }); - - it('correctly identifies string as string', () => { - expect(isString('123')).to.be.true; - }); - }); -}); diff --git a/js-old/src/api/util/wei.js b/js-old/src/api/util/wei.js deleted file mode 100644 index d17df695837..00000000000 --- a/js-old/src/api/util/wei.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -const UNITS = ['wei', 'ada', 'babbage', 'shannon', 'szabo', 'finney', 'ether', 'kether', 'mether', 'gether', 'tether']; - -export function _getUnitMultiplier (unit) { - const position = UNITS.indexOf(unit.toLowerCase()); - - if (position === -1) { - throw new Error(`Unknown unit ${unit} passed to wei formatter`); - } - - return 10 ** (position * 3); -} - -export function fromWei (value, unit = 'ether') { - return new BigNumber(value).div(_getUnitMultiplier(unit)); -} - -export function toWei (value, unit = 'ether') { - return new BigNumber(value).mul(_getUnitMultiplier(unit)); -} diff --git a/js-old/src/api/util/wei.spec.js b/js-old/src/api/util/wei.spec.js deleted file mode 100644 index 4476a4db610..00000000000 --- a/js-old/src/api/util/wei.spec.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { _getUnitMultiplier, fromWei, toWei } from './wei'; - -describe('api/util/wei', () => { - describe('_getUnitMultiplier', () => { - it('returns 10^0 for wei', () => { - expect(_getUnitMultiplier('wei')).to.equal(10 ** 0); - }); - - it('returns 10^15 for finney', () => { - expect(_getUnitMultiplier('finney')).to.equal(10 ** 15); - }); - - it('returns 10^18 for ether', () => { - expect(_getUnitMultiplier('ether')).to.equal(10 ** 18); - }); - - it('throws an error on invalid units', () => { - expect(() => _getUnitMultiplier('invalid')).to.throw(/passed to wei formatter/); - }); - }); - - describe('fromWei', () => { - it('formats into ether when nothing specified', () => { - expect(fromWei('1230000000000000000').toString()).to.equal('1.23'); - }); - - it('formats into finney when specified', () => { - expect(fromWei('1230000000000000000', 'finney').toString()).to.equal('1230'); - }); - }); - - describe('toWei', () => { - it('formats from ether when nothing specified', () => { - expect(toWei(1.23).toString()).to.equal('1230000000000000000'); - }); - - it('formats from finney when specified', () => { - expect(toWei(1230, 'finney').toString()).to.equal('1230000000000000000'); - }); - }); -}); diff --git a/js-old/src/contracts/badgereg.js b/js-old/src/contracts/badgereg.js index a1782cb3017..0e64583fb95 100644 --- a/js-old/src/contracts/badgereg.js +++ b/js-old/src/contracts/badgereg.js @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import { bytesToHex, hexToAscii } from '~/api/util/format'; +import { bytesToHex, hexToAscii } from '@parity/api/lib/util/format'; import ABI from './abi/certifier.json'; diff --git a/js-old/src/contracts/registry.spec.js b/js-old/src/contracts/registry.spec.js index cf81a2b7210..e9fddd8c60a 100644 --- a/js-old/src/contracts/registry.spec.js +++ b/js-old/src/contracts/registry.spec.js @@ -16,7 +16,7 @@ import sinon from 'sinon'; -import apiutil from '~/api/util'; +import apiutil from '@parity/api/lib/util'; import Registry from './registry'; diff --git a/js-old/src/dapps/chaindeploy.js b/js-old/src/dapps/chaindeploy.js deleted file mode 100644 index c3dd420085a..00000000000 --- a/js-old/src/dapps/chaindeploy.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import ReactDOM from 'react-dom'; -import React from 'react'; - -import Application from './chaindeploy/Application'; - -import '../../assets/fonts/Roboto/font.css'; -import '../../assets/fonts/RobotoMono/font.css'; -import './style.css'; - -ReactDOM.render( - , - document.querySelector('#container') -); diff --git a/js-old/src/dapps/chaindeploy/Application/application.css b/js-old/src/dapps/chaindeploy/Application/application.css deleted file mode 100644 index f6db5da2919..00000000000 --- a/js-old/src/dapps/chaindeploy/Application/application.css +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright 2015-2017 Parity Technologies (UK) Ltd. -/* This file is part of Parity. -/* -/* Parity is free software: you can redistribute it and/or modify -/* it under the terms of the GNU General Public License as published by -/* the Free Software Foundation, either version 3 of the License, or -/* (at your option) any later version. -/* -/* Parity is distributed in the hope that it will be useful, -/* but WITHOUT ANY WARRANTY; without even the implied warranty of -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/* GNU General Public License for more details. -/* -/* You should have received a copy of the GNU General Public License -/* along with Parity. If not, see . -*/ - -.body { - font-size: 0.8em; - - .buttons { - position: fixed; - right: 0.5em; - top: 0.5em; - z-index: 100; - - button { - background: rgb(0, 200, 255); - border: 2px solid rgba(0, 200, 255, 0.5); - border-radius: 0.25em; - color: white; - cursor: pointer; - font-size: 1em; - margin: 0 0 0 0.5em; - outline: none; - padding: 0.75em 1.5em; - white-space: nowrap; - - &:disabled { - background: rgb(230, 230, 230); - border: 2px solid rgba(230, 230, 230, 0.5); - cursor: default; - } - - .icon { - fill: white !important; - margin-right: 0.5em; - } - - .text { - display: inline-block; - line-height: 24px; - vertical-align: top; - } - } - } - - .section { - margin: 0 1em 3em 1em; - - h3 { - background: rgba(0, 0, 0, 0.025); - border-radius: 0.25em; - padding: 0.75em 1em; - margin-bottom: 0.5em; - - small { - vertical-align: middle; - } - } - - .list { - display: flex; - flex-direction: row; - flex-wrap: wrap; - } - } -} diff --git a/js-old/src/dapps/chaindeploy/Application/application.js b/js-old/src/dapps/chaindeploy/Application/application.js deleted file mode 100644 index 9e6fa588f6d..00000000000 --- a/js-old/src/dapps/chaindeploy/Application/application.js +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { observer } from 'mobx-react'; -import React, { Component } from 'react'; - -import Contract from '../Contract'; -import Dapp from '../Dapp'; -import Store from '../store'; - -import styles from './application.css'; - -@observer -export default class Application extends Component { - store = new Store(); - - render () { - return ( -
- { this.renderContracts(false) } - { this.renderContracts(true) } - { this.renderApps() } - { this.renderContracts(false, true) } - { this.renderApps(true) } - { this.renderButtons() } -
- ); - } - - renderButton (text, clickHandler, disabled) { - const onClick = (event) => { - if (!disabled) { - clickHandler(event); - } - }; - - return ( - - ); - } - - renderButtons () { - const { contractBadgereg, contractDappreg, isBadgeDeploying, isContractDeploying, isDappDeploying, haveAllBadges, haveAllContracts, haveAllDapps, registry } = this.store; - const disableRegistry = registry.address || registry.isDeploying; - const disableContracts = !registry.address || isContractDeploying || haveAllContracts; - const disableDapps = !contractDappreg.address || isDappDeploying || haveAllDapps; - const disableBadges = !registry.address || !contractBadgereg.address || isBadgeDeploying || haveAllBadges; - - return ( -
- { this.renderButton('registry', this.deployRegistry, disableRegistry) } - { this.renderButton('contracts', this.deployContracts, disableContracts) } - { this.renderButton('badges', this.deployBadges, disableBadges) } - { this.renderButton('apps', this.deployApps, disableDapps) } -
- ); - } - - renderContracts (isBadges, isExternal) { - const { badges, contracts, contractBadgereg, registry } = this.store; - const regaddress = isBadges - ? contractBadgereg.address - : registry.address; - - return ( -
-

- { - isExternal - ? 'External ' - : '' - }{ - isBadges - ? 'Badges ' - : 'Contracts ' - }(registry { regaddress || 'unknown' }) -

-
- { - isExternal || isBadges - ? null - : ( - - ) - } - { - (isBadges ? badges : contracts) - .filter((contract) => contract.isExternal === isExternal) - .map((contract) => { - return ( - - ); - }) - } -
-
- ); - } - - renderApps (isExternal) { - const { apps, contractDappreg, contractGithubhint } = this.store; - const isDisabled = !contractDappreg.isOnChain || !contractGithubhint.isOnChain; - - return ( -
-

- { - isExternal - ? 'External ' - : '' - }Applications (registry { - contractDappreg.address - ? contractDappreg.address - : 'unknown' - }) -

-
- { - apps - .filter((app) => app.isExternal === isExternal) - .map((app) => { - return ( - - ); - }) - } -
-
- ); - } - - deployApps = () => { - return this.store.deployApps(); - } - - deployBadges = () => { - return this.store.deployBadges(); - } - - deployContracts = () => { - return this.store.deployContracts(); - } - - deployRegistry = () => { - return this.store.deployRegistry(); - } -} diff --git a/js-old/src/dapps/chaindeploy/Application/index.js b/js-old/src/dapps/chaindeploy/Application/index.js deleted file mode 100644 index 3d8d1ca3b85..00000000000 --- a/js-old/src/dapps/chaindeploy/Application/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './application'; diff --git a/js-old/src/dapps/chaindeploy/Contract/contract.js b/js-old/src/dapps/chaindeploy/Contract/contract.js deleted file mode 100644 index 1f0b158d2b4..00000000000 --- a/js-old/src/dapps/chaindeploy/Contract/contract.js +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import React, { Component, PropTypes } from 'react'; - -import ListItem, { Header, Row } from '../ListItem'; - -export default class Contract extends Component { - static propTypes = { - contract: PropTypes.object.isRequired, - disabled: PropTypes.bool - } - - render () { - const { contract, disabled } = this.props; - const location = contract.id === 'registry' - ? 'chain' - : 'registry'; - - return ( - -
- { contract.id } was { - contract.address - ? 'deployed' - : 'not found' - } -
- - { - contract.address - ? contract.address - : 'no address' - } - - - { - contract.hasLatestCode - ? 'has latest available code' - : 'does not have latest code' - } - - - { - contract.isOnChain - ? `registered on ${location}` - : `not registered on ${location}` - } - - { this.renderBadgeInfo() } -
- ); - } - - renderBadgeInfo () { - const { contract } = this.props; - - if (!contract.isBadge) { - return null; - } - - return [ - - { - contract.isBadgeRegistered - ? 'found in badgereg' - : 'not found in badgereg' - } - , - - { - contract.badgeImageHash - ? `badge imageHash ${contract.badgeImageHash}` - : 'has not registered a badge imageHash' - } - , - - { - contract.badgeImageMatch - ? 'has latest badge imageHash' - : 'does not have latest badge imageHash' - } - - ]; - } -} diff --git a/js-old/src/dapps/chaindeploy/Contract/index.js b/js-old/src/dapps/chaindeploy/Contract/index.js deleted file mode 100644 index 74c58e942d4..00000000000 --- a/js-old/src/dapps/chaindeploy/Contract/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './contract'; diff --git a/js-old/src/dapps/chaindeploy/Dapp/dapp.js b/js-old/src/dapps/chaindeploy/Dapp/dapp.js deleted file mode 100644 index 5a997c295af..00000000000 --- a/js-old/src/dapps/chaindeploy/Dapp/dapp.js +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import React, { Component, PropTypes } from 'react'; - -import ListItem, { Header, Row } from '../ListItem'; - -export default class Dapp extends Component { - static propTypes = { - dapp: PropTypes.object.isRequired, - disabled: PropTypes.bool - } - - render () { - const { dapp, disabled } = this.props; - - return ( - -
- { dapp.name } -
- - { - dapp.isOnChain - ? 'found in dappreg' - : 'not found in dappreg' - } - - { this.renderHash(dapp, 'image') } - { this.renderHash(dapp, 'manifest') } - { this.renderHash(dapp, 'content') } -
- ); - } - - renderHash (dapp, type) { - if (!dapp.source[`${type}Hash`]) { - return null; - } - - const isMatch = dapp[`${type}Match`]; - const hash = dapp[`${type}Hash`]; - - return [ - - { - hash - ? `${type}Hash ${hash}` - : `has not registered an ${type}Hash` - } - , - - { - isMatch - ? `has latest ${type}Hash` - : `does not have latest ${type}Hash` - } - - ]; - } -} diff --git a/js-old/src/dapps/chaindeploy/Dapp/index.js b/js-old/src/dapps/chaindeploy/Dapp/index.js deleted file mode 100644 index 3d32813894b..00000000000 --- a/js-old/src/dapps/chaindeploy/Dapp/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './dapp'; diff --git a/js-old/src/dapps/chaindeploy/ListItem/Header/header.js b/js-old/src/dapps/chaindeploy/ListItem/Header/header.js deleted file mode 100644 index e9be01eeab4..00000000000 --- a/js-old/src/dapps/chaindeploy/ListItem/Header/header.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import React, { Component, PropTypes } from 'react'; - -import Icon from '../Icon'; - -import styles from '../listItem.css'; - -export default class Header extends Component { - static propTypes = { - children: PropTypes.node.isRequired, - isBusy: PropTypes.bool, - isOk: PropTypes.bool - } - - render () { - const { children, isBusy, isOk } = this.props; - - return ( -
- -
- { children } -
-
- ); - } -} diff --git a/js-old/src/dapps/chaindeploy/ListItem/Header/index.js b/js-old/src/dapps/chaindeploy/ListItem/Header/index.js deleted file mode 100644 index aef90266f94..00000000000 --- a/js-old/src/dapps/chaindeploy/ListItem/Header/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './header'; diff --git a/js-old/src/dapps/chaindeploy/ListItem/Icon/icon.js b/js-old/src/dapps/chaindeploy/ListItem/Icon/icon.js deleted file mode 100644 index 1f32622e54c..00000000000 --- a/js-old/src/dapps/chaindeploy/ListItem/Icon/icon.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import React, { Component, PropTypes } from 'react'; - -import styles from '../listItem.css'; - -export default class Icon extends Component { - static propTypes = { - isBusy: PropTypes.bool, - isOk: PropTypes.bool - } - - render () { - const { isBusy, isOk } = this.props; - - return ( -
- { - isOk - ? '\u2714' - : ( - isBusy - ? '\u29d6' - : '\u2716' - ) - } -
- ); - } -} diff --git a/js-old/src/dapps/chaindeploy/ListItem/Icon/index.js b/js-old/src/dapps/chaindeploy/ListItem/Icon/index.js deleted file mode 100644 index f43e02c4978..00000000000 --- a/js-old/src/dapps/chaindeploy/ListItem/Icon/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './icon'; diff --git a/js-old/src/dapps/chaindeploy/ListItem/Row/index.js b/js-old/src/dapps/chaindeploy/ListItem/Row/index.js deleted file mode 100644 index 5f2c62dee40..00000000000 --- a/js-old/src/dapps/chaindeploy/ListItem/Row/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './row'; diff --git a/js-old/src/dapps/chaindeploy/ListItem/Row/row.js b/js-old/src/dapps/chaindeploy/ListItem/Row/row.js deleted file mode 100644 index 0982e0321b0..00000000000 --- a/js-old/src/dapps/chaindeploy/ListItem/Row/row.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import React, { Component, PropTypes } from 'react'; - -import Icon from '../Icon'; - -import styles from '../listItem.css'; - -export default class Row extends Component { - static propTypes = { - children: PropTypes.node.isRequired, - disabled: PropTypes.bool, - isBusy: PropTypes.bool, - isOk: PropTypes.bool - } - - render () { - const { children, disabled, isBusy, isOk } = this.props; - - return ( -
- -
- { children } -
-
- ); - } -} diff --git a/js-old/src/dapps/chaindeploy/ListItem/index.js b/js-old/src/dapps/chaindeploy/ListItem/index.js deleted file mode 100644 index 7c79e3241c4..00000000000 --- a/js-old/src/dapps/chaindeploy/ListItem/index.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export Header from './Header'; -export Row from './Row'; - -export default from './listItem'; diff --git a/js-old/src/dapps/chaindeploy/ListItem/listItem.css b/js-old/src/dapps/chaindeploy/ListItem/listItem.css deleted file mode 100644 index 47d6d481d27..00000000000 --- a/js-old/src/dapps/chaindeploy/ListItem/listItem.css +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright 2015-2017 Parity Technologies (UK) Ltd. -/* This file is part of Parity. -/* -/* Parity is free software: you can redistribute it and/or modify -/* it under the terms of the GNU General Public License as published by -/* the Free Software Foundation, either version 3 of the License, or -/* (at your option) any later version. -/* -/* Parity is distributed in the hope that it will be useful, -/* but WITHOUT ANY WARRANTY; without even the implied warranty of -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/* GNU General Public License for more details. -/* -/* You should have received a copy of the GNU General Public License -/* along with Parity. If not, see . -*/ - -.listItem { - box-sizing: border-box; - flex: 0 1 33.33%; - max-width: 33.33%; - padding: 0.5em; - position: relative; - - .body { - background: rgba(0, 0, 0, 0.025); - border-radius: 0.25em; - box-sizing: border-box; - display: flex; - flex-direction: column; - flex-wrap: nowrap; - overflow: hidden; - padding: 0.75em; - } - - .status { - background: #f80; - border-radius: 0.25em; - color: white; - font-size: 0.75em; - line-height: 1em; - opacity: 0.9; - padding: 0.5em; - position: absolute; - right: 1em; - top: 1em; - } -} - -.header, -.details { - display: flex; - line-height: 1.5em; - padding: 0.125em 0; - position: relative; - white-space: nowrap; - - .title { - display: inline-block; - overflow: hidden; - text-overflow: ellipsis; - vertical-align: top; - } -} - -.details { - margin-left: 2em; -} - -.icon { - border-radius: 0.25em; - display: inline-block; - flex: 0 0 1.5em; - height: 1.5em; - margin-right: 0.5em; - opacity: 0.75; - text-align: center; - vertical-align: middle; - width: 1.5em; - - &.error { - box-shadow: inset 0 0 0 2px rgb(200, 0, 0); - color: rgb(200, 0, 0); - } - - &.ok { - box-shadow: inset 0 0 0 2px rgb(0, 200, 0); - color: rgb(0, 200, 0); - } -} - -.muted { - opacity: 0.25; -} diff --git a/js-old/src/dapps/chaindeploy/ListItem/listItem.js b/js-old/src/dapps/chaindeploy/ListItem/listItem.js deleted file mode 100644 index c670123f924..00000000000 --- a/js-old/src/dapps/chaindeploy/ListItem/listItem.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import React, { Component, PropTypes } from 'react'; - -import styles from './listItem.css'; - -export default class ListItem extends Component { - static propTypes = { - children: PropTypes.node.isRequired, - disabled: PropTypes.bool, - status: PropTypes.string - } - - render () { - const { children, disabled } = this.props; - - return ( -
-
- { children } -
- { this.renderStatus() } -
- ); - } - - renderStatus () { - const { status } = this.props; - - if (!status) { - return null; - } - - return ( -
- { status } -
- ); - } -} diff --git a/js-old/src/dapps/chaindeploy/_dapps.js b/js-old/src/dapps/chaindeploy/_dapps.js deleted file mode 100644 index 4a8da242f68..00000000000 --- a/js-old/src/dapps/chaindeploy/_dapps.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtinsJson from '~/views/Dapps/builtin.json'; - -const REGISTER_URLS = { - console: 'https://raw.githubusercontent.com/paritytech/console/3ea0dbfefded359ccdbea37bc4cf350c0aa16948/console.jpeg', - dappreg: 'https://raw.githubusercontent.com/paritytech/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/legos-64x64.png', - githubhint: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/link-64x64.jpg', - localtx: 'https://raw.githubusercontent.com/paritytech/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/stack-64x64.png', - registry: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/register-64x64.jpg', - signaturereg: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/hex-64x64.jpg', - tokendeploy: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/interlock-64x64.png', - tokenreg: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/coins-64x64.jpg', - web: 'https://raw.githubusercontent.com/paritytech/dapp-assets/ec6138115d0e1f45258969cd90b3b274e0ff2258/dapps/earth-64x64.jpg' -}; - -const builtins = builtinsJson - .filter((app) => app.id) - .map((app) => { - app.source = { - imageUrl: REGISTER_URLS[app.id] - }; - - return app; - }); - -export { - builtins -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/abi/jg-voting.json b/js-old/src/dapps/chaindeploy/contracts/abi/jg-voting.json deleted file mode 100644 index 83a07ef7cbe..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/abi/jg-voting.json +++ /dev/null @@ -1 +0,0 @@ -[{"constant":true,"inputs":[],"name":"count","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalVotes","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"hasSenderVoted","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_index","type":"uint256"},{"name":"_answer","type":"uint256"}],"name":"newAnswer","outputs":[{"name":"","type":"bool"}],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setQuestionFee","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"questionFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"get","outputs":[{"name":"closed","type":"bool"},{"name":"owner","type":"address"},{"name":"question","type":"string"},{"name":"balanceNo","type":"uint256"},{"name":"balanceYes","type":"uint256"},{"name":"balanceMaybe","type":"uint256"},{"name":"votesNo","type":"uint256"},{"name":"votesYes","type":"uint256"},{"name":"votesMaybe","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"drain","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_question","type":"string"}],"name":"newQuestion","outputs":[{"name":"","type":"bool"}],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"totalBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"answerFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_index","type":"uint256"}],"name":"closeQuestion","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setAnswerFee","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"index","type":"uint256"},{"indexed":false,"name":"question","type":"string"}],"name":"NewQuestion","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"index","type":"uint256"},{"indexed":true,"name":"answer","type":"uint256"},{"indexed":false,"name":"value","type":"uint256"}],"name":"NewAnswer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"old","type":"address"},{"indexed":true,"name":"current","type":"address"}],"name":"NewOwner","type":"event"}] diff --git a/js-old/src/dapps/chaindeploy/contracts/code/badgereg.json b/js-old/src/dapps/chaindeploy/contracts/code/badgereg.json deleted file mode 100644 index e7801722a43..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/badgereg.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/BadgeReg.sol", - "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055670de0b6b3a7640000600455341561003357fe5b5b610a6f806100436000396000f300606060405236156100bf5763ffffffff60e060020a60003504166313af403581146100c15780631e7a505f146100df5780632c0f5f591461010a5780635b8066451461014557806369fe0e2d146101675780637958533a1461017c5780638da5cb5b146101a45780639890220b146101d0578063a02b161e146101e2578063ac4ce2c6146101f7578063b72e717d14610218578063c0f6faed1461025b578063dd93890b14610299578063ddbcb5cb146102b4578063ddca3f43146102e6575bfe5b34156100c957fe5b6100dd600160a060020a0360043516610308565b005b6100f6600160a060020a036004351660243561037c565b604080519115158252519081900360200190f35b341561011257fe5b61011d600435610392565b60408051938452600160a060020a039283166020850152911682820152519081900360600190f35b341561014d57fe5b6101556103ef565b60408051918252519081900360200190f35b341561016f57fe5b6100dd6004356103f6565b005b341561018457fe5b61015560043560243561041b565b60408051918252519081900360200190f35b34156101ac57fe5b6101b461045a565b60408051600160a060020a039092168252519081900360200190f35b34156101d857fe5b6100dd610469565b005b34156101ea57fe5b6100dd6004356104bc565b005b34156101ff57fe5b6100dd600435600160a060020a03602435166105ee565b005b341561022057fe5b610234600160a060020a0360043516610721565b604080519384526020840192909252600160a060020a031682820152519081900360600190f35b341561026357fe5b61026e600435610789565b60408051600160a060020a039485168152602081019390935292168183015290519081900360600190f35b34156102a157fe5b6100dd6004356024356044356107dc565b005b6100f6600160a060020a036004358116906024359060443516610899565b604080519115158252519081900360200190f35b34156102ee57fe5b6101556109cc565b60408051918252519081900360200190f35b60005433600160a060020a0390811691161461032357610378565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a360008054600160a060020a031916600160a060020a0383161790555b5b50565b6000610389838333610899565b90505b92915050565b60008181526002602052604081205460038054600019909201929182918291859081106103bb57fe5b906000526020600020906004020160005b5080546002820154600160a060020a03918216955016925090505b509193909250565b6003545b90565b60005433600160a060020a0390811691161461041157610378565b60048190555b5b50565b600060038381548110151561042c57fe5b906000526020600020906004020160005b506000838152600391909101602052604090205490505b92915050565b600054600160a060020a031681565b60005433600160a060020a03908116911614610484576104b8565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156104b857610000565b5b5b565b60005433600160a060020a039081169116146104d757610378565b806003828154811015156104e757fe5b906000526020600020906004020160005b50600101546040517f844e89a9d524dabb877007aa0e9c395e8938fcfee93ece70c2cd0353db79c8e590600090a36001600060038381548110151561053957fe5b906000526020600020906004020160005b5054600160a060020a03168152602081019190915260400160009081208190556003805460029291908490811061057d57fe5b906000526020600020906004020160005b50600101548152602081019190915260400160009081205560038054829081106105b457fe5b906000526020600020906004020160005b508054600160a060020a03199081168255600060018301556002909101805490911690555b5b50565b60008233600160a060020a031660038281548110151561060a57fe5b906000526020600020906004020160005b5060020154600160a060020a0316146106335761071b565b600160a060020a03831660009081526001602052604090205483901561065857610718565b600380548690811061066657fe5b906000526020600020906004020160005b505460038054600160a060020a03909216945085918790811061069657fe5b906000526020600020906004020160005b508054600160a060020a031916600160a060020a039283161790558381166000908152600160209081526040808320839055928716808352918390208890558251918252915187927fa5d871c0e725767cd5aefc99c53aeca35f09dcc268145cbb13b74a7e2f48f196928290030190a25b5b505b50505050565b600160a060020a038116600090815260016020526040812054600380546000199092019291829182918590811061075457fe5b906000526020600020906004020160005b5060018101546002820154909450600160a060020a0316925090505b509193909250565b60006000600060006003858154811015156107a057fe5b906000526020600020906004020160005b50805460018201546002830154600160a060020a03928316975090955016925090505b509193909250565b8233600160a060020a03166003828154811015156107f657fe5b906000526020600020906004020160005b5060020154600160a060020a03161461081f5761071b565b8160038581548110151561082f57fe5b906000526020600020906004020160005b50600085815260039190910160209081526040918290209290925580518481529051859287927f7991c63a749706fd298fc2387764d640be6e714307b6357b1d3c2ce35cba3b52929081900390910190a35b5b50505050565b60006004543410156108aa576109c5565b600160a060020a0384166000908152600160205260409020548490156108cf576109c3565b6000848152600260205260409020548490156108ea576109c0565b60038054600181016108fc83826109d2565b916000526020600020906004020160005b5060408051606081018252600160a060020a03808b1680835260208084018c9052918a169284018390528454600160a060020a03199081168217865560018087018d905560029687018054909216909417905560035460008281529383528484208190558b8452948252918390208490558251918252915160001993909301935088927febbfb6376bef000063e6e33494e4c543a6197091a04eb6a6f55013d85a1c5386929181900390910190a3600192505b5b505b505b9392505050565b60045481565b8154818355818115116109fe576004028160040283600052602060002091820191016109fe9190610a04565b5b505050565b6103f391905b80821115610a3c578054600160a060020a03199081168255600060018301556002820180549091169055600401610a0a565b5090565b905600a165627a7a72305820526fc95faec325cec5dd3e1bb67c165265282c5fc6db21e96197060b823aaa490029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/dappreg.json b/js-old/src/dapps/chaindeploy/contracts/code/dappreg.json deleted file mode 100644 index 48739a59d28..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/dappreg.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/225bf022ddd967af2b9ea188e8f611489ca5d7fe/DappReg.sol", - "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055670de0b6b3a7640000600355341561003357fe5b5b6106ee806100436000396000f300606060405236156100a95763ffffffff60e060020a6000350416630257c48c81146100ab57806306661abd146100d357806313af4035146100f55780631a0919dc1461011357806369fe0e2d146101285780638da5cb5b1461013d5780638eaa6ac01461016957806391cd242d1461019d5780639890220b146101b8578063c52bd836146101ca578063ddca3f43146101eb578063e0886f901461020d578063e1fa8e8414610241575bfe5b34156100b357fe5b6100c160043560243561024e565b60408051918252519081900360200190f35b34156100db57fe5b6100c1610272565b60408051918252519081900360200190f35b34156100fd57fe5b610111600160a060020a0360043516610279565b005b341561011b57fe5b6101116004356102ed565b005b341561013057fe5b610111600435610388565b005b341561014557fe5b61014d6103ad565b60408051600160a060020a039092168252519081900360200190f35b341561017157fe5b61017c6004356103bc565b60408051928352600160a060020a0390911660208301528051918290030190f35b34156101a557fe5b6101116004356024356044356103e4565b005b34156101c057fe5b61011161046d565b005b34156101d257fe5b610111600435600160a060020a03602435166104c0565b005b34156101f357fe5b6100c161054e565b60408051918252519081900360200190f35b341561021557fe5b61017c600435610554565b60408051928352600160a060020a0390911660208301528051918290030190f35b6101116004356105ab565b005b60008281526001602090815260408083208484526002019091529020545b92915050565b6002545b90565b60005433600160a060020a0390811691161461029457610000565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a360008054600160a060020a031916600160a060020a0383161790555b5b50565b60008181526001602081905260409091200154819033600160a060020a0390811691161480159061032d575060005433600160a060020a03908116911614155b1561033757610000565b60008281526001602081905260408083208381559091018054600160a060020a03191690555183917fe17fec26316aebe957e188549d659a89f359c49766bcc0ae2fb7ded274ffe14691a25b5b5050565b60005433600160a060020a039081169116146103a357610000565b60038190555b5b50565b600054600160a060020a031681565b6000818152600160208190526040909120805491810154600160a060020a0316905b50915091565b60008381526001602081905260409091200154839033600160a060020a0390811691161461041157610000565b600084815260016020908152604080832086845260020182529182902084905581518481529151859287927f4dcd4fb147bb133a0da8fbf4e5fc3ddd64f04d4b3f6cbee584374b889d28c78d92918290030190a35b5b50505050565b60005433600160a060020a0390811691161461048857610000565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156104bc57610000565b5b5b565b60008281526001602081905260409091200154829033600160a060020a039081169116146104ed57610000565b60008381526001602081905260408083209091018054600160a060020a031916600160a060020a0386169081179091559051909185917fd3d10d874a10020c2bce719499d1fd8756d880b128eb2945dd01b3830854e7169190a35b5b505050565b60035481565b6000600060006001600060028681548110151561056d57fe5b906000526020600020900160005b50548152602081019190915260400160002080546001820154909450600160a060020a0316925090505b50915091565b6003543410156105ba57610000565b6000818152600160205260409020548190156105d557610000565b60028054600181016105e78382610677565b916000526020600020900160005b508390555060408051808201825283815233600160a060020a0390811660208084018281526000888152600192839052868120955186559051949091018054600160a060020a0319169490931693909317909155915184917f7d917fcbc9a29a9705ff9936ffa599500e4fd902e4486bae317414fe967b307c91a35b5b505b50565b815481835581811511610548576000838152602090206105489181019083016106a1565b5b505050565b61027691905b808211156106bb57600081556001016106a7565b5090565b905600a165627a7a7230582011d8a45e381635e9de17e14cc4de97a1e17758cfac1fd25e8a5bc1d5f4d1da9d0029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/gavcoin.json b/js-old/src/dapps/chaindeploy/contracts/code/gavcoin.json deleted file mode 100644 index f0ead4a35d6..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/gavcoin.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/GavCoin.sol", - "output": "0x606060405266038d7ea4c680006002556305f5e100600355341561001f57fe5b5b6108008061002f6000396000f300606060405236156100885763ffffffff60e060020a600035041663095ea7b3811461009f57806318160ddd146100d257806323b872dd146100f457806329cbdc861461012d57806355234ec0146101465780635af36e3e1461016857806370a0823114610192578063a035b1fe146101c0578063a9059cbb146101e2578063dd62ed3e14610215575b61009d5b61009a3360ff60020a610249565b5b565b005b34156100a757fe5b6100be600160a060020a0360043516602435610390565b604080519115158252519081900360200190f35b34156100da57fe5b6100e2610416565b60408051918252519081900360200190f35b34156100fc57fe5b6100be600160a060020a036004358116906024351660443561041c565b604080519115158252519081900360200190f35b61009d600160a060020a036004351660243561052a565b005b341561014e57fe5b6100e2610539565b60408051918252519081900360200190f35b341561017057fe5b6100be60043560243561053f565b604080519115158252519081900360200190f35b341561019a57fe5b6100e2600160a060020a03600435166106d0565b60408051918252519081900360200190f35b34156101c857fe5b6100e26106ef565b60408051918252519081900360200190f35b34156101ea57fe5b6100be600160a060020a03600435166024356106f5565b604080519115158252519081900360200190f35b341561021d57fe5b6100e2600160a060020a03600435811690602435166107a3565b60408051918252519081900360200190f35b34600080805b60008411801561026157508460025411155b1561038757600354600254620f424091025b0492508284116102835783610285565b825b9150600254620f4240830281151561029957fe5b33600160a060020a03166000818152600160208181526040808420805497909604968701865560028054855295830190915280832080548701905584548352808320909101805463ffffffff191662093a80420163ffffffff161790558154850182559254925193945084937f689dcb02b6a65e0e2f1d23ef47c1ec86604ffbed0bcb65f20150cfc7d5e5a9489190a4600380548290039081905593829003931515610382576002805466038d7ea4c6800001908190556305f5e1006003556040517f23c3dae768238f239632b5c4acb89485b440e0fa72481c4aad9f9b4f9b5a0a5f90600090a25b61024f565b5b505050505050565b600082600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a350600160a060020a0333811660009081526001602081815260408084209487168452600290940190529190208054830190555b92915050565b60005481565b600160a060020a038316600090815260016020526040812054849083908190101561044657610521565b600160a060020a0380871660009081526001602090815260408083203394851684526002019091529020548791908690819010156104835761051c565b87600160a060020a031689600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a3600160a060020a03808a166000908152600160208181526040808420338616855260028101835281852080548e900390559183905281548c9003909155928b16825291902080548901905595505b5b5050505b50509392505050565b6105348282610249565b5b5050565b60035481565b600160a060020a0333166000908152600160208181526040808420868552909201905281205483908390819010806105a35750600160a060020a03331660009081526001602081815260408084208685528301909152909120015463ffffffff1642105b156105ad576106c8565b33600160a060020a0381166000908152600160205260409020548590819010156105d6576106c4565b60405186908890600160a060020a033316907f73f04af9dcc582a923ec15d3eea990fe34adabfff2879e28d44572e01a54abb690600090a433600160a060020a0316600090815260016020818152604080842080548b9003815584548b0185558b855290920190529020805487900390819055151561068457600160a060020a03331660009081526001602081815260408084208b85528301909152822091825501805463ffffffff191690555b600160a060020a0333166108fc620f4240888a025b604051919004801590920291906000818181858888f1935050505015156106bf57610000565b600194505b5b50505b505092915050565b600160a060020a0381166000908152600160205260409020545b919050565b60025481565b33600160a060020a038116600090815260016020526040812054909190839081901015610721576106c8565b84600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600160a060020a03338116600090815260016020526040808220805488900390559187168152208054850190555b5b505092915050565b600160a060020a03808316600090815260016020908152604080832093851683526002909301905220545b929150505600a165627a7a72305820ca533a37c92e41888bda66ae0e66415d21a61c60027b269bca633d85b727875c0029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/githubhint.json b/js-old/src/dapps/chaindeploy/contracts/code/githubhint.json deleted file mode 100644 index 3470ccef0b4..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/githubhint.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/GithubHint.sol", - "output": "0x6060604052341561000c57fe5b5b6105868061001c6000396000f300606060405263ffffffff60e060020a60003504166302f2008d81146100425780632196ae0d1461009b578063267b6922146101055780637c8c6643146101c9575bfe5b341561004a57fe5b60408051602060046024803582810135601f810185900485028601850190965285855261009995833595939460449493929092019181908401838280828437509496506101de95505050505050565b005b34156100a357fe5b60408051602060046024803582810135601f81018590048502860185019096528585526100999583359593946044949392909201918190840183828082843750949650505092356bffffffffffffffffffffffff191692506102be915050565b005b341561010d57fe5b6101186004356103b1565b604080516bffffffffffffffffffffffff1984166020820152600160a060020a03831691810191909152606080825284546002600019610100600184161502019091160490820181905281906080820190869080156101b85780601f1061018d576101008083540402835291602001916101b8565b820191906000526020600020905b81548152906001019060200180831161019b57829003601f168201915b505094505050505060405180910390f35b34156101d157fe5b6100996004356103de565b005b6000828152602081905260409020600201548290600160a060020a031615801590610227575060008181526020819052604090206002015433600160a060020a03908116911614155b15610231576102b8565b6040805160608101825283815260006020808301829052600160a060020a0333168385015286825281815292902081518051929391926102749284920190610472565b506020820151600182018054606060020a909204600160a060020a031992831617905560409092015160029091018054600160a060020a0392909216919092161790555b5b505050565b6000838152602081905260409020600201548390600160a060020a031615801590610307575060008181526020819052604090206002015433600160a060020a03908116911614155b15610311576103aa565b604080516060810182528481526bffffffffffffffffffffffff198416602080830191909152600160a060020a0333168284015260008781528082529290922081518051929391926103669284920190610472565b506020820151600182018054606060020a909204600160a060020a031992831617905560409092015160029091018054600160a060020a0392909216919092161790555b5b50505050565b600060208190529081526040902060018101546002820154606060020a90910290600160a060020a031683565b6000818152602081905260409020600201548190600160a060020a031615801590610427575060008181526020819052604090206002015433600160a060020a03908116911614155b156104315761046d565b60008281526020819052604081209061044a82826104f1565b50600181018054600160a060020a03199081169091556002909101805490911690555b5b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106104b357805160ff19168380011785556104e0565b828001600101855582156104e0579182015b828111156104e05782518255916020019190600101906104c5565b5b506104ed929150610539565b5090565b50805460018160011615610100020316600290046000825580601f106105175750610535565b601f0160209004906000526020600020908101906105359190610539565b5b50565b61055791905b808211156104ed576000815560010161053f565b5090565b905600a165627a7a72305820a83571409e7b0cc4fe48edd09087f315930ab4e017c62b6d100462285a8f4ae70029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/jg-voting.json b/js-old/src/dapps/chaindeploy/contracts/code/jg-voting.json deleted file mode 100644 index 08ec4d0ed4b..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/jg-voting.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/jacogr/dapp-voting/blob/9b20754b13b9a387704c0955d88b51d2e0e1896d/src/solidity/Voting.sol", - "output": "0x606060405260008054600160a060020a03191633600160a060020a0316178155600281905560038190556004556611c37937e0800060055534156200004057fe5b5b60408051808201909152600781527f48756e6772793f0000000000000000000000000000000000000000000000000060208201526200008e906401000000006200090a6200009682021704565b505b620003af565b60008054819033600160a060020a03908116911614801590620000ba575060055434105b15620000c65762000000565b82600481511080620000d9575060a08151115b15620000e55762000000565b60018054925082810190620000fb908262000244565b50336001838154811015156200010d57fe5b906000526020600020906005020160005b508054600160a060020a03929092166101000261010060a860020a031990921691909117905560018054859190849081106200015657fe5b906000526020600020906005020160005b5060010190805190602001906200018092919062000279565b508133600160a060020a03167f7793f929911ad07e07894a20378f1eccce0fb493486c569d74045731fb583b8e866040518080602001828103825283818151815260200191508051906020019080838360008314620001fc575b805182526020831115620001fc57601f199092019160209182019101620001da565b505050905090810190601f168015620002295780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600192505b5b505b50919050565b8154818355818115116200027357600502816005028360005260206000209182019101620002739190620002ff565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620002bc57805160ff1916838001178555620002ec565b82800160010185558215620002ec579182015b82811115620002ec578251825591602001919060010190620002cf565b5b50620002fb9291506200033f565b5090565b6200033c91905b80821115620002fb578054600160a860020a031916815560006200032e600183018262000363565b5060050162000306565b5090565b90565b6200033c91905b80821115620002fb576000815560010162000346565b5090565b90565b50805460018160011615610100020316600290046000825580601f106200038b5750620003ab565b601f016020900490600052602060002090810190620003ab91906200033f565b5b50565b610d2f80620003bf6000396000f300606060405236156100bf5763ffffffff60e060020a60003504166306661abd81146100c15780630d15fd77146100e357806313af40351461010557806331d3164714610123578063476c494c1461014a5780634df6ca2a1461016c5780638a55b54d146101935780638da5cb5b146101b55780639507d39a146101e15780639890220b146102c7578063a3f66b46146102eb578063ad7a672f1461034d578063bd12b4b51461036f578063c09f32e814610391578063f41c1c93146103b8575bfe5b34156100c957fe5b6100d16103df565b60408051918252519081900360200190f35b34156100eb57fe5b6100d16103e6565b60408051918252519081900360200190f35b341561010d57fe5b610121600160a060020a03600435166103ec565b005b341561012b57fe5b61013660043561046d565b604080519115158252519081900360200190f35b6101366004356024356104b8565b604080519115158252519081900360200190f35b341561017457fe5b6101366004356106c3565b604080519115158252519081900360200190f35b341561019b57fe5b6100d16106ee565b60408051918252519081900360200190f35b34156101bd57fe5b6101c56106f4565b60408051600160a060020a039092168252519081900360200190f35b34156101e957fe5b6101f4600435610703565b604051808a15151515815260200189600160a060020a0316600160a060020a0316815260200180602001888152602001878152602001868152602001858152602001848152602001838152602001828103825289818151815260200191508051906020019080838360008314610285575b80518252602083111561028557601f199092019160209182019101610265565b505050905090810190601f1680156102b15780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34156102cf57fe5b6101366108b2565b604080519115158252519081900360200190f35b610136600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965061090a95505050505050565b604080519115158252519081900360200190f35b341561035557fe5b6100d1610ab5565b60408051918252519081900360200190f35b341561037757fe5b6100d1610abb565b60408051918252519081900360200190f35b341561039957fe5b610136600435610ac1565b604080519115158252519081900360200190f35b34156103c057fe5b610136600435610b63565b604080519115158252519081900360200190f35b6001545b90565b60035481565b60005433600160a060020a0390811691161461040757610000565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600060018281548110151561047e57fe5b906000526020600020906005020160005b50600160a060020a0333166000908152600491909101602052604090205460ff1690505b919050565b6000805433600160a060020a039081169116148015906104d9575060045434105b156104e357610000565b600154839081106104f357610000565b8360018181548110151561050357fe5b906000526020600020906005020160005b505460ff1615156001141561052857610000565b8460018181548110151561053857fe5b906000526020600020906005020160005b50600160a060020a0333166000908152600491909101602052604090205460ff1615156001141561057957610000565b84600281111561058857610000565b60038054600190810190915560028054600160a060020a0333163101905580548190899081106105b457fe5b906000526020600020906005020160005b5033600160a060020a031660008181526004929092016020526040909120805460ff191692151592909217909155600180549131918990811061060457fe5b906000526020600020906005020160005b50600088815260029190910160205260409020805490910190556001805481908990811061063f57fe5b906000526020600020906005020160005b506000888152600391909101602090815260409182902080549093019092558051600160a060020a033316318152905188928a927f8b8ed2ef61b90da02f78bd8647287f46833d5b11467db4451e5c4b165485bf46929081900390910190a3600194505b5b505b505b505b505b92915050565b6000805433600160a060020a039081169116146106df57610000565b50600581905560015b5b919050565b60055481565b600054600160a060020a031681565b6000600061070f610b8e565b600060006000600060006000600060018b81548110151561072c57fe5b906000526020600020906005020160005b5090508060000160009054906101000a900460ff1699508060000160019054906101000a9004600160a060020a03169850806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108065780601f106107db57610100808354040283529160200191610806565b820191906000526020600020905b8154815290600101906020018083116107e957829003601f168201915b505050505097508060020160006000815260200190815260200160002054965080600201600060018152602001908152602001600020549550806002016000600281526020019081526020016000205494508060030160006000815260200190815260200160002054935080600301600060018152602001908152602001600020549250806003016000600281526020019081526020016000205491505b509193959799909294969850565b6000805433600160a060020a039081169116146108ce57610000565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f19350505050151561090257610000565b5060015b5b90565b60008054819033600160a060020a0390811691161480159061092d575060055434105b1561093757610000565b82600481511080610949575060a08151115b1561095357610000565b600180549250828101906109679082610ba0565b503360018381548110151561097857fe5b906000526020600020906005020160005b508054600160a060020a03929092166101000274ffffffffffffffffffffffffffffffffffffffff001990921691909117905560018054859190849081106109cd57fe5b906000526020600020906005020160005b5060010190805190602001906109f5929190610bd2565b508133600160a060020a03167f7793f929911ad07e07894a20378f1eccce0fb493486c569d74045731fb583b8e866040518080602001828103825283818151815260200191508051906020019080838360008314610a6e575b805182526020831115610a6e57601f199092019160209182019101610a4e565b505050905090810190601f168015610a9a5780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600192505b5b505b50919050565b60025481565b60045481565b60008133600160a060020a0316600182815481101515610add57fe5b906000526020600020906005020160005b50546101009004600160a060020a031614801590610b1b575060005433600160a060020a03908116911614155b15610b2557610000565b6001600184815481101515610b3657fe5b906000526020600020906005020160005b50805460ff1916911515919091179055600191505b5b50919050565b6000805433600160a060020a03908116911614610b7f57610000565b50600481905560015b5b919050565b60408051602081019091526000815290565b815481835581811511610bcc57600502816005028360005260206000209182019101610bcc9190610c51565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c1357805160ff1916838001178555610c40565b82800160010185558215610c40579182015b82811115610c40578251825591602001919060010190610c25565b5b50610c4d929150610c9a565b5090565b6103e391905b80821115610c4d57805474ffffffffffffffffffffffffffffffffffffffffff191681556000610c8a6001830182610cbb565b50600501610c57565b5090565b90565b6103e391905b80821115610c4d5760008155600101610ca0565b5090565b90565b50805460018160011615610100020316600290046000825580601f10610ce15750610469565b601f0160209004906000526020600020908101906104699190610c9a565b5b505600a165627a7a72305820b084dcce4e3d78f8a86c925f6c3f2ed689e3674655482541076a1a22f6cdedad0029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/registry.json b/js-old/src/dapps/chaindeploy/contracts/code/registry.json deleted file mode 100644 index 809e7bcfb3c..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/registry.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/b1e0348144793e4ce6f7d6d2c4c7d0bb4ae9765e/SimpleRegistry.sol", - "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055670de0b6b3a7640000600355341561003357fe5b5b611b2f806100436000396000f300606060405236156101225763ffffffff60e060020a60003504166306b2ff47811461012457806313af40351461015457806319362a28146101725780633f3935d1146101df578063432ced04146102495780634f39ca59146102685780636795dbcd1461028f57806369fe0e2d1461030257806379ce9fac146103295780638da5cb5b1461035c57806390b97fc11461038857806392698814146103f15780639890220b14610418578063ac4e73f91461043c578063ac72c120146104b1578063c3a3582514610388578063ddca3f4314610541578063deb931a214610563578063df57b74214610592578063e30bd740146105c1578063eadf976014610172578063ef5454d6146106ca578063f25eb5c11461073f578063f6d339e414610751575bfe5b341561012c57fe5b610140600160a060020a03600435166107c7565b604080519115158252519081900360200190f35b341561015c57fe5b610170600160a060020a03600435166107fa565b005b341561017a57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101409583359593946044949392909201918190840183828082843750949650509335935061086e92505050565b604080519115158252519081900360200190f35b34156101e757fe5b610140600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843750949650610a1495505050505050565b604080519115158252519081900360200190f35b610140600435610b6e565b604080519115158252519081900360200190f35b341561027057fe5b610140600435610c03565b604080519115158252519081900360200190f35b341561029757fe5b60408051602060046024803582810135601f81018590048502860185019096528585526102e69583359593946044949392909201918190840183828082843750949650610cc495505050505050565b60408051600160a060020a039092168252519081900360200190f35b341561030a57fe5b610140600435610d40565b604080519115158252519081900360200190f35b341561033157fe5b610140600435600160a060020a0360243516610d9e565b604080519115158252519081900360200190f35b341561036457fe5b6102e6610e2e565b60408051600160a060020a039092168252519081900360200190f35b341561039057fe5b60408051602060046024803582810135601f81018590048502860185019096528585526103df9583359593946044949392909201918190840183828082843750949650610cc495505050505050565b60408051918252519081900360200190f35b34156103f957fe5b610140600435610eb9565b604080519115158252519081900360200190f35b341561042057fe5b610140610ed9565b604080519115158252519081900360200190f35b341561044457fe5b610140600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965050509235600160a060020a03169250610f6e915050565b604080519115158252519081900360200190f35b34156104b957fe5b6101406004356112ac565b604080519115158252519081900360200190f35b341561039057fe5b60408051602060046024803582810135601f81018590048502860185019096528585526103df9583359593946044949392909201918190840183828082843750949650610cc495505050505050565b60408051918252519081900360200190f35b341561054957fe5b6103df61134c565b60408051918252519081900360200190f35b341561056b57fe5b6102e6600435611352565b60408051600160a060020a039092168252519081900360200190f35b341561059a57fe5b6102e6600435611370565b60408051600160a060020a039092168252519081900360200190f35b34156105c957fe5b6105dd600160a060020a0360043516611392565b604080516020808252835181830152835191928392908301918501908083838215610623575b80518252602083111561062357601f199092019160209182019101610603565b505050905090810190601f16801561064f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017a57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101409583359593946044949392909201918190840183828082843750949650509335935061086e92505050565b604080519115158252519081900360200190f35b34156106d257fe5b610140600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965050509235600160a060020a031692506115e8915050565b604080519115158252519081900360200190f35b341561074757fe5b6101706116c6565b005b341561075957fe5b60408051602060046024803582810135601f8101859004850286018501909652858552610140958335959394604494939290920191819084018382808284375094965050509235600160a060020a0316925061185a915050565b604080519115158252519081900360200190f35b600160a060020a03811660009081526002602081905260409091205460001961010060018316150201160415155b919050565b60005433600160a060020a039081169116146108155761086a565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a360008054600160a060020a031916600160a060020a0383161790555b5b50565b600083815260016020526040812054849033600160a060020a0390811691161461089757610a0b565b6000858152600160209081526040918290209151865186936002019288929182918401908083835b602083106108de5780518252601f1990920191602091820191016108bf565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420949094555050855186928291908401908083835b6020831061093c5780518252601f19909201916020918201910161091d565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208183528a51838301528a519096508b95507fb829c3e412537bbe794c048ccb9e4605bb4aaaa8e4d4c15c1a6e0c2adc1716ea948b94508392908301919085019080838382156109cd575b8051825260208311156109cd57601f1990920191602091820191016109ad565b505050905090810190601f1680156109f95780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b509392505050565b60008133600160a060020a031660016000836040518082805190602001908083835b60208310610a555780518252601f199092019160209182019101610a36565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528501959095529290920160002060010154600160a060020a0316939093149250610aab91505057610b67565b600160a060020a03331660009081526002602090815260409091208451610ad492860190611a09565b5033600160a060020a0316836040518082805190602001908083835b60208310610b0f5780518252601f199092019160209182019101610af0565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822093507f098ae8581bb8bd9af1beaf7f2e9f51f31a8e5a8bfada4e303a645d71d9c9192092506000919050a3600191505b5b50919050565b6000818152600160205260408120548290600160a060020a031615610b9257610b67565b600354341015610ba157610b67565b6000838152600160205260408082208054600160a060020a03191633600160a060020a03169081179091559051909185917f4963513eca575aba66fdcd25f267aae85958fe6fb97e75fa25d783f1a091a2219190a3600191505b5b5b50919050565b600081815260016020526040812054829033600160a060020a03908116911614610c2c57610b67565b600083815260016020818152604080842090920154600160a060020a03168352600290528120610c5b91611a88565b60008381526001602081905260408083208054600160a060020a03199081168255920180549092169091555133600160a060020a03169185917fef1961b4d2909dc23643b309bfe5c3e5646842d98c3a58517037ef3871185af39190a3600191505b5b50919050565b600082815260016020908152604080832090518451600290920192859282918401908083835b60208310610d095780518252601f199092019160209182019101610cea565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b6000805433600160a060020a03908116911614610d5c576107f5565b60038290556040805183815290517f6bbc57480a46553fa4d156ce702beef5f3ad66303b0ed1a5d4cb44966c6584c39181900360200190a15060015b5b919050565b600082815260016020526040812054839033600160a060020a03908116911614610dc757610e26565b6000848152600160205260408082208054600160a060020a031916600160a060020a0387811691821790925591519192339091169187917f7b97c62130aa09acbbcbf7482630e756592496f1759eaf702f469cf64dfb779491a4600191505b5b5092915050565b600054600160a060020a031681565b600082815260016020908152604080832090518451600290920192859282918401908083835b60208310610d095780518252601f199092019160209182019101610cea565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b600081815260016020526040902054600160a060020a031615155b919050565b6000805433600160a060020a03908116911614610ef557610f6a565b60408051600160a060020a03301631815290517fdef931299fe61d176f949118058530c1f3f539dcb6950b4e372c9b835c33ca079181900360200190a1604051600160a060020a0333811691309091163180156108fc02916000818181858888f193505050501515610f6657610000565b5060015b5b90565b60006000836040518082805190602001908083835b60208310610fa25780518252601f199092019160209182019101610f83565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912060008181526001909252929020549193505033600160a060020a039081169116149050610ff6576112a3565b846040518082805190602001908083835b602083106110265780518252601f199092019160209182019101611007565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120600081815260019283905293909320015491955050600160a060020a03161580159250905061111257506000828152600160208181526040808420830154600160a060020a031684526002918290529283902092518354869493919283928592908116156101000260001901160480156110ff5780601f106110dd5761010080835404028352918201916110ff565b820191906000526020600020905b8154815290600101906020018083116110eb575b5050915050604051809103902060001916145b156111eb57600082815260016020818152604080842090920154600160a060020a0316835260029052812061114691611a88565b6000828152600160208181526040928390209091015491518751600160a060020a039093169288928291908401908083835b602083106111975780518252601f199092019160209182019101611178565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822093507f12491ad95fd945e444d88a894ffad3c21959880a4dcd8af99d4ae4ffc71d4abd92506000919050a35b6000828152600160208181526040928390209091018054600160a060020a031916600160a060020a0388169081179091559151875188928291908401908083835b6020831061124b5780518252601f19909201916020918201910161122c565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822093507f728435a0031f6a04538fcdd24922a7e06bc7bc945db03e83d22122d1bc5f28df92506000919050a3600192505b5b505092915050565b60008181526001602081905260409091200154600160a060020a031615155b919050565b600082815260016020908152604080832090518451600290920192859282918401908083835b60208310610d095780518252601f199092019160209182019101610cea565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b60035481565b600081815260016020526040902054600160a060020a03165b919050565b60008181526001602081905260409091200154600160a060020a03165b919050565b61139a611ad0565b600160a060020a038216600090815260026020818152604092839020805484516001821615610100026000190190911693909304601f81018390048302840183019094528383529192908301828280156114355780601f1061140a57610100808354040283529160200191611435565b820191906000526020600020905b81548152906001019060200180831161141857829003601f168201915b505050505090505b919050565b600083815260016020526040812054849033600160a060020a0390811691161461089757610a0b565b6000858152600160209081526040918290209151865186936002019288929182918401908083835b602083106108de5780518252601f1990920191602091820191016108bf565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420949094555050855186928291908401908083835b6020831061093c5780518252601f19909201916020918201910161091d565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208183528a51838301528a519096508b95507fb829c3e412537bbe794c048ccb9e4605bb4aaaa8e4d4c15c1a6e0c2adc1716ea948b94508392908301919085019080838382156109cd575b8051825260208311156109cd57601f1990920191602091820191016109ad565b505050905090810190601f1680156109f95780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b509392505050565b6000805433600160a060020a0390811691161461160457610d3a565b600160a060020a0382166000908152600260209081526040909120845161162d92860190611a09565b5081600160a060020a0316836040518082805190602001908083835b602083106116685780518252601f199092019160209182019101611649565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822093507f098ae8581bb8bd9af1beaf7f2e9f51f31a8e5a8bfada4e303a645d71d9c9192092506000919050a35060015b5b92915050565b33600160a060020a03166002600033600160a060020a0316600160a060020a0316815260200190815260200160002060405180828054600181600116156101000203166002900480156117505780601f1061172e576101008083540402835291820191611750565b820191906000526020600020905b81548152906001019060200180831161173c575b505060405190819003812092507f12491ad95fd945e444d88a894ffad3c21959880a4dcd8af99d4ae4ffc71d4abd9150600090a3600160006002600033600160a060020a0316600160a060020a0316815260200190815260200160002060405180828054600181600116156101000203166002900480156118085780601f106117e6576101008083540402835291820191611808565b820191906000526020600020905b8154815290600101906020018083116117f4575b50506040805191829003909120845260208085019590955292830160009081206001018054600160a060020a031916905533600160a060020a0316815260029094525050812061185791611a88565b5b565b600083815260016020526040812054849033600160a060020a0390811691161461188357610a0b565b60008581526001602090815260409182902091518651600160a060020a038716936002019288929182918401908083835b602083106108de5780518252601f1990920191602091820191016108bf565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420949094555050855186928291908401908083835b6020831061093c5780518252601f19909201916020918201910161091d565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208183528a51838301528a519096508b95507fb829c3e412537bbe794c048ccb9e4605bb4aaaa8e4d4c15c1a6e0c2adc1716ea948b94508392908301919085019080838382156109cd575b8051825260208311156109cd57601f1990920191602091820191016109ad565b505050905090810190601f1680156109f95780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b509392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611a4a57805160ff1916838001178555611a77565b82800160010185558215611a77579182015b82811115611a77578251825591602001919060010190611a5c565b5b50611a84929150611ae2565b5090565b50805460018160011615610100020316600290046000825580601f10611aae575061086a565b601f01602090049060005260206000209081019061086a9190611ae2565b5b50565b60408051602081019091526000815290565b610f6a91905b80821115611a845760008155600101611ae8565b5090565b905600a165627a7a723058202a8f09bd2a20f43dfe4c6adb69bf4bfa211cda23787d972cd6e33eee989cafc50029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/signaturereg.json b/js-old/src/dapps/chaindeploy/contracts/code/signaturereg.json deleted file mode 100644 index 3dd4fe07d28..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/signaturereg.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/SignatureReg.sol", - "output": "0x606060405260008054600160a060020a03191633600160a060020a0316178155600255341561002a57fe5b5b60408051808201909152601081527f726567697374657228737472696e67290000000000000000000000000000000060208201526100759064010000000061036661007c82021704565b505b61031c565b60006100f7826040518082805190602001908083835b602083106100b15780518252601f199092019160209182019101610092565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020836100ff640100000000026103d6176401000000009004565b90505b919050565b7fffffffff000000000000000000000000000000000000000000000000000000008216600090815260016020819052604082205484916002908216156101000260001901909116041561015157610274565b7fffffffff000000000000000000000000000000000000000000000000000000008416600090815260016020908152604090912084516101939286019061027c565b5060028054600101905560408051602080825285518183015285517fffffffff00000000000000000000000000000000000000000000000000000000881693600160a060020a033316937f50e01e16719d6c699e516c57f4c514e77f6bc21a978d33f23980acdddbcbd0b293899391928392908301918501908083838215610236575b80518252602083111561023657601f199092019160209182019101610216565b505050905090810190601f1680156102625780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b5092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102bd57805160ff19168380011785556102ea565b828001600101855582156102ea579182015b828111156102ea5782518255916020019190600101906102cf565b5b506102f79291506102fb565b5090565b61031991905b808211156102f75760008155600101610301565b5090565b90565b6105d78061032b6000396000f3006060604052361561005c5763ffffffff60e060020a60003504166313af4035811461005e5780633015a5211461007c5780638da5cb5b1461009e5780639890220b146100ca578063b46bcdaa146100dc578063f2c298be14610179575bfe5b341561006657fe5b61007a600160a060020a03600435166101e3565b005b341561008457fe5b61008c610264565b60408051918252519081900360200190f35b34156100a657fe5b6100ae61026a565b60408051600160a060020a039092168252519081900360200190f35b34156100d257fe5b61007a610279565b005b34156100e457fe5b6100f9600160e060020a0319600435166102cc565b60408051602080825283518183015283519192839290830191850190808383821561013f575b80518252602083111561013f57601f19909201916020918201910161011f565b505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018157fe5b6101cf600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965061036695505050505050565b604080519115158252519081900360200190f35b60005433600160a060020a039081169116146101fe57610260565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60025481565b600054600160a060020a031681565b60005433600160a060020a03908116911614610294576102c8565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156102c857610000565b5b5b565b60016020818152600092835260409283902080548451600294821615610100026000190190911693909304601f810183900483028401830190945283835291929083018282801561035e5780601f106103335761010080835404028352916020019161035e565b820191906000526020600020905b81548152906001019060200180831161034157829003601f168201915b505050505081565b60006103ce826040518082805190602001908083835b6020831061039b5780518252601f19909201916020918201910161037c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020836103d6565b90505b919050565b600160e060020a03198216600090815260016020819052604082205484916002908216156101000260001901909116041561041057610503565b600160e060020a031984166000908152600160209081526040909120845161043a9286019061050b565b506002805460010190556040805160208082528551818301528551600160e060020a0319881693600160a060020a033316937f50e01e16719d6c699e516c57f4c514e77f6bc21a978d33f23980acdddbcbd0b2938993919283929083019185019080838382156104c5575b8051825260208311156104c557601f1990920191602091820191016104a5565b505050905090810190601f1680156104f15780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b5092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061054c57805160ff1916838001178555610579565b82800160010185558215610579579182015b8281111561057957825182559160200191906001019061055e565b5b5061058692915061058a565b5090565b6105a891905b808211156105865760008155600101610590565b5090565b905600a165627a7a723058206830357dde798fafa19dd78a4460c047f76cc132713db13442c5da7485fc0ff40029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/tokendeploy.json b/js-old/src/dapps/chaindeploy/contracts/code/tokendeploy.json deleted file mode 100644 index 7dd0391b18c..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/tokendeploy.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/0ca02d60066202432305c8e9b1cbf33267478ab3/BasicCoin.sol", - "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055341561002757fe5b5b610f43806100376000396000f3006060604052361561007d5763ffffffff60e060020a600035041663061ea8cc811461007f57806306661abd146100ad57806313af4035146100cf5780635001f3b5146100ed5780638da5cb5b1461010f5780639507d39a1461013b5780639890220b14610179578063acfdfd1c1461018b578063c00ca38314610236575bfe5b341561008757fe5b61009b600160a060020a0360043516610280565b60408051918252519081900360200190f35b34156100b557fe5b61009b61029f565b60408051918252519081900360200190f35b34156100d757fe5b6100eb600160a060020a03600435166102a6565b005b34156100f557fe5b61009b610327565b60408051918252519081900360200190f35b341561011757fe5b61011f61032e565b60408051600160a060020a039092168252519081900360200190f35b341561014357fe5b61014e60043561033d565b60408051600160a060020a039485168152928416602084015292168183015290519081900360600190f35b341561018157fe5b6100eb610392565b005b60408051602060046024803582810135601f8101859004850286018501909652858552610222958335959394604494939290920191819084018382808284375050604080516020601f89358b0180359182018390048302840183019094528083529799988101979196509182019450925082915084018382808284375094965050509235600160a060020a031692506103e5915050565b604080519115158252519081900360200190f35b341561023e57fe5b61014e600160a060020a036004351660243561079b565b60408051600160a060020a039485168152928416602084015292168183015290519081900360600190f35b600160a060020a0381166000908152600260205260409020545b919050565b6001545b90565b60005433600160a060020a039081169116146102c157610000565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b620f424081565b600054600160a060020a031681565b600060006000600060018581548110151561035457fe5b906000526020600020906003020160005b50805460018201546002830154600160a060020a039283169750908216955016925090505b509193909250565b60005433600160a060020a039081169116146103ad57610000565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156103e157610000565b5b5b565b60008181808088336103f56107eb565b918252600160a060020a03166020820152604080519182900301906000f080151561041c57fe5b925061042733610280565b915083600160a060020a031663ddca3f436000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561046f57fe5b60325a03f1151561047c57fe5b50506040805151600160a060020a03331660009081526002602052919091209092506001840191506104ae90826107fb565b50600154600160a060020a03331660009081526002602052604090208054849081106104d657fe5b906000526020600020900160005b5055600180548082016104f78382610825565b916000526020600020906003020160005b60606040519081016040528087600160a060020a0316815260200133600160a060020a0316815260200188600160a060020a0316815250909190915060008201518160000160006101000a815481600160a060020a030219169083600160a060020a0316021790555060208201518160010160006101000a815481600160a060020a030219169083600160a060020a0316021790555060408201518160020160006101000a815481600160a060020a030219169083600160a060020a0316021790555050505083600160a060020a0316637b1a547c82858b620f42408c336000604051602001526040518763ffffffff1660e060020a0281526004018086600160a060020a0316600160a060020a03168152602001806020018581526020018060200184600160a060020a0316600160a060020a03168152602001838103835287818151815260200191508051906020019080838360008314610686575b80518252602083111561068657601f199092019160209182019101610666565b505050905090810190601f1680156106b25780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838382156106f1575b8051825260208311156106f157601f1990920191602091820191016106d1565b505050905090810190601f16801561071d5780820380516001836020036101000a031916815260200191505b509750505050505050506020604051808303818588803b151561073c57fe5b61235a5a03f1151561074a57fe5b5050604051600160a060020a03808716935087811692503316907f454b0172f64812df0cd504c2bd7df7aab8ff328a54d946b4bd0fa7c527adf9cc90600090a4600194505b50505050949350505050565b600160a060020a03821660009081526002602052604081208054829182916107dd9190869081106107c857fe5b906000526020600020900160005b505461033d565b9250925092505b9250925092565b604051610650806108c883390190565b81548183558181151161081f5760008381526020902061081f918101908301610857565b5b505050565b81548183558181151161081f5760030281600302836000526020600020918201910161081f9190610878565b5b505050565b6102a391905b80821115610871576000815560010161085d565b5090565b90565b6102a391905b8082111561087157805473ffffffffffffffffffffffffffffffffffffffff19908116825560018201805482169055600282018054909116905560030161087e565b5090565b905600606060405260008054600160a060020a03191633600160a060020a0316179055341561002757fe5b6040516040806106508339810160405280516020909101515b600034111561004e57610000565b8180151561005b57610000565b600183905560008054600160a060020a031916600160a060020a038416908117825581526002602052604090208390555b5b505b50505b6105af806100a16000396000f3006060604052361561007d5763ffffffff60e060020a600035041663095ea7b3811461009257806313af4035146100c557806318160ddd146100e357806323b872dd146101055780635001f3b51461013e57806370a08231146101605780638da5cb5b1461018e578063a9059cbb146101ba578063dd62ed3e146101ed575b341561008557fe5b6100905b610000565b565b005b341561009a57fe5b6100b1600160a060020a0360043516602435610221565b604080519115158252519081900360200190f35b34156100cd57fe5b610090600160a060020a03600435166102b6565b005b34156100eb57fe5b6100f3610337565b60408051918252519081900360200190f35b341561010d57fe5b6100b1600160a060020a036004358116906024351660443561033d565b604080519115158252519081900360200190f35b341561014657fe5b6100f361045d565b60408051918252519081900360200190f35b341561016857fe5b6100f3600160a060020a0360043516610464565b60408051918252519081900360200190f35b341561019657fe5b61019e610483565b60408051600160a060020a039092168252519081900360200190f35b34156101c257fe5b6100b1600160a060020a0360043516602435610492565b604080519115158252519081900360200190f35b34156101f557fe5b6100f3600160a060020a0360043581169060243516610552565b60408051918252519081900360200190f35b6000600034111561023157610000565b82600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a350600160a060020a0333811660009081526002602090815260408083209386168352600193840190915290208054830190555b5b92915050565b60005433600160a060020a039081169116146102d157610000565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60015481565b6000600034111561034d57610000565b600160a060020a038416600090815260026020526040902054849083908190101561037757610000565b600160a060020a0380871660009081526002602090815260408083203394851684526001019091529020548791908690819010156103b457610000565b87600160a060020a031689600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a3600160a060020a03808a16600090815260026020818152604080842033861685526001808201845282862080548f900390559390925281548c9003909155928b16825291902080548901905595505b5b5050505b50505b9392505050565b620f424081565b600160a060020a0381166000908152600260205260409020545b919050565b600054600160a060020a031681565b600060003411156104a257610000565b33600160a060020a0381166000908152600260205260409020548390819010156104cb57610000565b84600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600160a060020a0333811660009081526002602052604080822080548890039055918716815220805485019055600192505b5b50505b92915050565b600160a060020a03808316600090815260026020908152604080832093851683526001909301905220545b929150505600a165627a7a72305820b5bf89a0a85c15df1e9717e49be06fe1a4f9dcc1e0cebf5483dd1c0bcd14a0910029a165627a7a723058207f96b7ad40c02cfaeaf29e65c79456dd3fd9828c9d3fbaf801fb60010456c3880029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/tokenreg.json b/js-old/src/dapps/chaindeploy/contracts/code/tokenreg.json deleted file mode 100644 index bcba3412738..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/tokenreg.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/TokenReg.sol", - "output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055670de0b6b3a7640000600455341561003357fe5b5b611473806100436000396000f300606060405236156100b45763ffffffff60e060020a600035041663044215c681146100b657806313af4035146101df57806366b42dcb146101fd57806369fe0e2d146102ab5780637958533a146102c05780637b1a547c146102e8578063891de9ed146103a15780638da5cb5b146104bc5780639890220b146104e85780639f181b5e146104fa578063a02b161e1461051c578063b72e717d14610531578063dd93890b1461066a578063ddca3f4314610685575bfe5b34156100be57fe5b6100c96004356106a7565b60408051600160a060020a038088168252918101859052908216608082015260a060208083018281528751928401929092528651606084019160c0850191908901908083838215610135575b80518252602083111561013557601f199092019160209182019101610115565b505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838382156101a0575b8051825260208311156101a057601f199092019160209182019101610180565b505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156101e757fe5b6101fb600160a060020a036004351661083a565b005b60408051602060046024803582810135601f8101859004850286018501909652858552610297958335600160a060020a0316959394604494939290920191819084018382808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a8a359a9099940197509195509182019350915081908401838280828437509496506108ae95505050505050565b604080519115158252519081900360200190f35b34156102b357fe5b6101fb6004356108c8565b005b34156102c857fe5b6102d66004356024356108ed565b60408051918252519081900360200190f35b60408051602060046024803582810135601f8101859004850286018501909652858552610297958335600160a060020a0316959394604494939290920191819084018382808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a8a359a90999401975091955091820193509150819084018382808284375094965050509235600160a060020a0316925061092c915050565b604080519115158252519081900360200190f35b34156103a957fe5b6103f7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843750949650610c6695505050505050565b6040518086815260200185600160a060020a0316600160a060020a031681526020018481526020018060200183600160a060020a0316600160a060020a0316815260200182810382528481815181526020019150805190602001908083836000831461047e575b80518252602083111561047e57601f19909201916020918201910161045e565b505050905090810190601f1680156104aa5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34156104c457fe5b6104cc610dca565b60408051600160a060020a039092168252519081900360200190f35b34156104f057fe5b6101fb610dd9565b005b341561050257fe5b6102d6610e2c565b60408051918252519081900360200190f35b341561052457fe5b6101fb600435610e33565b005b341561053957fe5b61054d600160a060020a0360043516611047565b60405180868152602001806020018581526020018060200184600160a060020a0316600160a060020a03168152602001838103835287818151815260200191508051906020019080838360008314610135575b80518252602083111561013557601f199092019160209182019101610115565b505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838382156101a0575b8051825260208311156101a057601f199092019160209182019101610180565b505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b341561067257fe5b6101fb6004356024356044356111f3565b005b341561068d57fe5b6102d66112b0565b60408051918252519081900360200190f35b60006106b16112b6565b60006106bb6112b6565b600060006003878154811015156106ce57fe5b906000526020600020906006020160005b50805460018083018054604080516020601f600260001997861615610100029790970190941695909504928301859004850281018501909152818152600160a060020a039094169a5093945091929083018282801561077f5780601f106107545761010080835404028352916020019161077f565b820191906000526020600020905b81548152906001019060200180831161076257829003601f168201915b505050600280850154600386018054604080516020601f6000196101006001871615020190941696909604928301869004860281018601909152818152969b50919950935091508301828280156108175780601f106107ec57610100808354040283529160200191610817565b820191906000526020600020905b8154815290600101906020018083116107fa57829003601f168201915b50505050600483015491945050600160a060020a031691505b5091939590929450565b60005433600160a060020a03908116911614610855576108aa565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a360008054600160a060020a031916600160a060020a0383161790555b5b50565b60006108bd858585853361092c565b90505b949350505050565b60005433600160a060020a039081169116146108e3576108aa565b60048190555b5b50565b60006003838154811015156108fe57fe5b906000526020600020906006020160005b506000838152600591909101602052604090205490505b92915050565b600060045434101561093d57610c5d565b600160a060020a03861660009081526001602052604090205486901561096257610c5b565b8551869060031461097257610c59565b866002816040518082805190602001908083835b602083106109a55780518252601f199092019160209182019101610986565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220541591506109df905057610c56565b60038054600181016109f183826112c8565b916000526020600020906006020160005b506040805160a081018252600160a060020a03808e1680835260208084018f90529383018d9052606083018c9052908a1660808301528354600160a060020a0319161783558b51909291610a5d9160018401918e01906112fa565b506040820151600282015560608201518051610a839160038401916020909101906112fa565b506080919091015160049091018054600160a060020a031916600160a060020a03928316179055600354908b1660009081526001602090815260409182902083905590518b519293506002928c928291908401908083835b60208310610afa5780518252601f199092019160209182019101610adb565b51815160001960209485036101000a81019182169119929092161790915293909101958652604051958690038101862096909655506003548d519101948d9493508392508401908083835b60208310610b645780518252601f199092019160209182019101610b45565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207f25074d730da65a10e171fe5589d2182313ef00da38d23a9ae3b78923568bdf2d8b896040518083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360008314610c17575b805182526020831115610c1757601f199092019160209182019101610bf7565b505050905090810190601f168015610c435780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3600193505b5b505b505b505b95945050505050565b600060006000610c746112b6565b6000600060016002886040518082805190602001908083835b60208310610cac5780518252601f199092019160209182019101610c8d565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902054039550600386815481101515610cf257fe5b906000526020600020906006020160005b5080546002808301546003840180546040805160206101006001851615026000190190931695909504601f8101839004830286018301909152808552600160a060020a039095169a50919850939450909291908301828280156108175780601f106107ec57610100808354040283529160200191610817565b820191906000526020600020905b8154815290600101906020018083116107fa57829003601f168201915b50505050600483015491945050600160a060020a031691505b5091939590929450565b600054600160a060020a031681565b60005433600160a060020a03908116911614610df457610e28565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f193505050501515610e2857610000565b5b5b565b6003545b90565b60005433600160a060020a03908116911614610e4e576108aa565b80600382815481101515610e5e57fe5b906000526020600020906006020160005b506001016040518082805460018160011615610100020316600290048015610ece5780601f10610eac576101008083540402835291820191610ece565b820191906000526020600020905b815481529060010190602001808311610eba575b505060405190819003812092507f96e76fa77fea85d8abeb7533fdb8288c214bb1dcf1f867c8f36a95f1f509c1759150600090a360016000600383815481101515610f1557fe5b906000526020600020906006020160005b5054600160a060020a031681526020810191909152604001600090812055600380546002919083908110610f5657fe5b906000526020600020906006020160005b506001016040518082805460018160011615610100020316600290048015610fc65780601f10610fa4576101008083540402835291820191610fc6565b820191906000526020600020905b815481529060010190602001808311610fb2575b50509283525050604051908190036020019020600090556003805482908110610feb57fe5b906000526020600020906006020160005b8154600160a060020a0319168255611018600183016000611379565b60028201600090556003820160006110309190611379565b506004018054600160a060020a03191690555b5b50565b60006110516112b6565b600061105b6112b6565b600160a060020a03851660009081526001602052604081205460038054600019909201965082918790811061108c57fe5b906000526020600020906006020160005b509050806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561077f5780601f106107545761010080835404028352916020019161077f565b820191906000526020600020905b81548152906001019060200180831161076257829003601f168201915b505050600280850154600386018054604080516020601f6000196101006001871615020190941696909604928301869004860281018601909152818152969b50919950935091508301828280156108175780601f106107ec57610100808354040283529160200191610817565b820191906000526020600020905b8154815290600101906020018083116107fa57829003601f168201915b50505050600483015491945050600160a060020a031691505b5091939590929450565b8233600160a060020a031660038281548110151561120d57fe5b906000526020600020906006020160005b5060040154600160a060020a031614611236576112a9565b8160038581548110151561124657fe5b906000526020600020906006020160005b50600085815260059190910160209081526040918290209290925580518481529051859287927f7991c63a749706fd298fc2387764d640be6e714307b6357b1d3c2ce35cba3b52929081900390910190a35b5b50505050565b60045481565b60408051602081019091526000815290565b8154818355818115116112f4576006028160060283600052602060002091820191016112f491906113c1565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061133b57805160ff1916838001178555611368565b82800160010185558215611368579182015b8281111561136857825182559160200191906001019061134d565b5b50611375929150611426565b5090565b50805460018160011615610100020316600290046000825580601f1061139f57506108aa565b601f0160209004906000526020600020908101906108aa9190611426565b5b50565b610e3091905b80821115611375578054600160a060020a031916815560006113ec6001830182611379565b60028201600090556003820160006114049190611379565b50600481018054600160a060020a03191690556006016113c7565b5090565b90565b610e3091905b80821115611375576000815560010161142c565b5090565b905600a165627a7a72305820ab1d1a18270ba278cc2f74cd1b7b547cdcd6308a9df1dec1120fa9f6199b1f480029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/verifyEmail.json b/js-old/src/dapps/chaindeploy/contracts/code/verifyEmail.json deleted file mode 100644 index a87fb0a2284..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/verifyEmail.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/e5afdacc716ca743ceddf80978d4e6b2b465dbe9/ProofOfEmail.sol", - "output": "0x606060405260008054600160a060020a03191633600160a060020a0316178155600355341561002a57fe5b5b6108a48061003a6000396000f300606060405236156100ca5763ffffffff60e060020a60003504166306b2ff4781146100cc57806313af4035146100fc5780632650b9881461011a5780634b59e8801461018c57806359c87d70146101b05780636795dbcd146101bd57806369fe0e2d1461023057806370c4d5f214610245578063797af627146103255780638da5cb5b1461034c5780639890220b14610378578063ac72c1201461038a578063cc1d4c02146103b1578063ddca3f43146103e1578063df57b74214610403578063e30bd74014610432575bfe5b34156100d457fe5b6100e8600160a060020a03600435166104ce565b604080519115158252519081900360200190f35b341561010457fe5b610118600160a060020a03600435166104d6565b005b341561012257fe5b60408051602060046024803582810135601f810185900485028601850190965285855261017a958335600160a060020a0316959394604494939290920191819084018382808284375094965061055795505050505050565b60408051918252519081900360200190f35b341561019457fe5b610118600160a060020a0360043516602435604435610577565b005b6101186004356105eb565b005b34156101c557fe5b60408051602060046024803582810135601f8101859004850286018501909652858552610214958335959394604494939290920191819084018382808284375094965061063595505050505050565b60408051600160a060020a039092168252519081900360200190f35b341561023857fe5b610118600435610654565b005b341561024d57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526102a5958335600160a060020a0316959394604494939290920191819084018382808284375094965061067995505050505050565b6040805160208082528351818301528351919283929083019185019080838382156102eb575b8051825260208311156102eb57601f1990920191602091820191016102cb565b505050905090810190601f1680156103175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561032d57fe5b6100e8600435610688565b604080519115158252519081900360200190f35b341561035457fe5b610214610791565b60408051600160a060020a039092168252519081900360200190f35b341561038057fe5b6101186107a0565b005b341561039257fe5b6100e86004356107f3565b604080519115158252519081900360200190f35b34156103b957fe5b6100e8600160a060020a0360043516610813565b604080519115158252519081900360200190f35b34156103e957fe5b61017a610834565b60408051918252519081900360200190f35b341561040b57fe5b61021460043561083a565b60408051600160a060020a039092168252519081900360200190f35b341561043a57fe5b6102a5600160a060020a0360043516610858565b6040805160208082528351818301528351919283929083019185019080838382156102eb575b8051825260208311156102eb57601f1990920191602091820191016102cb565b505050905090810190601f1680156103175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60005b919050565b60005433600160a060020a039081169116146104f157610553565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0382166000908152600260205260409020545b92915050565b60005433600160a060020a03908116911614610592576105e5565b600082815260046020908152604091829020839055815184815291518392600160a060020a038716927f76babef7e9f1065118be3f9d7094016a1cc06dd12811501c7712deb22144f37b92918290030190a35b5b505050565b6003543410156105fa57610553565b6040518190600160a060020a033316907f070669e6be82aa9b077a096b0f9617893a4dc5cb05897e27fd7a6112c8e6629e90600090a35b5b50565b600082815260016020526040902054600160a060020a03165b92915050565b60005433600160a060020a0390811691161461066f57610553565b60038190555b5b50565b610571610866565b5b92915050565b6040805182815281516020918190038201902060009081526004909152908120548015156106b55761078b565b6040805184815281516020918190038201902060009081526004825282812081905583815260019091522054600160a060020a031615158061070e5750600160a060020a03331660009081526002602052604090205415155b156107185761078b565b6000818152600160209081526040808320805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a031690811790915580845260029092528083208490555190917fd415b905d4dd806bfba99a7a0e6351bd0c9db3a9912add21c0e6bef4479f673f91a2600191505b50919050565b600054600160a060020a031681565b60005433600160a060020a039081169116146107bb576107ef565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156107ef57610000565b5b5b565b600081815260016020526040902054600160a060020a031615155b919050565b600160a060020a03811660009081526002602052604090205415155b919050565b60035481565b600081815260016020526040902054600160a060020a03165b919050565b6104d1610866565b5b919050565b604080516020810190915260008152905600a165627a7a7230582081d03388dd06c78ee4098c4f1e23cd3c25e38d249d5da59962c6b28ec6e20ea70029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/code/verifySms.json b/js-old/src/dapps/chaindeploy/contracts/code/verifySms.json deleted file mode 100644 index 0cfc43f9d6a..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/code/verifySms.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compiler": "v0.4.9+commit.364da425", - "source": "https://github.com/paritytech/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/SMSVerification.sol", - "output": "0x606060405260008054600160a060020a033316600160a060020a03199182168117909255600280549091169091179055666a94d74f430000600455341561004257fe5b5b6109a0806100526000396000f300606060405236156100ca5763ffffffff60e060020a60003504166313af403581146100cc57806314253887146100ea578063338cdca1146101085780633da5c3ce146101125780635283f3391461013357806369fe0e2d146101af57806374a8f103146101c4578063797af627146101e25780638da5cb5b146102095780639890220b14610235578063c89e436114610247578063ca4cbf6714610273578063ca5eb5e1146102e5578063cc1d4c0214610303578063ddca3f4314610333578063fc2525ab14610273575bfe5b34156100d457fe5b6100e8600160a060020a03600435166103c7565b005b34156100f257fe5b6100e8600160a060020a0360043516610448565b005b6100e86104b4565b005b341561011a57fe5b6100e8600160a060020a0360043516602435610521565b005b341561013b57fe5b60408051602060046024803582810135601f8101859004850286018501909652858552610193958335600160a060020a0316959394604494939290920191819084018382808284375094965061059295505050505050565b60408051600160a060020a039092168252519081900360200190f35b34156101b757fe5b6100e8600435610623565b005b34156101cc57fe5b6100e8600160a060020a0360043516610648565b005b34156101ea57fe5b6101f56004356106d9565b604080519115158252519081900360200190f35b341561021157fe5b610193610771565b60408051600160a060020a039092168252519081900360200190f35b341561023d57fe5b6100e8610780565b005b341561024f57fe5b6101936107d3565b60408051600160a060020a039092168252519081900360200190f35b341561027b57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526102d3958335600160a060020a0316959394604494939290920191819084018382808284375094965061059295505050505050565b60408051918252519081900360200190f35b34156102ed57fe5b6100e8600160a060020a0360043516610873565b005b341561030b57fe5b6101f5600160a060020a03600435166108bb565b604080519115158252519081900360200190f35b341561033b57fe5b6102d36108dd565b60408051918252519081900360200190f35b341561027b57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526102d3958335600160a060020a0316959394604494939290920191819084018382808284375094965061059295505050505050565b60408051918252519081900360200190f35b60005433600160a060020a039081169116146103e257610444565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60025433600160a060020a0390811691161461046357610444565b600160a060020a0381166000818152600160208190526040808320805460ff1916909217909155517fd415b905d4dd806bfba99a7a0e6351bd0c9db3a9912add21c0e6bef4479f673f9190a25b5b50565b6004543410156104c35761051e565b600160a060020a03331660009081526001602052604090205460ff16156104e95761051e565b604051600160a060020a033316907f039f711c9c18dd815b225b1424855e6118e746c6b5d688907f10c4dd29ebe92a90600090a25b5b565b60025433600160a060020a0390811691161461053c5761058d565b600160a060020a038216600081815260036020908152604091829020849055815184815291517fa9a343b39eac85ffb326e93ecd46785b814e72dc9f2b33bb0b4a315ba2859f439281900390910190a25b5b5050565b60006001600084600160a060020a0316600160a060020a03168152602001908152602001600020600101826040518082805190602001908083835b602083106105ec5780518252601f1990920191602091820191016105cd565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b60005433600160a060020a0390811691161461063e57610444565b60048190555b5b50565b60025433600160a060020a0390811691161461066357610444565b600160a060020a038116600090815260016020526040902054819060ff16151561068c5761058d565b600160a060020a038216600081815260016020526040808220805460ff19169055517fb6fa8b8bd5eab60f292eca876e3ef90722275b785309d84b1de113ce0b8c4e749190a25b5b505b50565b6040805182815281516020918190038201902033600160a060020a031660009081526003909252918120549091146107105761076c565b600160a060020a0333166000818152600360209081526040808320839055600191829052808320805460ff1916909217909155517fd415b905d4dd806bfba99a7a0e6351bd0c9db3a9912add21c0e6bef4479f673f9190a25060015b919050565b600054600160a060020a031681565b60005433600160a060020a0390811691161461079b5761051e565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f19350505050151561051e57610000565b5b5b565b600254600160a060020a031681565b60006001600084600160a060020a0316600160a060020a03168152602001908152602001600020600101826040518082805190602001908083835b602083106105ec5780518252601f1990920191602091820191016105cd565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b92915050565b60005433600160a060020a0390811691161461088e57610444565b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a03811660009081526001602052604090205460ff165b919050565b60045481565b60006001600084600160a060020a0316600160a060020a03168152602001908152602001600020600101826040518082805190602001908083835b602083106105ec5780518252601f1990920191602091820191016105cd565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054925050505b929150505600a165627a7a72305820f6beb9c0ae3b45609ad6fc26c1b74600cbaa5f0088ca07be3e9c392a12b2c6150029" -} diff --git a/js-old/src/dapps/chaindeploy/contracts/dappreg.js b/js-old/src/dapps/chaindeploy/contracts/dappreg.js deleted file mode 100644 index 71379bf8bf8..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/dappreg.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from '~/contracts/abi/dappreg'; -import { compiler, source as sourceUrl, output as byteCode } from './code/dappreg'; - -const id = 'dappreg'; // 7bbc4f1a27628781b96213e781a1b8eec6982c1db8fac739af6e4c5a55862c03 -const deployParams = []; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/gavcoin.js b/js-old/src/dapps/chaindeploy/contracts/gavcoin.js deleted file mode 100644 index f7518ef53f0..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/gavcoin.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from '~/contracts/abi/gavcoin'; -import { compiler, source as sourceUrl, output as byteCode } from './code/gavcoin'; - -const isExternal = true; -const id = 'gavcoin'; -const deployParams = []; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - isExternal, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/githubhint.js b/js-old/src/dapps/chaindeploy/contracts/githubhint.js deleted file mode 100644 index 5198e38b5db..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/githubhint.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from '~/contracts/abi/githubhint'; -import { compiler, source as sourceUrl, output as byteCode } from './code/githubhint'; - -const id = 'githubhint'; -const deployParams = []; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/index.js b/js-old/src/dapps/chaindeploy/contracts/index.js deleted file mode 100644 index 5e066f758c4..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/index.js +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import * as badgereg from './badgereg'; -import * as dappreg from './dappreg'; -import * as gavcoin from './gavcoin'; -import * as githubhint from './githubhint'; -import * as jgvoting from './jg-voting'; -import * as registry from './registry'; -import * as signaturereg from './signaturereg'; -import * as tokendeployMgr from './tokendeployMgr'; -import * as tokendeployReg from './tokendeployReg'; -import * as tokenreg from './tokenreg'; -import * as verifyEmail from './verifyEmail'; -import * as verifySms from './verifySms'; -import * as wallet from './wallet'; - -const contracts = [ - // builtin - githubhint, - badgereg, - dappreg, - signaturereg, - tokenreg, - tokendeployReg, - tokendeployMgr, - verifyEmail, - verifySms, - wallet, - - // external - gavcoin, - jgvoting -]; - -export { - contracts, - registry -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/jg-voting.js b/js-old/src/dapps/chaindeploy/contracts/jg-voting.js deleted file mode 100644 index 8ffbed3c565..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/jg-voting.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from './abi/jg-voting'; -import { compiler, source as sourceUrl, output as byteCode } from './code/jg-voting'; - -const isExternal = true; -const id = 'jg-voting'; -const deployParams = []; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - isExternal, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/registry.js b/js-old/src/dapps/chaindeploy/contracts/registry.js deleted file mode 100644 index 1b44f4245ac..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/registry.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from '~/contracts/abi/registry2'; -import { compiler, source as sourceUrl, output as byteCode } from './code/registry'; - -const id = 'registry'; -const deployParams = []; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/signaturereg.js b/js-old/src/dapps/chaindeploy/contracts/signaturereg.js deleted file mode 100644 index 6d9f9bf609c..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/signaturereg.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from '~/contracts/abi/signaturereg'; -import { compiler, source as sourceUrl, output as byteCode } from './code/signaturereg'; - -const id = 'signaturereg'; -const deployParams = []; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/tokendeployMgr.js b/js-old/src/dapps/chaindeploy/contracts/tokendeployMgr.js deleted file mode 100644 index d07435fdddb..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/tokendeployMgr.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from '~/contracts/abi/basiccoinmanager'; -import { compiler, source as sourceUrl, output as byteCode } from './code/tokendeploy'; - -const id = 'basiccoinmgr'; -const deployParams = []; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/tokendeployReg.js b/js-old/src/dapps/chaindeploy/contracts/tokendeployReg.js deleted file mode 100644 index 1db07e91a50..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/tokendeployReg.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { abi, sourceUrl, deployParams, compiler, byteCode } from './tokenreg'; - -const id = 'basiccoinreg'; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/tokenreg.js b/js-old/src/dapps/chaindeploy/contracts/tokenreg.js deleted file mode 100644 index 11ee29fa1f8..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/tokenreg.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from '~/contracts/abi/tokenreg'; -import { compiler, source as sourceUrl, output as byteCode } from './code/tokenreg'; - -const id = 'tokenreg'; -const deployParams = []; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/verifyEmail.js b/js-old/src/dapps/chaindeploy/contracts/verifyEmail.js deleted file mode 100644 index 0176d594954..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/verifyEmail.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from '~/contracts/abi/email-verification'; -import { compiler, source as sourceUrl, output as byteCode } from './code/verifyEmail'; - -const isBadge = true; -const id = 'emailverification'; -const deployParams = []; -const badgeSource = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/c4721a87cb95375da91f8699438d8d7907b3f5e9/certifications/email-verification.svg', - imageHash: '0x5617a14da2a0c210939da6eafb734e60906f64a504c3e107812668860a752dc6' -}; - -export { - abi, - badgeSource, - byteCode, - compiler, - deployParams, - id, - isBadge, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/verifySms.js b/js-old/src/dapps/chaindeploy/contracts/verifySms.js deleted file mode 100644 index d7ea509022f..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/verifySms.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import abi from '~/contracts/abi/sms-verification'; -import { compiler, source as sourceUrl, output as byteCode } from './code/verifySms'; - -const isBadge = true; -const id = 'smsverification'; -const deployParams = []; -const badgeSource = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/1b1beb57ab1f4d3a93a12711b233b5cded791a2f/certifications/sms-verification.svg', - imageHash: '0x49fa653c35c0a9ce128579883babd673ad4cfc94bf9f1cfe96a2bbc30a7552c6' -}; - -export { - abi, - badgeSource, - byteCode, - compiler, - deployParams, - id, - isBadge, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/contracts/wallet.js b/js-old/src/dapps/chaindeploy/contracts/wallet.js deleted file mode 100644 index 6639cba8017..00000000000 --- a/js-old/src/dapps/chaindeploy/contracts/wallet.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { walletCompiler as compiler, walletLibrary as byteCode, walletLibraryABI as abiJson, walletLibraryRegKey as id, walletSource as sourceUrl } from '~/contracts/code/wallet'; - -const abi = JSON.parse(abiJson); -const deployParams = []; - -export { - abi, - byteCode, - compiler, - deployParams, - id, - sourceUrl -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/console.js b/js-old/src/dapps/chaindeploy/dapps/console.js deleted file mode 100644 index 4e599b2faa3..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/console.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtins from '~/views/Dapps/builtin.json'; - -const id = 'console'; -const app = builtins.find((app) => app.url === id); -const hashId = app.id; -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/console/3ea0dbfefded359ccdbea37bc4cf350c0aa16948/console.jpeg', - imageHash: '0xc3962e2eab7afaeb9cd11522381723afbafdc41dc7ba31bee472e187c4459e81' -}; -const name = app.name; - -export { - hashId, - id, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/dappreg.js b/js-old/src/dapps/chaindeploy/dapps/dappreg.js deleted file mode 100644 index fec35ef7631..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/dappreg.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtins from '~/views/Dapps/builtin.json'; - -const id = 'dappreg'; -const app = builtins.find((app) => app.url === id); -const hashId = app.id; -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/legos-64x64.png', - imageHash: '0xa8feea35c761cc6c2fe862fe336419f11ca5421f578757720a899b89fc1df154' -}; -const name = app.name; - -export { - hashId, - id, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/gavcoin.js b/js-old/src/dapps/chaindeploy/dapps/gavcoin.js deleted file mode 100644 index 148c6fb8ed0..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/gavcoin.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { api } from '../parity'; - -const isExternal = true; -const id = 'gavcoin'; -const hashId = api.util.sha3(id); -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/9e135f76fe9ba61e2d8ccbd72ed144c26c450780/tokens/gavcoin-64x64.png', - imageHash: '0xd40679a3a234d8421c678d64f4df3308859e8ad07ac95ce4a228aceb96955287', - manifestUrl: 'https://raw.githubusercontent.com/gavofyork/gavcoin/eb2f8dc4d3ad4dd5f4562690525b7cfedc9681ba/manifest.json', - manifestHash: '0xd582c572fbef8015837f2c1a8798f2c3149a1d9d655b4020edb1bbece725371d', - contentUrl: { - repo: 'gavofyork/gavcoin', - commit: '0xeb2f8dc4d3ad4dd5f4562690525b7cfedc9681ba' - }, - contentHash: '0x0b6c7b3fc8dad3edb39fd1465904ce9a11938ef18f08f8115f275047ba249530' -}; -const name = 'GavCoin'; - -export { - hashId, - id, - isExternal, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/githubhint.js b/js-old/src/dapps/chaindeploy/dapps/githubhint.js deleted file mode 100644 index 49fb4be9cd1..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/githubhint.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtins from '~/views/Dapps/builtin.json'; - -const id = 'githubhint'; -const app = builtins.find((app) => app.url === id); -const hashId = app.id; -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/link-64x64.jpg', - imageHash: '0x6568901e711886e2c61eef1bbc7e2d8d37a27b9eb3e9e270eda8548f2ec796e8' -}; -const name = app.name; - -export { - hashId, - id, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/index.js b/js-old/src/dapps/chaindeploy/dapps/index.js deleted file mode 100644 index e95bf564808..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/index.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import * as consolejs from './console'; -import * as dappreg from './dappreg'; -import * as gavcoin from './gavcoin'; -import * as githubhint from './githubhint'; -import * as jgvoting from './jg-voting'; -import * as jgwhenblock from './jg-whenblock'; -import * as localtx from './localtx'; -import * as registry from './registry'; -import * as signaturereg from './signaturereg'; -import * as tokendeploy from './tokendeploy'; -import * as tokenreg from './tokenreg'; -import * as web from './web'; - -const apps = [ - // builtin - consolejs, - dappreg, - githubhint, - localtx, - registry, - signaturereg, - tokendeploy, - tokenreg, - web, - - // external - gavcoin, - jgvoting, - jgwhenblock -]; - -export { - apps -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/jg-voting.js b/js-old/src/dapps/chaindeploy/dapps/jg-voting.js deleted file mode 100644 index 899e95894d2..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/jg-voting.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { api } from '../parity'; - -const isExternal = true; -const id = 'jg-voting'; -const hashId = api.util.sha3(id); -const source = { - imageUrl: 'https://raw.githubusercontent.com/jacogr/dapp-voting/038ff4074544f2babc7aed9c4ac3dc070b85b804/assets/images/vote.jpg', - imageHash: '0x3620828e1a745d2714e9f37dc2d47cdab5ef9982190a845b5e7665b7a7767661', - manifestUrl: 'https://raw.githubusercontent.com/jacogr/dapp-voting/682f0fe4b86508a1a2487de6c7c61f7b100ba5b2/manifest.json', - manifestHash: '0x9b83e01f87d225e7bfdd305c51319504ff9b4cf8d517ca4b64f606762e72f59e', - contentUrl: { - repo: 'jacogr/dapp-voting', - commit: '0x7d941597e862a600a60b9d6ecd3a6f606d96cd7b' - }, - contentHash: '0x9fcc0910f6a8c4e45715d41aea2d287da31bf1d7321003fc66df6a012ce2d753' -}; -const name = 'Yes, No, Maybe'; - -export { - hashId, - id, - isExternal, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/jg-whenblock.js b/js-old/src/dapps/chaindeploy/dapps/jg-whenblock.js deleted file mode 100644 index 0005ca454a8..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/jg-whenblock.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -const isExternal = true; -const id = 'whenarewethere'; -const hashId = '0xfef3bfded03695e38a9ff476a0999e1fa421e72d1fb3b55a87d6c2bdb6fc18ef'; -const source = { - imageUrl: 'https://raw.githubusercontent.com/jacogr/dapp-when-are-we-there/167aa4d904c5aa6246d0d6d6f41c4ed8a56889cd/assets/images/clock.jpg', - imageHash: '0x2534b44f685b6399bf63f86679128216c43e9a58be1dfb58533923f0bcffeba7', - manifestUrl: 'https://raw.githubusercontent.com/jacogr/dapp-when-are-we-there/bf72dc3033711a3ab41bec3c1249638f70bae768/manifest.json', - manifestHash: '0xfe26f6a19ea9393d69bc5d8c73c5072ccf126f51c10c135b42d6bf162d774fd9', - contentUrl: { - repo: 'jacogr/dapp-when-are-we-there', - commit: '0xbf72dc3033711a3ab41bec3c1249638f70bae768' - }, - contentHash: '0x3505cbbef5c2243eedba07d340d4abccfaa3cfb799f51827e33c9721a5254d13' -}; -const name = 'When are we there'; - -export { - hashId, - id, - isExternal, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/localtx.js b/js-old/src/dapps/chaindeploy/dapps/localtx.js deleted file mode 100644 index 6fc275a134a..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/localtx.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtins from '~/views/Dapps/builtin.json'; - -const id = 'localtx'; -const app = builtins.find((app) => app.url === id); -const hashId = app.id; -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/stack-64x64.png', - imageHash: '0x22b924801e1971659a51956dcdfc5a2d592d8bdd03780dd72d5bc4c84b595b4c' -}; -const name = app.name; - -export { - hashId, - id, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/registry.js b/js-old/src/dapps/chaindeploy/dapps/registry.js deleted file mode 100644 index 49ff4757bb7..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/registry.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtins from '~/views/Dapps/builtin.json'; - -const id = 'registry'; -const app = builtins.find((app) => app.url === id); -const hashId = app.id; -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/register-64x64.jpg', - imageHash: '0xf7100024052cd78b5e043287c05392b5db0bfce5caedd6d39555d40283ef0a1c' -}; -const name = app.name; - -export { - hashId, - id, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/signaturereg.js b/js-old/src/dapps/chaindeploy/dapps/signaturereg.js deleted file mode 100644 index 12efcff3622..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/signaturereg.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtins from '~/views/Dapps/builtin.json'; - -const id = 'signaturereg'; -const app = builtins.find((app) => app.url === id); -const hashId = app.id; -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/hex-64x64.jpg', - imageHash: '0x26f7f2415cd5cbbffa58e8119fdbdd7181cac79119dd7f6ba6ee99d7f4445640' -}; -const name = app.name; - -export { - hashId, - id, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/tokendeploy.js b/js-old/src/dapps/chaindeploy/dapps/tokendeploy.js deleted file mode 100644 index 43ea8f22b0e..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/tokendeploy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtins from '~/views/Dapps/builtin.json'; - -const id = 'tokendeploy'; -const app = builtins.find((app) => app.url === id); -const hashId = app.id; -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/interlock-64x64.png', - imageHash: '0xde104baf02aec783e0bffc624514ee267dbcb455382375e3ffa715790c1c939f' -}; -const name = app.name; - -export { - hashId, - id, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/tokenreg.js b/js-old/src/dapps/chaindeploy/dapps/tokenreg.js deleted file mode 100644 index 784febba05b..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/tokenreg.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtins from '~/views/Dapps/builtin.json'; - -const id = 'tokenreg'; -const app = builtins.find((app) => app.url === id); -const hashId = app.id; -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/coins-64x64.jpg', - imageHash: '0xe23d429d15de98c7878d92bc90b79c7afabe1b04c2ad5e3e2c89adc8f439edc9' -}; -const name = app.name; - -export { - hashId, - id, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/dapps/web.js b/js-old/src/dapps/chaindeploy/dapps/web.js deleted file mode 100644 index 0726e2bf71e..00000000000 --- a/js-old/src/dapps/chaindeploy/dapps/web.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import builtins from '~/views/Dapps/builtin.json'; - -const id = 'web'; -const app = builtins.find((app) => app.url === id); -const hashId = app.id; -const source = { - imageUrl: 'https://raw.githubusercontent.com/paritytech/dapp-assets/ec6138115d0e1f45258969cd90b3b274e0ff2258/dapps/earth-64x64.jpg', - imageHash: '0x0b9b62a9262f75461191d4e8bf686c56528cbc0fe885c1f5878052ca8b2f65bf' -}; -const name = app.name; - -export { - hashId, - id, - name, - source -}; diff --git a/js-old/src/dapps/chaindeploy/parity.js b/js-old/src/dapps/chaindeploy/parity.js deleted file mode 100644 index 1dea0d696b4..00000000000 --- a/js-old/src/dapps/chaindeploy/parity.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -const api = window.parity.api; - -export { - api -}; diff --git a/js-old/src/dapps/chaindeploy/store.js b/js-old/src/dapps/chaindeploy/store.js deleted file mode 100644 index 07b69313545..00000000000 --- a/js-old/src/dapps/chaindeploy/store.js +++ /dev/null @@ -1,714 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { action, computed, observable } from 'mobx'; - -import { contracts as contractsInfo, registry as registryInfo } from './contracts'; -import { apps } from './dapps'; -import { api } from './parity'; -import { executeContract, isValidNumber, validateCode } from './utils'; - -export default class ContractsStore { - @observable apps = null; - @observable badges = null; - @observable contracts = null; - @observable error = null; - @observable registry = null; - - constructor () { - this.apps = apps; - this.badges = contractsInfo.filter((contract) => contract.isBadge); - this.contracts = contractsInfo.filter((contract) => !contract.isBadge); - this.registry = registryInfo; - - api.subscribe('eth_blockNumber', this.onNewBlockNumber); - } - - @computed get contractBadgereg () { - return this.contracts.find((contract) => contract.id === 'badgereg'); - } - - @computed get contractDappreg () { - return this.contracts.find((contract) => contract.id === 'dappreg'); - } - - @computed get contractGithubhint () { - return this.contracts.find((contract) => contract.id === 'githubhint'); - } - - @computed get contractTokenreg () { - return this.contracts.find((contract) => contract.id === 'tokenreg'); - } - - @computed get isBadgeDeploying () { - return this.badges - .filter((contract) => contract.isDeploying) - .length !== 0; - } - - @computed get isContractDeploying () { - return this.contracts - .filter((contract) => contract.isDeploying) - .length !== 0; - } - - @computed get isDappDeploying () { - return this.apps - .filter((app) => app.isDeploying) - .length !== 0; - } - - @computed get haveAllBadges () { - return this.badges - .filter((contract) => !contract.instance || !contract.hasLatestCode || !contract.badgeImageHash || !contract.badgeImageMatch || !contract.isBadgeRegistered) - .length === 0; - } - - @computed get haveAllContracts () { - return this.contracts - .filter((contract) => !contract.instance || !contract.hasLatestCode) - .length === 0; - } - - @computed get haveAllDapps () { - return this.apps - .filter((app) => { - return !app.isOnChain || - !app.imageHash || !app.imageMatch || - (app.source.contentHash && !app.contentMatch) || - (app.source.manifestHash && !app.manifestMatch); - }) - .length === 0; - } - - @action refreshApps = () => { - this.apps = [].concat(this.apps.peek()); - } - - @action refreshContracts = () => { - this.badges = [].concat(this.badges.peek()); - this.contracts = [].concat(this.contracts.peek()); - } - - @action setError = (error) => { - console.error(error); - - this.error = error.message - ? error.message - : error; - } - - @action setRegistryAddress = (address, isOnChain = false) => { - if (this.registry.address !== address || !this.registry.instance) { - console.log(`registry found at ${address}`); - - this.registry = Object.assign({}, this.registry, { - address, - instance: api.newContract(this.registry.abi, address).instance, - isOnChain - }); - } - } - - @action setRegistryCode (byteCode) { - this.registry.hasLatestCode = validateCode(this.registry.byteCode, byteCode); - } - - @action setRegistryDeploying = (isDeploying = false) => { - this.registry = Object.assign({}, this.registry, { - isDeploying, - status: isDeploying - ? 'Deploying contract' - : null - }); - } - - @action setBadgeId = (badge, badgeId) => { - badge.badgeId = badgeId; - badge.isBadgeRegistered = true; - - this.refreshContracts(); - } - - @action setBadgeImageHash = (badge, imageHash) => { - badge.badgeImageHash = imageHash; - badge.badgeImageMatch = badge.badgeSource.imageHash === imageHash; - - this.refreshContracts(); - } - - @action setContractAddress = (contract, address, isOnChain = false) => { - if (contract.address !== address || !contract.instance || contract.isOnChain !== isOnChain) { - console.log(`${contract.id} found at ${address}`); - - contract.address = address; - contract.instance = api.newContract(contract.abi, address).instance; - contract.isOnChain = isOnChain; - - this.refreshContracts(); - } - } - - @action setContractCode (contract, byteCode) { - contract.hasLatestCode = validateCode(contract.byteCode, byteCode); - - this.refreshContracts(); - } - - @action setContractDeploying = (contract, isDeploying = false) => { - contract.isDeploying = isDeploying; - contract.status = isDeploying - ? 'Deploying contract' - : null; - - this.refreshContracts(); - } - - @action setContractStatus = (contract, status) => { - contract.status = status; - - this.refreshContracts(); - } - - @action setAppDeploying = (app, isDeploying = false) => { - app.isDeploying = isDeploying; - app.status = isDeploying - ? 'Registering app' - : null; - - this.refreshApps(); - } - - @action setAppFound = (app, isOnChain = false) => { - if (app.isOnChain !== isOnChain) { - console.log(`${app.name} found on dappreg`); - - app.isOnChain = isOnChain; - - this.refreshApps(); - } - } - - @action setAppContentHash = (app, contentHash) => { - if (app.contentHash !== contentHash) { - console.log(`${app.name} has contentHash ${contentHash}`); - - app.contentHash = contentHash; - app.contentMatch = contentHash === app.source.contentHash; - - this.refreshApps(); - } - } - - @action setAppImageHash = (app, imageHash) => { - if (app.imageHash !== imageHash) { - console.log(`${app.name} has imageHash ${imageHash}`); - - app.imageHash = imageHash; - app.imageMatch = imageHash === app.source.imageHash; - - this.refreshApps(); - } - } - - @action setAppManifestHash = (app, manifestHash) => { - if (app.manifestHash !== manifestHash) { - console.log(`${app.name} has manifestHash ${manifestHash}`); - - app.manifestHash = manifestHash; - app.manifestMatch = manifestHash === app.source.manifestHash; - - this.refreshApps(); - } - } - - @action setAppStatus = (app, status) => { - console.log(app.id, status); - - app.status = status; - - this.refreshApps(); - } - - deployApp = (app) => { - console.log(`Registering application ${app.id}`); - - this.setAppDeploying(app, true); - - const options = {}; - const values = [app.hashId]; - - return api.parity - .defaultAccount() - .then((defaultAccount) => { - options.from = defaultAccount; - - if (app.isOnChain) { - return true; - } - - return this.contractDappreg.instance - .fee.call({}, []) - .then((fee) => { - options.value = fee; - - return executeContract(app.id, this.contractDappreg, 'register', options, values); - }); - }) - .then(() => { - if (app.imageHash && app.imageMatch) { - return true; - } - - this.setAppStatus(app, 'Registering image url'); - - return this - .registerHash(app.source.imageHash, app.source.imageUrl, options.from) - .then(() => this.setAppMeta(app, 'IMG', app.source.imageHash, options.from)); - }) - .then(() => { - if (!app.source.manifestHash || app.manifestMatch) { - return true; - } - - this.setAppStatus(app, 'Registering manifest url'); - - return this - .registerHash(app.source.manifestHash, app.source.manifestUrl, options.from) - .then(() => this.setAppMeta(app, 'MANIFEST', app.source.manifestHash, options.from)); - }) - .then(() => { - if (!app.source.contentHash || app.contentMatch) { - return true; - } - - this.setAppStatus(app, 'Registering content url'); - - return this - .registerRepo(app.source.contentHash, app.source.contentUrl, options.from) - .then(() => this.setAppMeta(app, 'CONTENT', app.source.contentHash, options.from)); - }) - .catch(() => { - return null; - }) - .then(() => { - this.setAppDeploying(app, false); - }); - } - - deployApps = () => { - this.apps - .filter((app) => { - return !app.isDeploying && - ( - !app.isOnChain || - (!app.imageHash || !app.imageMatch) || - (app.source.contentHash && !app.contentMatch) || - (app.source.manifestHash && !app.manifestMatch) - ); - }) - .forEach(this.deployApp); - } - - _deployContract = (contract) => { - console.log(`Deploying contract ${contract.id}`); - - const options = { - data: contract.byteCode - }; - - return api.parity - .defaultAccount() - .then((defaultAccount) => { - options.from = defaultAccount; - - return api - .newContract(contract.abi) - .deploy(options, contract.deployParams, (error, data) => { - if (error) { - console.error(contract.id, error); - } else { - console.log(contract.id, data); - } - }) - .then((contractAddress) => { - return [contractAddress, defaultAccount]; - }); - }); - } - - deployContract = (contract) => { - if (contract.hasLatestCode) { - return Promise.resolve(false); - } - - let defaultAccount = '0x0'; - - this.setContractDeploying(contract, true); - - return this - ._deployContract(contract) - .then(([address, _defaultAccount]) => { - const isOnChain = contract.isOnChain; - - defaultAccount = _defaultAccount; - - this.setContractAddress(contract, address); - - return isOnChain - ? true - : this.reserveAddress(contract, defaultAccount); - }) - .then(() => { - return this.registerAddress(contract, defaultAccount); - }) - .catch(() => { - return null; - }) - .then(() => { - this.setContractDeploying(contract, false); - }); - } - - deployBadge = (badge) => { - let defaultAccount; - - return this - .deployContract(badge) - .then(() => { - this.setContractDeploying(badge, true); - - return api.parity.defaultAccount(); - }) - .then((_defaultAccount) => { - defaultAccount = _defaultAccount; - - if (badge.isBadgeRegistered) { - return true; - } - - this.setContractStatus(badge, 'Registering with badgereg'); - - return this.registerBadge(badge, defaultAccount); - }) - .then(() => { - if (badge.badgeImageMatch) { - return true; - } - - this.setContractStatus(badge, 'Registering image url'); - - return this - .registerHash(badge.badgeSource.imageHash, badge.badgeSource.imageUrl, defaultAccount) - .then(() => this.registerBadgeImage(badge, badge.badgeSource.imageHash, defaultAccount)); - }) - .then(() => { - this.setContractDeploying(badge, false); - }); - } - - deployContracts = () => { - this.contracts - .filter((contract) => !contract.isDeploying && (!contract.instance || !contract.hasLatestCode)) - .forEach(this.deployContract); - } - - deployBadges = () => { - this.badges - .filter((contract) => !contract.isDeploying && (!contract.instance || !contract.hasLatestCode || !contract.badgeImageHash || !contract.badgeImageMatch || !contract.isBadgeRegistered)) - .forEach(this.deployBadge); - } - - deployRegistry = () => { - this.setRegistryDeploying(true); - - return this - ._deployContract(this.registry) - .then(([address]) => { - this.setRegistryDeploying(false); - this.setRegistryAddress(address); - }); - } - - registerBadge = (badge, fromAddress) => { - const options = { - from: fromAddress - }; - const values = [badge.address, api.util.sha3.text(badge.id.toLowerCase())]; - - return this.contractBadgereg.instance - .fee.call({}, []) - .then((fee) => { - options.value = fee; - - return executeContract(badge.id, this.contractBadgereg, 'register', options, values); - }); - } - - registerBadgeImage = (badge, hash, fromAddress) => { - const options = { - from: fromAddress - }; - const values = [badge.badgeId, 'IMG', hash]; - - this.setContractStatus(badge, 'Setting meta IMG'); - - return executeContract(badge.id, this.contractBadgereg, 'setMeta', options, values); - } - - setAppMeta = (app, key, meta, fromAddress) => { - const options = { - from: fromAddress - }; - const values = [app.hashId, key, meta]; - - this.setAppStatus(app, `Setting meta ${key}`); - - return executeContract(app.id, this.contractDappreg, 'setMeta', options, values); - } - - reserveAddress = (contract, fromAddress) => { - const options = { from: fromAddress }; - const values = [api.util.sha3.text(contract.id.toLowerCase())]; - - this.setContractStatus(contract, 'Reserving name'); - - return this.registry.instance - .fee.call({}, []) - .then((value) => { - options.value = value; - - return executeContract(contract.id, this.registry, 'reserve', options, values); - }); - } - - registerAddress = (contract, fromAddress) => { - const options = { from: fromAddress }; - const values = [api.util.sha3.text(contract.id.toLowerCase()), 'A', contract.address]; - - this.setContractStatus(contract, 'Setting lookup address'); - - return executeContract(contract.id, this.registry, 'setAddress', options, values); - } - - registerRepo = (hash, content, fromAddress) => { - const options = { - from: fromAddress - }; - const values = [hash, content.repo || content, content.commit || 0]; - - return this.contractGithubhint.instance - .entries.call({}, [hash]) - .then(([imageUrl, commit, owner]) => { - if (isValidNumber(owner)) { - return true; - } - - return executeContract(hash, this.contractGithubhint, 'hint', options, values); - }) - .catch(() => false); - } - - registerHash = (hash, url, fromAddress) => { - const options = { - from: fromAddress - }; - const values = [hash, url]; - - return this.contractGithubhint.instance - .entries.call({}, [hash]) - .then(([imageUrl, commit, owner]) => { - if (isValidNumber(owner)) { - return true; - } - - return executeContract(hash, this.contractGithubhint, 'hintURL', options, values); - }) - .catch(() => false); - } - - findRegistry = () => { - if (this.registry.address && this.registry.hasLatestCode) { - return Promise.resolve(this.registry); - } - - return api.parity - .registryAddress() - .then((address) => { - if (isValidNumber(address)) { - this.setRegistryAddress(address, true); - } - - return api.eth.getCode(address); - }) - .then((byteCode) => { - this.setRegistryCode(byteCode); - }); - } - - findApps = () => { - if (!this.contractDappreg.instance) { - return Promise.resolve(false); - } - - return Promise - .all( - this.apps.map((app) => { - return app.isOnChain - ? Promise.resolve([[0]]) - : this.contractDappreg.instance.get.call({}, [app.hashId]); - }) - ) - .then((apps) => { - apps.forEach(([_id, owner], index) => { - const id = api.util.bytesToHex(_id); - - if (isValidNumber(id)) { - this.setAppFound(this.apps[index], true); - } - }); - - return Promise.all( - this.apps.map((app) => { - return !app.isOnChain || (app.imageHash && app.imageMatch) - ? Promise.resolve([[0], [0], [0]]) - : Promise.all([ - this.contractDappreg.instance.meta.call({}, [app.hashId, 'CONTENT']), - this.contractDappreg.instance.meta.call({}, [app.hashId, 'IMG']), - this.contractDappreg.instance.meta.call({}, [app.hashId, 'MANIFEST']) - ]); - }) - ); - }) - .then((hashes) => { - hashes.forEach(([content, image, manifest], index) => { - const contentHash = api.util.bytesToHex(content); - const imageHash = api.util.bytesToHex(image); - const manifestHash = api.util.bytesToHex(manifest); - - if (isValidNumber(contentHash)) { - this.setAppContentHash(this.apps[index], contentHash); - } - - if (isValidNumber(imageHash)) { - this.setAppImageHash(this.apps[index], imageHash); - } - - if (isValidNumber(manifestHash)) { - this.setAppManifestHash(this.apps[index], manifestHash); - } - }); - }); - } - - findBadges = () => { - if (!this.contractBadgereg.instance) { - return Promise.resolve(false); - } - - return this - .findContracts(this.badges) - .then(() => { - return Promise.all( - this.badges.map((badge) => { - return badge.isBadgeRegistered - ? Promise.resolve([0, 0, 0]) - : this.contractBadgereg.instance.fromAddress.call({}, [badge.address]); - }) - ); - }) - .then((badgeInfos) => { - badgeInfos.forEach(([id, name, owner], index) => { - if (isValidNumber(owner)) { - this.setBadgeId(this.badges[index], id); - } - }); - - return Promise - .all( - this.badges.map((badge) => { - return !badge.isBadgeRegistered - ? Promise.resolve([0]) - : this.contractBadgereg.instance.meta.call({}, [badge.badgeId, 'IMG']); - }) - ); - }) - .then((images) => { - images.forEach((imageBytes, index) => { - const imageHash = api.util.bytesToHex(imageBytes); - - if (isValidNumber(imageHash)) { - this.setBadgeImageHash(this.badges[index], imageHash); - } - }); - }); - } - - findContracts = (contracts = this.contracts) => { - if (!this.registry.instance) { - return Promise.resolve(false); - } - - return Promise - .all( - contracts.map((contract) => { - const hashId = api.util.sha3.text(contract.id.toLowerCase()); - - return contract.isOnChain - ? Promise.resolve([0, 0]) - : Promise.all([ - this.registry.instance.getAddress.call({}, [hashId, 'A']), - this.registry.instance.getOwner.call({}, [hashId]) - ]); - }) - ) - .then((addresses) => { - addresses.forEach(([address, owner], index) => { - if (isValidNumber(owner) && isValidNumber(address)) { - this.setContractAddress(contracts[index], address, true); - } - }); - - return Promise.all( - contracts.map((contract) => { - return !contract.address || contract.hasLatestCode - ? Promise.resolve(null) - : api.eth.getCode(contract.address); - }) - ); - }) - .then((codes) => { - codes.forEach((byteCode, index) => { - if (byteCode) { - this.setContractCode(contracts[index], byteCode); - } - }); - }); - } - - onNewBlockNumber = (error, blockNumber) => { - if (error) { - return; - } - - return this - .findRegistry() - .then(this.findContracts) - .then(this.findApps) - .then(this.findBadges) - .catch(this.setError); - } -} diff --git a/js-old/src/dapps/chaindeploy/utils.js b/js-old/src/dapps/chaindeploy/utils.js deleted file mode 100644 index 87e7279e33f..00000000000 --- a/js-old/src/dapps/chaindeploy/utils.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import BigNumber from 'bignumber.js'; - -import { api } from './parity'; - -export function validateCode (source, retrieved) { - const original = source.substr(12); - const bytecode = retrieved.substr(12); - - const knownHash = api.util.sha3(original.slice(-1 * bytecode.length)); - const codeHash = api.util.sha3(bytecode); - - return knownHash === codeHash; -} - -export function isValidNumber (number) { - return number && !(new BigNumber(number)).isZero(); -} - -export function executeContract (logId, contract, funcName, options, values) { - const func = contract.instance[funcName]; - - return func - .estimateGas(options, values) - .then((gasEst) => { - options.gas = gasEst.mul(1.2); - - return trackRequest( - func.postTransaction(options, values), - (error, data) => { - if (error) { - console.error(logId, error); - } else { - console.log(logId, data); - } - } - ); - }); -} - -export function trackRequest (promise, callback) { - return promise - .then((requestId) => { - callback(null, { state: 'checkRequest', requestId }); - - return api.pollMethod('parity_checkRequest', requestId); - }) - .then((txHash) => { - callback(null, { state: 'getTransactionReceipt', txHash }); - - return api.pollMethod('eth_getTransactionReceipt', txHash, (receipt) => { - if (!receipt || !receipt.blockNumber || receipt.blockNumber.eq(0)) { - return false; - } - - return true; - }); - }) - .then((receipt) => { - callback(null, { state: 'hasReceipt', receipt }); - }) - .catch((error) => { - callback(error); - - throw error; - }); -} diff --git a/js-old/src/dapps/console.js b/js-old/src/dapps/console.js deleted file mode 100644 index 44b6dcb9c4d..00000000000 --- a/js-old/src/dapps/console.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import React from 'react'; -import ReactDOM from 'react-dom'; -import { AppContainer } from 'react-hot-loader'; - -import 'codemirror/addon/dialog/dialog'; -import 'codemirror/addon/dialog/dialog.css'; -import 'codemirror/addon/hint/javascript-hint'; -import 'codemirror/addon/hint/show-hint'; -import 'codemirror/addon/hint/show-hint.css'; -import 'codemirror/addon/search/match-highlighter'; -import 'codemirror/addon/search/search'; -import 'codemirror/addon/search/searchcursor'; -import 'codemirror/keymap/sublime'; -import 'codemirror/lib/codemirror.css'; -import 'codemirror/mode/javascript/javascript'; -// Custom codemirror style -import './console/codemirror.css'; - -import Application from './console/Application'; - -import '../../assets/fonts/Roboto/font.css'; -import '../../assets/fonts/RobotoMono/font.css'; -import './style.css'; - -ReactDOM.render( - - - , - document.querySelector('#container') -); - -if (module.hot) { - module.hot.accept('./console/Application/index.js', () => { - require('./console/Application/index.js'); - - ReactDOM.render( - - - , - document.querySelector('#container') - ); - }); -} diff --git a/js-old/src/dapps/console/Application/application.css b/js-old/src/dapps/console/Application/application.css deleted file mode 100644 index eea2c030db3..00000000000 --- a/js-old/src/dapps/console/Application/application.css +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright 2015-2017 Parity Technologies (UK) Ltd. -/* This file is part of Parity. -/* -/* Parity is free software: you can redistribute it and/or modify -/* it under the terms of the GNU General Public License as published by -/* the Free Software Foundation, either version 3 of the License, or -/* (at your option) any later version. -/* -/* Parity is distributed in the hope that it will be useful, -/* but WITHOUT ANY WARRANTY; without even the implied warranty of -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/* GNU General Public License for more details. -/* -/* You should have received a copy of the GNU General Public License -/* along with Parity. If not, see . -*/ - -.app { - display: flex; - flex-direction: column; - font-family: Arial, sans-serif; - font-size: 11px; - height: 100vh; - overflow: hidden; -} - -textarea, -input { - font-family: dejavu sans mono, monospace; - outline: none; -} - -code, -pre { - font-family: dejavu sans mono, monospace; - font-size: 11px; -} - -.header { - flex: 0 0 auto; -} - -.view { - display: flex; - flex: 1; - flex-direction: column; -} - -.eval { - flex: 0 1 auto; - font-family: dejavu sans mono, monospace; - overflow: auto; -} - -.input { - border-top: 1px solid #eee; - display: flex; - flex: 1 1 auto; - min-height: 50px; -} - -.status { - flex: 0 0 auto; - font-family: dejavu sans mono, monospace; -} diff --git a/js-old/src/dapps/console/Application/application.js b/js-old/src/dapps/console/Application/application.js deleted file mode 100644 index 5a591e710a8..00000000000 --- a/js-old/src/dapps/console/Application/application.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { observer } from 'mobx-react'; -import React, { Component } from 'react'; - -import { api } from '../parity'; - -import Console from '../Console'; -import Header from '../Header'; -import Input from '../Input'; -import Settings from '../Settings'; -import Snippets from '../Snippets'; -import Watches from '../Watches'; - -import ApplicationStore from './application.store'; -import WatchesStore from '../Watches/watches.store'; - -import styles from './application.css'; - -@observer -export default class Application extends Component { - application = ApplicationStore.get(); - watches = WatchesStore.get(); - - componentWillMount () { - this.watches.add('time', () => new Date()); - this.watches.add('blockNumber', api.eth.blockNumber, api); - } - - render () { - return ( -
-
-
-
- - { this.renderView() } - -
- -
-
- ); - } - - renderView () { - const { view } = this.application; - - if (view === 'console') { - return ( -
-
- -
-
- -
-
- ); - } - - if (view === 'settings') { - return ( -
- -
- ); - } - - if (view === 'snippets') { - return ( -
- -
- ); - } - - return null; - } -} diff --git a/js-old/src/dapps/console/Application/index.js b/js-old/src/dapps/console/Application/index.js deleted file mode 100644 index 3d8d1ca3b85..00000000000 --- a/js-old/src/dapps/console/Application/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './application'; diff --git a/js-old/src/dapps/console/Autocomplete/autocomplete.css b/js-old/src/dapps/console/Autocomplete/autocomplete.css deleted file mode 100644 index 8d4585e7a7c..00000000000 --- a/js-old/src/dapps/console/Autocomplete/autocomplete.css +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2015-2017 Parity Technologies (UK) Ltd. -/* This file is part of Parity. -/* -/* Parity is free software: you can redistribute it and/or modify -/* it under the terms of the GNU General Public License as published by -/* the Free Software Foundation, either version 3 of the License, or -/* (at your option) any later version. -/* -/* Parity is distributed in the hope that it will be useful, -/* but WITHOUT ANY WARRANTY; without even the implied warranty of -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/* GNU General Public License for more details. -/* -/* You should have received a copy of the GNU General Public License -/* along with Parity. If not, see . -*/ - -.container { - background: #f8f8f8; - box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.5); - font-family: dejavu sans mono, monospace; - left: 20px; - position: absolute; - max-height: 300px; - overflow: auto; -} - -.item { - background-color: white; - padding: 0.25em 0.25em 0.25em 0.35em; - display: flex; - justify-content: space-between; - - &.selected { - background-color: rgb(64, 115, 244); - - &, - .proto { - color: white; - } - } - - &:hover { - cursor: default; - } - - &:hover:not(.selected) { - background-color: rgb(230, 236, 255); - } - - .proto { - color: gray; - margin-left: 1em; - } -} diff --git a/js-old/src/dapps/console/Autocomplete/autocomplete.js b/js-old/src/dapps/console/Autocomplete/autocomplete.js deleted file mode 100644 index e2938f23dc4..00000000000 --- a/js-old/src/dapps/console/Autocomplete/autocomplete.js +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { observer } from 'mobx-react'; -import React, { Component } from 'react'; -import ReactDOM from 'react-dom'; - -import AutocompleteStore from './autocomplete.store'; - -import styles from './autocomplete.css'; - -@observer -export default class Autocomplete extends Component { - autocompleteStore = AutocompleteStore.get(); - - render () { - if (!this.autocompleteStore.show) { - return null; - } - - return ( -
- { this.renderAutocompletes() } -
- ); - } - - renderAutocompletes () { - const { selected, values } = this.autocompleteStore; - const displayedProto = {}; - - return values.map((autocomplete, index) => { - const { name, prototypeName } = autocomplete; - const onClick = () => this.handleClick(index); - const setRef = (node) => this.setRef(index, node); - - const proto = !displayedProto[prototypeName] - ? ( - - { prototypeName } - - ) - : null; - - if (!displayedProto[prototypeName]) { - displayedProto[prototypeName] = true; - } - - const classes = [ styles.item ]; - - if (index === selected) { - classes.push(styles.selected); - } - - return ( -
- - { name } - - { proto } -
- ); - }); - } - - handleClick = (index) => { - this.autocompleteStore.select(index); - }; - - setRef = (index, node) => { - const element = ReactDOM.findDOMNode(node); - - this.autocompleteStore.setElement(index, element); - }; -} diff --git a/js-old/src/dapps/console/Autocomplete/autocomplete.store.js b/js-old/src/dapps/console/Autocomplete/autocomplete.store.js deleted file mode 100644 index 82ff2f24dc8..00000000000 --- a/js-old/src/dapps/console/Autocomplete/autocomplete.store.js +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { action, observable } from 'mobx'; - -import { evaluate } from '../utils'; - -let instance; - -export default class AutocompleteStore { - @observable values = []; - @observable position = {}; - @observable show = false; - @observable selected = null; - - elements = {}; - inputNode = null; - lastObject = null; - lastObjectPropertyNames = []; - - static get () { - if (!instance) { - instance = new AutocompleteStore(); - } - - return instance; - } - - get hasSelected () { - return this.selected !== null; - } - - clearCache () { - this.lastObject = null; - this.lastObjectPropertyNames = null; - } - - @action - focus (offset = 1) { - if (this.values.length === 0) { - this.selected = null; - return; - } - - this.selected = this.selected === null - ? ( - offset === 1 - ? 0 - : this.values.length - 1 - ) - : (this.values.length + this.selected + offset) % (this.values.length); - - if (this.isVisible(this.selected)) { - return; - } - - const element = this.elements[this.selected]; - - if (!element) { - return; - } - - element.scrollIntoView(offset === -1); - } - - focusOnInput () { - if (!this.inputNode) { - return; - } - - this.inputNode.focus(); - } - - @action - hide () { - this.show = false; - this.selected = null; - } - - isVisible (index) { - const element = this.elements[index]; - - if (!element) { - return false; - } - - const eBoundings = element.getBoundingClientRect(); - const pBoundings = element.parentElement.getBoundingClientRect(); - - if (eBoundings.top < pBoundings.top || eBoundings.bottom > pBoundings.bottom) { - return false; - } - - return true; - } - - select (inputStore, _index = this.selected) { - const index = _index === null - ? 0 - : _index; - - if (!this.values[index]) { - console.warn(`autocomplete::select has been called on AutocompleteStore with wrong value ${index}`); - return; - } - - const { name } = this.values[index]; - const { input } = inputStore; - const objects = input.split('.'); - - objects[objects.length - 1] = name; - const nextInput = objects.join('.'); - - this.hide(); - this.focusOnInput(); - return inputStore.updateInput(nextInput, false); - } - - setElement (index, element) { - this.elements[index] = element; - } - - setInputNode (node) { - this.inputNode = node; - } - - @action - setPosition () { - if (!this.inputNode) { - return; - } - - const inputBoundings = this.inputNode.getBoundingClientRect(); - const bodyBoundings = document.body.getBoundingClientRect(); - - // display on bottom of input - if (inputBoundings.top < bodyBoundings.height / 2) { - const nextPosition = { - top: 20 - }; - - this.position = nextPosition; - return; - } - - // display on top of input - const nextPosition = { - bottom: inputBoundings.height - }; - - this.position = nextPosition; - return; - } - - @action - setValues (values) { - this.values = values; - this.selected = null; - const show = values.length > 0; - - // Reveal autocomplete - if (!this.show && show) { - this.setPosition(); - } - - this.show = show; - } - - update (input) { - if (input.length === 0) { - return this.setValues([]); - } - - const objects = input.split('.'); - const suffix = objects.pop().toLowerCase(); - const prefix = objects.join('.'); - const object = prefix.length > 0 - ? prefix - : 'window'; - - if (object !== this.lastObject) { - const evalResult = evaluate(object); - - if (evalResult.error) { - this.lastObjectProperties = []; - } else { - this.lastObjectProperties = getAllProperties(evalResult.result); - } - - this.lastObject = object; - } - - const autocompletes = this.lastObjectProperties.filter((property) => { - return property.name.toLowerCase().includes(suffix); - }); - - return this.setValues(autocompletes); - } -} - -function getAllProperties (object) { - const propertyNames = {}; - - while (object) { - const prototypeName = object && object.constructor && object.constructor.name || ''; - - Object.getOwnPropertyNames(object) - .sort() - .forEach((name) => { - if (Object.prototype.hasOwnProperty.call(propertyNames, name)) { - return; - } - - propertyNames[name] = { name, prototypeName }; - }); - - object = Object.getPrototypeOf(object); - } - - return Object.values(propertyNames); -} diff --git a/js-old/src/dapps/console/Autocomplete/index.js b/js-old/src/dapps/console/Autocomplete/index.js deleted file mode 100644 index 5761be0e3ed..00000000000 --- a/js-old/src/dapps/console/Autocomplete/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './autocomplete'; diff --git a/js-old/src/dapps/console/Console/console.css b/js-old/src/dapps/console/Console/console.css deleted file mode 100644 index a0b3db4ff36..00000000000 --- a/js-old/src/dapps/console/Console/console.css +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright 2015-2017 Parity Technologies (UK) Ltd. -/* This file is part of Parity. -/* -/* Parity is free software: you can redistribute it and/or modify -/* it under the terms of the GNU General Public License as published by -/* the Free Software Foundation, either version 3 of the License, or -/* (at your option) any later version. -/* -/* Parity is distributed in the hope that it will be useful, -/* but WITHOUT ANY WARRANTY; without even the implied warranty of -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/* GNU General Public License for more details. -/* -/* You should have received a copy of the GNU General Public License -/* along with Parity. If not, see . -*/ - -.result { - border-top: 1px solid #eee; - display: flex; - font-family: dejavu sans mono, monospace; - padding: 0.35em 0.25em; - - &.error { - background-color: hsl(0, 100%, 97%); - - .text { - color: red; - } - } - - &.warn { - background-color: hsl(50, 100%, 95%); - } -} - -.type { - font-weight: bold !important; - font-size: 8pt; - padding: 0 0.5em 0 0.25em; -} - -.time { - color: gray; - padding: 0 1em 0 0.5em; -} - -.token { - white-space: pre-wrap; -} - -.text { - display: flex; -} - -.text .token:not(:first-child) { - margin-left: 0.5em; -} diff --git a/js-old/src/dapps/console/Console/console.js b/js-old/src/dapps/console/Console/console.js deleted file mode 100644 index 75f9713a666..00000000000 --- a/js-old/src/dapps/console/Console/console.js +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { observer } from 'mobx-react'; -import React, { Component } from 'react'; -import ReactDOM from 'react-dom'; -import { ObjectInspector } from 'react-inspector'; - -import ConsoleStore from './console.store'; -import SettingsStore from '../Settings/settings.store'; - -import styles from './console.css'; - -const ICONS = { - debug: ' ', - error: '✖', - info: 'ℹ', - input: '>', - log: ' ', - result: '<', - warn: 'âš ' -}; - -@observer -export default class Console extends Component { - consoleStore = ConsoleStore.get(); - settingsStore = SettingsStore.get(); - - render () { - return ( -
- { this.renderResults() } -
- ); - } - - renderResults () { - const { logs } = this.consoleStore; - - return logs.map((data, index) => { - const { type, timestamp } = data; - const values = this.consoleStore.logValues[index]; - const classes = [ styles.result, styles[type] ]; - - return ( -
- - { this.renderTimestamp(timestamp) } - - { - values.map((value, valueIndex) => ( - - { this.toString(value) } - - )) - } - -
- ); - }); - } - - renderTimestamp (timestamp) { - const { displayTimestamps } = this.settingsStore; - - if (!displayTimestamps) { - return null; - } - - return ( - - { new Date(timestamp).toISOString().slice(11, 23) } - - ); - } - - setRef = (node) => { - const element = ReactDOM.findDOMNode(node); - - this.consoleStore.setNode(element); - }; - - toString (value) { - if (typeof value === 'string') { - return value; - } - - if (value instanceof Error) { - return value.toString(); - } - - return ( - - ); - } -} diff --git a/js-old/src/dapps/console/Console/console.store.js b/js-old/src/dapps/console/Console/console.store.js deleted file mode 100644 index dc2fc6db4ca..00000000000 --- a/js-old/src/dapps/console/Console/console.store.js +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { action, observable } from 'mobx'; - -import AutocompleteStore from '../Autocomplete/autocomplete.store'; -import { evaluate } from '../utils'; - -let instance; - -export default class ConsoleStore { - @observable logs = []; - - autocompleteStore = AutocompleteStore.get(); - logValues = []; - node = null; - - constructor () { - this.attachConsole(); - } - - static get () { - if (!instance) { - instance = new ConsoleStore(); - } - - return instance; - } - - attachConsole () { - ['debug', 'error', 'info', 'log', 'warn'].forEach((level) => { - const old = window.console[level].bind(window.console); - - window.console[level] = (...args) => { - old(...args); - this.log({ type: level, values: args }); - }; - }); - } - - @action - clear () { - this.logs = []; - this.logValues = []; - } - - evaluate (input) { - this.log({ type: 'input', value: input }); - - setTimeout(() => { - const { result, error } = evaluate(input); - let value = error || result; - const type = error - ? 'error' - : 'result'; - - if (typeof value === 'string') { - value = `"${value}"`; - } - - if (value && typeof value === 'object' && typeof value.then === 'function') { - return value - .then((result) => { - this.log({ type: 'result', value: result }); - }) - .catch((error) => { - this.log({ type: 'error', value: error }); - }); - } - - this.log({ type, value }); - }); - } - - @action - log ({ type, value, values }) { - this.logs.push({ - type, - timestamp: Date.now() - }); - - if (values) { - this.logValues.push(values); - } else { - this.logValues.push([ value ]); - } - - this.autocompleteStore.setPosition(); - this.scroll(); - } - - setNode (node) { - this.node = node; - this.scroll(); - } - - scroll () { - if (!this.node) { - return; - } - - setTimeout(() => { - if (this.node.children.length === 0) { - return; - } - - // Scroll to the last child - this.node - .children[this.node.children.length - 1] - .scrollIntoView(false); - }, 50); - } -} diff --git a/js-old/src/dapps/console/Console/index.js b/js-old/src/dapps/console/Console/index.js deleted file mode 100644 index 2956b330fe4..00000000000 --- a/js-old/src/dapps/console/Console/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './console'; diff --git a/js-old/src/dapps/console/Header/header.css b/js-old/src/dapps/console/Header/header.css deleted file mode 100644 index 116de6b8c91..00000000000 --- a/js-old/src/dapps/console/Header/header.css +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2015-2017 Parity Technologies (UK) Ltd. -/* This file is part of Parity. -/* -/* Parity is free software: you can redistribute it and/or modify -/* it under the terms of the GNU General Public License as published by -/* the Free Software Foundation, either version 3 of the License, or -/* (at your option) any later version. -/* -/* Parity is distributed in the hope that it will be useful, -/* but WITHOUT ANY WARRANTY; without even the implied warranty of -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/* GNU General Public License for more details. -/* -/* You should have received a copy of the GNU General Public License -/* along with Parity. If not, see . -*/ - -.container { - background-color: #f3f3f3; - border-bottom: 1px solid #ccc; - font-size: 12px; - padding: 0 0.5em; -} - -.tabs { - display: flex; -} - -.tab { - align-items: center; - box-sizing: border-box; - border: 1px solid transparent; - color: #333; - cursor: default; - display: flex; - height: 24px; - line-height: 15px; - margin-top: 2px; - padding: 2px 6px 2px 4px; - - &:hover, - &.active:hover { - background-color: #e5e5e5; - } - - &.active { - background-color: white; - border: 1px solid #ccc; - border-bottom: none; - } -} diff --git a/js-old/src/dapps/console/Header/header.js b/js-old/src/dapps/console/Header/header.js deleted file mode 100644 index c422b825604..00000000000 --- a/js-old/src/dapps/console/Header/header.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { observer } from 'mobx-react'; -import React, { Component } from 'react'; - -import ApplicationStore from '../Application/application.store'; - -import styles from './header.css'; - -@observer -export default class Header extends Component { - application = ApplicationStore.get(); - - render () { - return ( -
-
- { this.renderTabs() } -
-
- ); - } - - renderTabs () { - const { view } = this.application; - - return this.application.views.map((tab) => { - const { label, id } = tab; - const classes = [ styles.tab ]; - const onClick = () => this.handleClickTab(id); - - if (id === view) { - classes.push(styles.active); - } - - return ( -
- { label } -
- ); - }); - } - - handleClickTab = (id) => { - this.application.setView(id); - }; -} diff --git a/js-old/src/dapps/console/Header/index.js b/js-old/src/dapps/console/Header/index.js deleted file mode 100644 index aef90266f94..00000000000 --- a/js-old/src/dapps/console/Header/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './header'; diff --git a/js-old/src/dapps/console/Input/index.js b/js-old/src/dapps/console/Input/index.js deleted file mode 100644 index 29e00f72b19..00000000000 --- a/js-old/src/dapps/console/Input/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -export default from './input'; diff --git a/js-old/src/dapps/console/Input/input.css b/js-old/src/dapps/console/Input/input.css deleted file mode 100644 index 7b0c2306e48..00000000000 --- a/js-old/src/dapps/console/Input/input.css +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2015-2017 Parity Technologies (UK) Ltd. -/* This file is part of Parity. -/* -/* Parity is free software: you can redistribute it and/or modify -/* it under the terms of the GNU General Public License as published by -/* the Free Software Foundation, either version 3 of the License, or -/* (at your option) any later version. -/* -/* Parity is distributed in the hope that it will be useful, -/* but WITHOUT ANY WARRANTY; without even the implied warranty of -/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/* GNU General Public License for more details. -/* -/* You should have received a copy of the GNU General Public License -/* along with Parity. If not, see . -*/ - -.type { - color: #59f; - font-weight: bold !important; - font-size: 11px; - padding: 0 0.5em 0 0.25em; -} - -.inputContainer { - flex: 1; -} - -.input { - border: 0; - margin: 0; - padding: 0; - color: black; - height: 100%; - font-size: 11px; - resize: none; - width: 100%; -} - -.container { - border-top: 1px solid lightgray; - display: flex; - flex: 1; - padding: 0.25em; - position: relative; -} diff --git a/js-old/src/dapps/console/Input/input.js b/js-old/src/dapps/console/Input/input.js deleted file mode 100644 index 3263aff3848..00000000000 --- a/js-old/src/dapps/console/Input/input.js +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2015-2017 Parity Technologies (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import keycode from 'keycode'; -import { observer } from 'mobx-react'; -import React, { Component } from 'react'; -import ReactDOM from 'react-dom'; - -import Autocomplete from '../Autocomplete'; - -import AutocompleteStore from '../Autocomplete/autocomplete.store'; -import ConsoleStore from '../Console/console.store'; -import InputStore from './input.store'; -import SettingsStore from '../Settings/settings.store'; - -import styles from './input.css'; - -@observer -export default class Input extends Component { - autocompleteStore = AutocompleteStore.get(); - consoleStore = ConsoleStore.get(); - inputStore = InputStore.get(); - settingsStore = SettingsStore.get(); - - render () { - const { input } = this.inputStore; - - return ( -
- - > -
-