From c9874d06460a4d5da647fe3142f0412a5e9860e0 Mon Sep 17 00:00:00 2001 From: drewstone Date: Fri, 11 Jun 2021 13:26:38 -0400 Subject: [PATCH] ERUP-4 (#295) * Updates to latest frontier * Add webb mixer, token pallets * Update version of evm-runtime * Update package.json * Update anon to develop * Bump node types again. * Update types * Update types * Update deps, fix service * double ref count migration in custom migrations * Frontier bump, fixes getBlock rpc * ups * Up anon * Add elections phragmen migration * Use master anon, update frontier tester * Updates to erup-4 frontier/anon * compile separately to save time * precomiples * Ups to evm 0.26 * Update treasury reward to v3 macros * use webb-tools/substrate fork * format * use edgeware migrations * fix Council after the upgrade * Add assets pallet back * Add NFT pallets, fix runtime, remove warnings * Extend bounty update period to 30 days Bounties that have an assigned curator must be refreshed regularly to avoid being slashed. 3 days is too short, 30 days seems appropriate for now. * Updates to substrate/frontier commits * Updates deps * Remove config from dynamic fee * Add dynamic fee patch * Remove circleci * Add github workflow instead of CircleCI * yml workflow * Update deps of upgrade tester * Updates frontier * Update frontier * Substrate update * Add no-reaping feature flag * Fix feature flags * Updates package * add nvmrc * let's fix the CI * 2nd try * 3rd time * add merkle tree rpc * Update frontier dep, add curve25519 precompiles * Add client, rpcs, primitives from moonbeam (#304) Co-authored-by: Drew Stone * Update to new frontier fork w/ minimal changes (#305) Co-authored-by: Shady Khalifa * update webb-anon node with bug fixes * Updates, add frontier dev account to testnet chainspec * Upgrade versions of testers. * Updates, compile with binary search estimation * Fix warnings * More warnins * Pin build to a specific rust version (#301) subtle-2.4.0 wasn't compiling with the latest nightly release of rust. * fix toolchain. * Only emit TreasuryMinting event if there was a treasury reward; update tests (#308) * Remove frontier tester (#306) * remove frontier tester, moved out of repo * Fix ci script Co-authored-by: Jake Naviasky Co-authored-by: Shady Khalifa Co-authored-by: Raymond Zhong Co-authored-by: JelliedOwl (Paul) <80860490+JelliedOwl@users.noreply.github.com> --- .github/workflows/rust.yml | 36 + .gitignore | 5 +- Cargo.lock | 4599 ++++++++----- Cargo.toml | 316 +- client/rpc-core/debug/Cargo.toml | 22 + client/rpc-core/debug/src/lib.rs | 48 + client/rpc-core/trace/Cargo.toml | 18 + client/rpc-core/trace/src/lib.rs | 83 + client/rpc-core/txpool/Cargo.toml | 19 + client/rpc-core/txpool/src/lib.rs | 37 + client/rpc-core/txpool/src/types/content.rs | 85 + client/rpc-core/txpool/src/types/inspect.rs | 58 + client/rpc-core/txpool/src/types/mod.rs | 38 + client/rpc/debug/Cargo.toml | 31 + client/rpc/debug/src/lib.rs | 248 + client/rpc/trace/Cargo.toml | 42 + client/rpc/trace/src/lib.rs | 885 +++ client/rpc/txpool/Cargo.toml | 27 + client/rpc/txpool/src/lib.rs | 148 + modules/chainbridge/Cargo.toml | 41 - modules/chainbridge/src/lib.rs | 619 -- modules/chainbridge/src/mock.rs | 154 - modules/chainbridge/src/test.rs | 534 -- modules/edge-assets/Cargo.toml | 45 - modules/edge-assets/src/benchmarking.rs | 298 - modules/edge-assets/src/lib.rs | 1398 ---- modules/edge-assets/src/token_traits.rs | 76 - modules/edge-assets/src/weights.rs | 211 - modules/edge-chainbridge/Cargo.toml | 44 - modules/edge-chainbridge/src/lib.rs | 82 - modules/edge-chainbridge/src/mock.rs | 159 - modules/edge-chainbridge/src/tests.rs | 157 - modules/edge-treasury-reward/Cargo.toml | 47 - modules/edge-treasury-reward/src/lib.rs | 85 - modules/edge-treasury-reward/src/tests.rs | 243 - node/cli/Cargo.toml | 158 +- node/cli/browser-demo/.gitignore | 1 - node/cli/browser-demo/README.md | 10 - node/cli/browser-demo/build.sh | 4 - node/cli/browser-demo/favicon.png | Bin 10338 -> 0 bytes node/cli/browser-demo/index.html | 39 - node/cli/build.rs | 32 +- node/cli/doc/shell-completion.adoc | 41 - node/cli/src/browser.rs | 59 - node/cli/src/chain_spec.rs | 182 +- node/cli/src/cli.rs | 71 +- node/cli/src/command.rs | 80 +- node/cli/src/lib.rs | 20 +- node/cli/src/mainnet_fixtures.rs | 522 +- node/cli/src/service.rs | 569 +- node/cli/src/testnet_fixtures.rs | 415 +- node/debug/Cargo.toml | 39 + node/debug/src/block.rs | 106 + node/debug/src/lib.rs | 93 + node/debug/src/serialization.rs | 83 + node/debug/src/single.rs | 155 + node/evm_tracer/Cargo.toml | 37 + node/evm_tracer/src/call_list.rs | 379 ++ node/evm_tracer/src/lib.rs | 31 + node/evm_tracer/src/raw.rs | 328 + node/evm_tracer/src/util.rs | 246 + node/executor/Cargo.toml | 44 +- node/executor/benches/bench.rs | 130 +- node/executor/src/lib.rs | 12 +- node/opts/Cargo.toml | 8 + node/opts/src/lib.rs | 29 + node/primitives/Cargo.toml | 14 +- node/primitives/src/lib.rs | 32 +- node/rpc-client/Cargo.toml | 6 +- node/rpc-client/src/main.rs | 36 +- node/rpc/Cargo.toml | 74 +- node/rpc/src/client.rs | 59 + node/rpc/src/lib.rs | 398 +- node/runtime-interface/Cargo.toml | 10 +- node/runtime-interface/src/lib.rs | 70 +- node/runtime/Cargo.toml | 192 +- node/runtime/build.rs | 2 +- node/runtime/src/constants.rs | 4 +- node/runtime/src/impls.rs | 7 +- node/runtime/src/lib.rs | 1244 ++-- node/runtime/src/precompiles.rs | 73 + node/testing/Cargo.toml | 54 - node/testing/src/client.rs | 76 - node/testing/src/genesis.rs | 113 - node/testing/src/keyring.rs | 107 - node/testing/src/lib.rs | 23 - node/txpool/Cargo.toml | 26 + node/txpool/src/lib.rs | 40 + pallets/edge-treasury-reward/Cargo.toml | 47 + pallets/edge-treasury-reward/src/lib.rs | 132 + pallets/edge-treasury-reward/src/mock.rs | 157 + pallets/edge-treasury-reward/src/tests.rs | 147 + pallets/nft/Cargo.toml | 53 + pallets/nft/src/benchmarking.rs | 355 + pallets/nft/src/lib.rs | 390 ++ pallets/nft/src/mock.rs | 269 + pallets/nft/src/tests.rs | 504 ++ pallets/nft/src/weights.rs | 133 + pallets/orml-nft/Cargo.toml | 33 + pallets/orml-nft/README.md | 11 + pallets/orml-nft/src/lib.rs | 292 + pallets/orml-nft/src/mock.rs | 92 + pallets/orml-nft/src/tests.rs | 180 + rust-toolchain | 5 + rustfmt.toml | 9 + scripts/init-ci.sh | 28 + scripts/init.sh | 4 +- scripts/start.sh | 2 + ts-tests/frontier-tester/README.md | 33 - .../contracts/ContractImpl.sol | 9 - .../contracts/Create2Factory.sol | 25 - .../contracts/CreateContract.sol | 30 - .../frontier-tester/contracts/ECRecovery.sol | 39 - .../contracts/EventContract.sol | 9 - .../contracts/FallbackContract.sol | 9 - .../frontier-tester/contracts/Hashing.sol | 15 - .../frontier-tester/contracts/IContract.sol | 5 - .../contracts/IContractUser.sol | 17 - .../frontier-tester/contracts/Lockdrop.sol | 137 - .../frontier-tester/contracts/Migrations.sol | 26 - .../frontier-tester/contracts/Multicall.sol | 45 - .../contracts/OwnerContract.sol | 17 - .../frontier-tester/contracts/StoreNum.sol | 13 - .../contracts/TimeContract.sol | 32 - ts-tests/frontier-tester/contracts/TokenA.sol | 14 - ts-tests/frontier-tester/contracts/TokenB.sol | 14 - .../contracts/ValueContract.sol | 16 - .../frontier-tester/helpers/deployUniswap.js | 36 - ts-tests/frontier-tester/helpers/flipper.json | 106 - ts-tests/frontier-tester/helpers/flipper.wasm | Bin 2316 -> 0 bytes .../helpers/generalizedLocks.js | 5 - .../helpers/initDefaultAccountBalance.ts | 50 - .../frontier-tester/helpers/lockdropHelper.js | 423 -- .../helpers/lockdropWeb3Util.js | 100 - ts-tests/frontier-tester/helpers/schedule.js | 31 - ts-tests/frontier-tester/helpers/utils.js | 204 - ts-tests/frontier-tester/package.json | 47 - .../frontier-tester/tests/addLiquidity.js | 107 - .../frontier-tester/tests/testAllowance.js | 27 - ts-tests/frontier-tester/tests/testCreate.js | 71 - ts-tests/frontier-tester/tests/testCreate2.js | 33 - .../frontier-tester/tests/testECRecovery.js | 65 - ts-tests/frontier-tester/tests/testEvent.js | 65 - .../frontier-tester/tests/testFallback.js | 37 - .../frontier-tester/tests/testGasWeighting.ts | 47 - ts-tests/frontier-tester/tests/testHashing.js | 90 - .../frontier-tester/tests/testInterfaces.js | 35 - .../frontier-tester/tests/testLockdrop.js | 131 - ts-tests/frontier-tester/tests/testOwner.js | 39 - .../frontier-tester/tests/testPrecompiles.js | 67 - .../tests/testSubstrateBalances.ts | 174 - .../tests/testSubstrateFeatures.ts | 209 - ts-tests/frontier-tester/tests/testTime.js | 45 - ts-tests/frontier-tester/tests/testValue.js | 64 - ts-tests/frontier-tester/truffle-config.js | 7 - ts-tests/frontier-tester/tsconfig.json | 7 - ts-tests/frontier-tester/yarn.lock | 6044 ----------------- ts-tests/upgrade-tester/package.json | 11 +- ts-tests/upgrade-tester/src/index.ts | 14 +- ts-tests/upgrade-tester/src/scripts/forker.ts | 2 +- ts-tests/upgrade-tester/src/stateTest.ts | 2 +- ts-tests/upgrade-tester/src/testRunner.ts | 3 +- ts-tests/upgrade-tester/src/tests/council.ts | 12 +- ts-tests/upgrade-tester/yarn.lock | 413 +- types/v46.json | 43 + 165 files changed, 12428 insertions(+), 17307 deletions(-) create mode 100644 .github/workflows/rust.yml create mode 100644 client/rpc-core/debug/Cargo.toml create mode 100644 client/rpc-core/debug/src/lib.rs create mode 100644 client/rpc-core/trace/Cargo.toml create mode 100644 client/rpc-core/trace/src/lib.rs create mode 100644 client/rpc-core/txpool/Cargo.toml create mode 100644 client/rpc-core/txpool/src/lib.rs create mode 100644 client/rpc-core/txpool/src/types/content.rs create mode 100644 client/rpc-core/txpool/src/types/inspect.rs create mode 100644 client/rpc-core/txpool/src/types/mod.rs create mode 100644 client/rpc/debug/Cargo.toml create mode 100644 client/rpc/debug/src/lib.rs create mode 100644 client/rpc/trace/Cargo.toml create mode 100644 client/rpc/trace/src/lib.rs create mode 100644 client/rpc/txpool/Cargo.toml create mode 100644 client/rpc/txpool/src/lib.rs delete mode 100644 modules/chainbridge/Cargo.toml delete mode 100644 modules/chainbridge/src/lib.rs delete mode 100644 modules/chainbridge/src/mock.rs delete mode 100644 modules/chainbridge/src/test.rs delete mode 100644 modules/edge-assets/Cargo.toml delete mode 100644 modules/edge-assets/src/benchmarking.rs delete mode 100644 modules/edge-assets/src/lib.rs delete mode 100644 modules/edge-assets/src/token_traits.rs delete mode 100644 modules/edge-assets/src/weights.rs delete mode 100644 modules/edge-chainbridge/Cargo.toml delete mode 100644 modules/edge-chainbridge/src/lib.rs delete mode 100644 modules/edge-chainbridge/src/mock.rs delete mode 100644 modules/edge-chainbridge/src/tests.rs delete mode 100644 modules/edge-treasury-reward/Cargo.toml delete mode 100644 modules/edge-treasury-reward/src/lib.rs delete mode 100644 modules/edge-treasury-reward/src/tests.rs delete mode 100644 node/cli/browser-demo/.gitignore delete mode 100644 node/cli/browser-demo/README.md delete mode 100755 node/cli/browser-demo/build.sh delete mode 100644 node/cli/browser-demo/favicon.png delete mode 100644 node/cli/browser-demo/index.html delete mode 100644 node/cli/doc/shell-completion.adoc delete mode 100644 node/cli/src/browser.rs create mode 100644 node/debug/Cargo.toml create mode 100644 node/debug/src/block.rs create mode 100644 node/debug/src/lib.rs create mode 100644 node/debug/src/serialization.rs create mode 100644 node/debug/src/single.rs create mode 100644 node/evm_tracer/Cargo.toml create mode 100644 node/evm_tracer/src/call_list.rs create mode 100644 node/evm_tracer/src/lib.rs create mode 100644 node/evm_tracer/src/raw.rs create mode 100644 node/evm_tracer/src/util.rs create mode 100644 node/opts/Cargo.toml create mode 100644 node/opts/src/lib.rs create mode 100644 node/rpc/src/client.rs create mode 100644 node/runtime/src/precompiles.rs delete mode 100644 node/testing/Cargo.toml delete mode 100644 node/testing/src/client.rs delete mode 100644 node/testing/src/genesis.rs delete mode 100644 node/testing/src/keyring.rs delete mode 100644 node/testing/src/lib.rs create mode 100644 node/txpool/Cargo.toml create mode 100644 node/txpool/src/lib.rs create mode 100644 pallets/edge-treasury-reward/Cargo.toml create mode 100644 pallets/edge-treasury-reward/src/lib.rs create mode 100644 pallets/edge-treasury-reward/src/mock.rs create mode 100644 pallets/edge-treasury-reward/src/tests.rs create mode 100644 pallets/nft/Cargo.toml create mode 100644 pallets/nft/src/benchmarking.rs create mode 100644 pallets/nft/src/lib.rs create mode 100644 pallets/nft/src/mock.rs create mode 100644 pallets/nft/src/tests.rs create mode 100644 pallets/nft/src/weights.rs create mode 100644 pallets/orml-nft/Cargo.toml create mode 100644 pallets/orml-nft/README.md create mode 100644 pallets/orml-nft/src/lib.rs create mode 100644 pallets/orml-nft/src/mock.rs create mode 100644 pallets/orml-nft/src/tests.rs create mode 100644 rust-toolchain create mode 100644 rustfmt.toml create mode 100755 scripts/init-ci.sh create mode 100755 scripts/start.sh delete mode 100644 ts-tests/frontier-tester/README.md delete mode 100644 ts-tests/frontier-tester/contracts/ContractImpl.sol delete mode 100644 ts-tests/frontier-tester/contracts/Create2Factory.sol delete mode 100644 ts-tests/frontier-tester/contracts/CreateContract.sol delete mode 100644 ts-tests/frontier-tester/contracts/ECRecovery.sol delete mode 100644 ts-tests/frontier-tester/contracts/EventContract.sol delete mode 100644 ts-tests/frontier-tester/contracts/FallbackContract.sol delete mode 100644 ts-tests/frontier-tester/contracts/Hashing.sol delete mode 100644 ts-tests/frontier-tester/contracts/IContract.sol delete mode 100644 ts-tests/frontier-tester/contracts/IContractUser.sol delete mode 100644 ts-tests/frontier-tester/contracts/Lockdrop.sol delete mode 100644 ts-tests/frontier-tester/contracts/Migrations.sol delete mode 100644 ts-tests/frontier-tester/contracts/Multicall.sol delete mode 100644 ts-tests/frontier-tester/contracts/OwnerContract.sol delete mode 100644 ts-tests/frontier-tester/contracts/StoreNum.sol delete mode 100644 ts-tests/frontier-tester/contracts/TimeContract.sol delete mode 100644 ts-tests/frontier-tester/contracts/TokenA.sol delete mode 100644 ts-tests/frontier-tester/contracts/TokenB.sol delete mode 100644 ts-tests/frontier-tester/contracts/ValueContract.sol delete mode 100644 ts-tests/frontier-tester/helpers/deployUniswap.js delete mode 100644 ts-tests/frontier-tester/helpers/flipper.json delete mode 100644 ts-tests/frontier-tester/helpers/flipper.wasm delete mode 100644 ts-tests/frontier-tester/helpers/generalizedLocks.js delete mode 100644 ts-tests/frontier-tester/helpers/initDefaultAccountBalance.ts delete mode 100644 ts-tests/frontier-tester/helpers/lockdropHelper.js delete mode 100644 ts-tests/frontier-tester/helpers/lockdropWeb3Util.js delete mode 100644 ts-tests/frontier-tester/helpers/schedule.js delete mode 100644 ts-tests/frontier-tester/helpers/utils.js delete mode 100644 ts-tests/frontier-tester/package.json delete mode 100644 ts-tests/frontier-tester/tests/addLiquidity.js delete mode 100644 ts-tests/frontier-tester/tests/testAllowance.js delete mode 100644 ts-tests/frontier-tester/tests/testCreate.js delete mode 100644 ts-tests/frontier-tester/tests/testCreate2.js delete mode 100644 ts-tests/frontier-tester/tests/testECRecovery.js delete mode 100644 ts-tests/frontier-tester/tests/testEvent.js delete mode 100644 ts-tests/frontier-tester/tests/testFallback.js delete mode 100644 ts-tests/frontier-tester/tests/testGasWeighting.ts delete mode 100644 ts-tests/frontier-tester/tests/testHashing.js delete mode 100644 ts-tests/frontier-tester/tests/testInterfaces.js delete mode 100644 ts-tests/frontier-tester/tests/testLockdrop.js delete mode 100644 ts-tests/frontier-tester/tests/testOwner.js delete mode 100644 ts-tests/frontier-tester/tests/testPrecompiles.js delete mode 100644 ts-tests/frontier-tester/tests/testSubstrateBalances.ts delete mode 100644 ts-tests/frontier-tester/tests/testSubstrateFeatures.ts delete mode 100644 ts-tests/frontier-tester/tests/testTime.js delete mode 100644 ts-tests/frontier-tester/tests/testValue.js delete mode 100644 ts-tests/frontier-tester/truffle-config.js delete mode 100644 ts-tests/frontier-tester/tsconfig.json delete mode 100644 ts-tests/frontier-tester/yarn.lock create mode 100644 types/v46.json diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 00000000..772c84c4 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,36 @@ +name: Rust + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + name: 'Run tests' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Init + run: | + scripts/init-ci.sh + cargo --version + rustc --version + cargo +$WASM_BUILD_TOOLCHAIN --version + rustc +$WASM_BUILD_TOOLCHAIN --version + env: + WASM_BUILD_TOOLCHAIN: nightly-2021-03-15 + - name: Cache Cargo + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + ~/.cargo/bin + target + key: cargo-cache + - name: Build (with no-reaping) + run: cargo build --release --features no-reaping + - name: Run tests + run: scripts/test.sh diff --git a/.gitignore b/.gitignore index 100ad7ff..4dea1f47 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,7 @@ node_modules forker-data beresheet-state.json build -*yalc* \ No newline at end of file +*yalc* + +# IDEs +.vim diff --git a/Cargo.lock b/Cargo.lock index 75191a81..c0116a36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "Inflector" version = "0.11.4" @@ -19,11 +21,20 @@ dependencies = [ "gimli 0.23.0", ] +[[package]] +name = "addr2line" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03345e98af8f3d786b6d9f656ccfa6ac316d954e92bc4841f0bba20789d5fb5a" +dependencies = [ + "gimli 0.24.0", +] + [[package]] name = "adler" -version = "0.2.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" @@ -87,13 +98,24 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] +[[package]] +name = "alga" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f823d037a7ec6ea2197046bafd4ae150e6bc36f9ca347404f46a46823fa84f2" +dependencies = [ + "approx 0.3.2", + "num-complex 0.2.4", + "num-traits", +] + [[package]] name = "ansi_term" version = "0.11.0" @@ -114,9 +136,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" +checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" [[package]] name = "approx" @@ -128,10 +150,13 @@ dependencies = [ ] [[package]] -name = "arc-swap" -version = "1.2.0" +name = "approx" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d7d63395147b81a9e570bcc6243aaf71c017bd666d4909cfef0085bdda8d73" +checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" +dependencies = [ + "num-traits", +] [[package]] name = "arrayref" @@ -155,30 +180,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] -name = "asn1_der" -version = "0.6.3" +name = "arrayvec" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fce6b6a0ffdafebd82c87e79e3f40e8d2c523e5fea5566ff6b90509bf98d638" -dependencies = [ - "asn1_der_derive", -] +checksum = "5a2f58b0bb10c380af2b26e57212856b8c9a59e0925b4c20f4a174a49734eaf7" [[package]] -name = "asn1_der_derive" -version = "0.1.2" +name = "asn1_der" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" -dependencies = [ - "quote", - "syn", -] +checksum = "9d6e24d2cce90c53b948c46271bfb053e4bdc2db9b5d3f65e20f8cf28a1b7fc3" [[package]] name = "assert_cmd" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dc1679af9a1ab4bea16f228b05d18f8363f8327b1fa8db00d2760cfafc6b61e" +checksum = "a88b6bd5df287567ffdf4ddf4d33060048e1068308e5f62d81c6f9824a045a48" dependencies = [ + "bstr", "doc-comment", "predicates", "predicates-core", @@ -188,9 +207,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59740d83946db6a5af71ae25ddf9562c2b176b2ca42cf99a455f09f4a220d6b9" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" dependencies = [ "concurrent-queue", "event-listener", @@ -199,16 +218,16 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb877970c7b440ead138f6321a3b5395d6061183af779340b65e20c0fede9146" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" dependencies = [ "async-task", "concurrent-queue", "fastrand", "futures-lite", "once_cell", - "vec-arena", + "slab", ] [[package]] @@ -229,29 +248,29 @@ dependencies = [ [[package]] name = "async-io" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd" +checksum = "4bbfd5cf2794b1e908ea8457e6c45f8f8f1f6ec5f74617bf4662623f47503c3b" dependencies = [ "concurrent-queue", "fastrand", "futures-lite", "libc", "log", - "nb-connect", "once_cell", "parking", "polling", - "vec-arena", + "slab", + "socket2 0.4.0", "waker-fn", "winapi 0.3.9", ] [[package]] name = "async-lock" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1996609732bde4a9988bc42125f55f2af5f3c36370e27c778d5191a4a1b63bfb" +checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" dependencies = [ "event-listener", ] @@ -267,15 +286,16 @@ dependencies = [ [[package]] name = "async-process" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8cea09c1fb10a317d1b5af8024eeba256d6554763e85ecd90ff8df31c7bbda" +checksum = "a8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354ac" dependencies = [ "async-io", "blocking", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "event-listener", "futures-lite", + "libc", "once_cell", "signal-hook", "winapi 0.3.9", @@ -292,7 +312,7 @@ dependencies = [ "async-io", "async-lock", "async-process", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.5", "futures-channel", "futures-core", "futures-io", @@ -303,12 +323,26 @@ dependencies = [ "memchr", "num_cpus", "once_cell", - "pin-project-lite 0.2.4", + "pin-project-lite 0.2.6", "pin-utils", "slab", "wasm-bindgen-futures", ] +[[package]] +name = "async-std-resolver" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed4e2c3da14d8ad45acb1e3191db7a918e9505b6f155b218e70a7c9a1a48c638" +dependencies = [ + "async-std", + "async-trait", + "futures-io", + "futures-util", + "pin-utils", + "trust-dns-resolver", +] + [[package]] name = "async-task" version = "4.0.3" @@ -316,27 +350,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" [[package]] -name = "async-tls" -version = "0.11.0" +name = "async-trait" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400" +checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" dependencies = [ - "futures-core", - "futures-io", - "rustls 0.19.0", - "webpki", - "webpki-roots", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "async-trait" -version = "0.1.42" +name = "asynchronous-codec" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3a45e77e34375a7923b1e8febb049bb011f064714a8e17a1a616fef01da13d" +checksum = "fb4401f0a3622dad2e0763fa79e0eb328bc70fb7dccfdd645341f00d671247d6" dependencies = [ - "proc-macro2", - "quote", - "syn", + "bytes 1.0.1", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite 0.2.6", +] + +[[package]] +name = "asynchronous-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" +dependencies = [ + "bytes 1.0.1", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite 0.2.6", ] [[package]] @@ -373,18 +420,25 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.56" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" +checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" dependencies = [ - "addr2line", + "addr2line 0.15.1", + "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.23.0", + "object 0.25.1", "rustc-demangle", ] +[[package]] +name = "base-x" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" + [[package]] name = "base58" version = "0.1.0" @@ -403,38 +457,38 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "bencher" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfdb4953a096c551ce9ace855a604d702e6e62d77fac690575ae347571717f5" + [[package]] name = "bincode" -version = "1.3.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "byteorder", "serde", ] [[package]] name = "bindgen" -version = "0.54.0" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36" +checksum = "fd4865004a46a0aafb2a0a5eb19d3c9fc46ee5f063a6cfc605c69ac9ecf5263d" dependencies = [ "bitflags", "cexpr", - "cfg-if 0.1.10", "clang-sys", - "clap", - "env_logger", "lazy_static", "lazycell", - "log", "peeking_take_while", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "which", ] [[package]] @@ -445,12 +499,14 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bitvec" -version = "0.17.4" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" dependencies = [ - "either", + "funty", "radium", + "tap", + "wyz", ] [[package]] @@ -485,6 +541,32 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "blake2s_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "cc", + "cfg-if 0.1.10", + "constant_time_eq", + "crypto-mac 0.8.0", + "digest 0.9.0", +] + [[package]] name = "block-buffer" version = "0.7.3" @@ -494,7 +576,7 @@ dependencies = [ "block-padding 0.1.5", "byte-tools", "byteorder", - "generic-array 0.12.3", + "generic-array 0.12.4", ] [[package]] @@ -553,9 +635,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf" +checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" dependencies = [ "lazy_static", "memchr", @@ -572,11 +654,26 @@ dependencies = [ "semver 0.6.0", ] +[[package]] +name = "bulletproofs-gadgets" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f730544daa13f48320a9be1bf804dd3544193f20a4194901317fd3ec354861fb" +dependencies = [ + "bencher", + "curve25519-dalek 3.1.0", + "merlin", + "parity-scale-codec 1.3.7", + "rand_core 0.5.1", + "sp-std 2.0.1", + "webb-bulletproofs", +] + [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" [[package]] name = "byte-slice-cast" @@ -584,6 +681,12 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" +[[package]] +name = "byte-slice-cast" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c1bf4a04a88c54f589125563643d773f3254b5c38571395e2b591c693bbc81" + [[package]] name = "byte-tools" version = "0.3.1" @@ -592,9 +695,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -649,18 +752,18 @@ dependencies = [ [[package]] name = "cast" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +checksum = "57cdfa5d50aad6cb4d44dcab6101a7f79925bd59d82ca42f38a9856a28865374" dependencies = [ - "rustc_version", + "rustc_version 0.3.3", ] [[package]] name = "cc" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" +checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" dependencies = [ "jobserver", ] @@ -709,21 +812,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "chainbridge" -version = "1.0.0" -dependencies = [ - "frame-support", - "frame-system", - "pallet-balances", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "chrono" version = "0.4.19" @@ -739,6 +827,17 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "cid" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff0e3bc0b6446b3f9663c1a6aba6ef06c5aeaa1bc92bd18077be337198ab9768" +dependencies = [ + "multibase", + "multihash", + "unsigned-varint 0.5.1", +] + [[package]] name = "cipher" version = "0.2.5" @@ -750,13 +849,13 @@ dependencies = [ [[package]] name = "clang-sys" -version = "0.29.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" +checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c" dependencies = [ "glob 0.3.0", "libc", - "libloading", + "libloading 0.7.0", ] [[package]] @@ -774,6 +873,15 @@ dependencies = [ "vec_map", ] +[[package]] +name = "clear_on_drop" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cc5db465b294c3fa986d5bbb0f3017cd850bff6dd6c52f9ccff8b4d21b7b08" +dependencies = [ + "cc", +] + [[package]] name = "cloudabi" version = "0.0.3" @@ -811,28 +919,18 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "console_log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" -dependencies = [ - "log", - "web-sys", -] - -[[package]] -name = "const_fn" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" - [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.7.0" @@ -850,10 +948,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] -name = "cpuid-bool" -version = "0.1.2" +name = "cpp_demangle" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390" +dependencies = [ + "cfg-if 1.0.0", + "glob 0.3.0", +] + +[[package]] +name = "cpufeatures" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" +checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" +dependencies = [ + "libc", +] [[package]] name = "cpuid-bool" @@ -863,25 +974,25 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "cranelift-bforest" -version = "0.66.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dcc286b052ee24a1e5a222e7c1125e6010ad35b0f248709b9b3737a8fedcfdf" +checksum = "bcee7a5107071484772b89fdf37f0f460b7db75f476e43ea7a684fd942470bcf" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.66.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9badfe36176cb653506091693bc2bb1970c9bddfcd6ec7fac404f7eaec6f38" +checksum = "654ab96f0f1cab71c0d323618a58360a492da2c341eb2c1f977fc195c664001b" dependencies = [ "byteorder", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.21.0", + "gimli 0.23.0", "log", "regalloc", "serde", @@ -892,9 +1003,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.66.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3f460031861e4f4ad510be62b2ae50bba6cc886b598a36f9c0a970feab9598" +checksum = "65994cfc5be9d5fd10c5fc30bcdddfa50c04bb79c91329287bff846434ff8f14" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -902,24 +1013,27 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.66.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad12409e922e7697cd0bdc7dc26992f64a77c31880dfe5e3c7722f4710206d" +checksum = "889d720b688b8b7df5e4903f9b788c3c59396050f5548e516e58ccb7312463ab" +dependencies = [ + "serde", +] [[package]] name = "cranelift-entity" -version = "0.66.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97cdc58972ea065d107872cfb9079f4c92ade78a8af85aaff519a65b5d13f71" +checksum = "1a2e6884a363e42a9ba980193ea8603a4272f8a92bd8bbaf9f57a94dbea0ff96" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.66.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef419efb4f94ecc02e5d9fbcc910d2bb7f0040e2de570e63a454f883bc891d6" +checksum = "e6f41e2f9b57d2c030e249d0958f1cdc2c3cd46accf8c0438b3d1944e9153444" dependencies = [ "cranelift-codegen", "log", @@ -929,28 +1043,29 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.66.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e69d44d59826eef6794066ac2c0f4ad3975f02d97030c60dbc04e3886adf36e" +checksum = "aab70ba7575665375d31cbdea2462916ce58be887834e1b83c860b43b51af637" dependencies = [ "cranelift-codegen", - "raw-cpuid", "target-lexicon", ] [[package]] name = "cranelift-wasm" -version = "0.66.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "979df666b1304624abe99738e9e0e7c7479ee5523ba4b8b237df9ff49996acbb" +checksum = "f2fc3d2e70da6439adf97648dcdf81834363154f2907405345b6fbe7ca38918c" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", + "itertools 0.10.0", "log", "serde", + "smallvec 1.6.1", "thiserror", - "wasmparser 0.59.0", + "wasmparser", ] [[package]] @@ -964,16 +1079,16 @@ dependencies = [ [[package]] name = "criterion" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70daa7ceec6cf143990669a04c7df13391d55fb27bd4079d252fca774ba244d8" +checksum = "ab327ed7354547cc2ef43cbe20ef68b988e70b4b593cbd66a2a61733123a3d23" dependencies = [ "atty", "cast", "clap", "criterion-plot", "csv", - "itertools 0.9.0", + "itertools 0.10.0", "lazy_static", "num-traits", "oorandom", @@ -1000,12 +1115,12 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.5", ] [[package]] @@ -1026,8 +1141,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.1", - "crossbeam-utils 0.8.1", + "crossbeam-epoch 0.9.5", + "crossbeam-utils 0.8.5", ] [[package]] @@ -1047,15 +1162,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.1" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" +checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" dependencies = [ "cfg-if 1.0.0", - "const_fn", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.5", "lazy_static", - "memoffset 0.6.1", + "memoffset 0.6.4", "scopeguard", ] @@ -1083,11 +1197,10 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "autocfg", "cfg-if 1.0.0", "lazy_static", ] @@ -1104,7 +1217,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" dependencies = [ - "generic-array 0.12.3", + "generic-array 0.12.4", "subtle 1.0.0", ] @@ -1120,9 +1233,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d58633299b24b515ac72a3f869f8b91306a3cec616a602843a383acd6f9e97" +checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" dependencies = [ "bstr", "csv-core", @@ -1151,9 +1264,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.18" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10bcb9d7dcbf7002aaffbb53eac22906b64cdcc127971dcc387d8eb7c95d5560" +checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" dependencies = [ "quote", "syn", @@ -1185,29 +1298,51 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.0.2" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" +checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", + "serde", "subtle 2.4.0", "zeroize", ] [[package]] name = "data-encoding" -version = "2.3.1" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + +[[package]] +name = "data-encoding-macro" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993a608597367c6377b258c25d7120740f00ed23a2252b729b1932dd7866f908" +checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" +dependencies = [ + "data-encoding", + "syn", +] [[package]] name = "derive_more" -version = "0.99.11" +version = "0.99.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" +checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" dependencies = [ + "convert_case", "proc-macro2", "quote", "syn", @@ -1225,7 +1360,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array 0.12.3", + "generic-array 0.12.4", ] [[package]] @@ -1239,28 +1374,39 @@ dependencies = [ [[package]] name = "directories" -version = "2.0.2" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" +checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7" dependencies = [ - "cfg-if 0.1.10", "dirs-sys", ] [[package]] -name = "directories" -version = "3.0.1" +name = "directories-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" dependencies = [ - "dirs-sys", + "cfg-if 1.0.0", + "dirs-sys-next", ] [[package]] name = "dirs-sys" -version = "0.3.5" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", @@ -1312,9 +1458,9 @@ checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" [[package]] name = "ed25519" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c66a534cbb46ab4ea03477eae19d5c22c01da8258030280b7bd9d8433fb6ef" +checksum = "8d0860415b12243916284c67a9be413e044ee6668247b99ba26d94b2bc06c8f6" dependencies = [ "signature", ] @@ -1325,50 +1471,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 3.0.2", + "curve25519-dalek 3.1.0", "ed25519", "rand 0.7.3", "serde", - "sha2 0.9.2", + "sha2 0.9.5", "zeroize", ] [[package]] -name = "edge-assets" -version = "3.2.0" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-balances", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "edge-chainbridge" -version = "1.0.0" -dependencies = [ - "chainbridge", - "frame-support", - "frame-system", - "pallet-balances", - "parity-scale-codec", - "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "edge-treasury-reward" -version = "1.0.0" +name = "edge-treasury-reward" +version = "1.0.0" dependencies = [ "frame-support", "frame-system", @@ -1379,41 +1492,53 @@ dependencies = [ "pallet-staking-reward-curve", "pallet-timestamp", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "safe-mix", "serde", "sp-core", "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "edgeware-cli" -version = "3.2.0" +version = "3.3.0" dependencies = [ "assert_cmd", "edgeware-executor", + "edgeware-opts", "edgeware-primitives", "edgeware-rpc", + "edgeware-rpc-debug", + "edgeware-rpc-primitives-debug", + "edgeware-rpc-primitives-txpool", + "edgeware-rpc-trace", + "edgeware-rpc-txpool", "edgeware-runtime", "fc-consensus", + "fc-db", + "fc-mapping-sync", + "fc-rpc", "fc-rpc-core", "fp-consensus", + "fp-rpc", "frame-benchmarking-cli", "frame-support", "frame-system", - "futures 0.3.12", + "futures 0.3.15", "hex 0.3.2", "hex-literal", - "jsonrpc-core", - "jsonrpc-pubsub", + "jsonrpc-core 15.1.0", + "jsonrpc-pubsub 15.1.0", + "libp2p-wasm-ext", "log", "nix", "pallet-authority-discovery", "pallet-balances", "pallet-contracts", + "pallet-dynamic-fee", "pallet-evm", "pallet-grandpa", "pallet-im-online", @@ -1421,9 +1546,9 @@ dependencies = [ "pallet-staking", "pallet-timestamp", "pallet-transaction-payment", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.10.2", - "platforms", + "platforms 0.2.1", "rand 0.7.3", "regex", "sc-authority-discovery", @@ -1436,6 +1561,7 @@ dependencies = [ "sc-consensus-aura", "sc-consensus-epochs", "sc-finality-grandpa", + "sc-finality-grandpa-warp-sync", "sc-keystore", "sc-network", "sc-offchain", @@ -1464,20 +1590,37 @@ dependencies = [ "substrate-build-script-utils", "substrate-frame-cli", "tempfile", + "tokio 0.2.25", "tracing", "wasm-bindgen", "wasm-bindgen-futures", ] +[[package]] +name = "edgeware-evm-tracer" +version = "0.1.0" +dependencies = [ + "edgeware-rpc-primitives-debug", + "ethereum-types", + "evm", + "evm-gasometer", + "evm-runtime", + "fp-evm", + "pallet-evm", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", +] + [[package]] name = "edgeware-executor" -version = "3.2.0" +version = "3.3.0" dependencies = [ "criterion", "edgeware-primitives", "edgeware-runtime", "edgeware-runtime-interface", - "edgeware-testing", "frame-benchmarking", "frame-support", "frame-system", @@ -1488,7 +1631,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sc-executor", "sp-core", "sp-io", @@ -1499,12 +1642,16 @@ dependencies = [ "wabt", ] +[[package]] +name = "edgeware-opts" +version = "0.1.0" + [[package]] name = "edgeware-primitives" -version = "3.2.0" +version = "3.3.0" dependencies = [ "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "pretty_assertions", "sp-application-crypto", "sp-core", @@ -1514,18 +1661,31 @@ dependencies = [ [[package]] name = "edgeware-rpc" -version = "3.2.0" +version = "3.3.0" dependencies = [ + "edgeware-executor", + "edgeware-opts", "edgeware-primitives", + "edgeware-rpc-debug", + "edgeware-rpc-primitives-debug", + "edgeware-rpc-primitives-txpool", + "edgeware-rpc-trace", + "edgeware-rpc-txpool", "edgeware-runtime", + "fc-db", + "fc-mapping-sync", "fc-rpc", "fc-rpc-core", "fp-rpc", - "jsonrpc-core", - "jsonrpc-pubsub", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "jsonrpc-pubsub 15.1.0", "pallet-contracts-rpc", "pallet-ethereum", + "pallet-merkle", + "pallet-merkle-rpc", "pallet-transaction-payment-rpc", + "pallet-transaction-payment-rpc-runtime-api", "sc-client-api", "sc-consensus-aura", "sc-consensus-epochs", @@ -1535,38 +1695,197 @@ dependencies = [ "sc-network", "sc-rpc", "sc-rpc-api", + "sc-service", + "sc-transaction-graph", + "sc-transaction-pool", "sp-api", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", + "sp-core", + "sp-offchain", "sp-runtime", + "sp-session", + "sp-storage", "sp-transaction-pool", "substrate-frame-rpc-system", + "tokio 0.2.25", ] [[package]] name = "edgeware-rpc-client" -version = "3.2.0" +version = "3.3.0" dependencies = [ "edgeware-primitives", - "futures 0.1.30", - "hyper 0.12.35", - "jsonrpc-core-client", + "futures 0.1.31", + "hyper 0.12.36", + "jsonrpc-core-client 15.1.0", "log", "sc-rpc", "sp-tracing", ] +[[package]] +name = "edgeware-rpc-core-debug" +version = "0.1.0" +dependencies = [ + "edgeware-rpc-primitives-debug", + "ethereum-types", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 14.2.0", + "jsonrpc-derive 14.2.2", + "serde", + "serde_json", + "sp-core", +] + +[[package]] +name = "edgeware-rpc-core-trace" +version = "0.6.0" +dependencies = [ + "edgeware-rpc-primitives-debug", + "ethereum-types", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 14.2.0", + "jsonrpc-derive 14.2.2", + "serde", + "serde_json", +] + +[[package]] +name = "edgeware-rpc-core-txpool" +version = "0.6.0" +dependencies = [ + "ethereum", + "ethereum-types", + "fc-rpc-core", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 14.2.0", + "jsonrpc-derive 14.2.2", + "serde", + "serde_json", +] + +[[package]] +name = "edgeware-rpc-debug" +version = "0.1.0" +dependencies = [ + "edgeware-rpc-core-debug", + "edgeware-rpc-primitives-debug", + "ethereum", + "ethereum-types", + "fc-consensus", + "fc-db", + "fc-rpc", + "fp-rpc", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "sc-client-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-io", + "sp-runtime", + "sp-utils", + "tokio 0.2.25", +] + +[[package]] +name = "edgeware-rpc-primitives-debug" +version = "0.1.0" +dependencies = [ + "ethereum", + "ethereum-types", + "hex 0.4.3", + "parity-scale-codec 2.1.1", + "serde", + "serde_json", + "sp-api", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", +] + +[[package]] +name = "edgeware-rpc-primitives-txpool" +version = "0.1.0" +dependencies = [ + "ethereum", + "parity-scale-codec 2.1.1", + "sp-api", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", +] + +[[package]] +name = "edgeware-rpc-trace" +version = "0.6.0" +dependencies = [ + "edgeware-rpc-core-trace", + "edgeware-rpc-primitives-debug", + "ethereum", + "ethereum-types", + "fc-consensus", + "fc-rpc", + "fc-rpc-core", + "fp-rpc", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "sc-client-api", + "sc-network", + "sc-transaction-graph", + "serde", + "sha3 0.8.2", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", + "sp-transaction-pool", + "sp-utils", + "tokio 0.2.25", + "tracing", +] + +[[package]] +name = "edgeware-rpc-txpool" +version = "0.6.0" +dependencies = [ + "edgeware-rpc-core-txpool", + "edgeware-rpc-primitives-txpool", + "ethereum", + "ethereum-types", + "fc-rpc", + "frame-system", + "jsonrpc-core 15.1.0", + "sc-transaction-graph", + "serde", + "sha3 0.8.2", + "sp-api", + "sp-blockchain", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", + "sp-transaction-pool", +] + [[package]] name = "edgeware-runtime" -version = "3.2.0" +version = "3.3.0" dependencies = [ - "chainbridge", - "edge-assets", - "edge-chainbridge", "edge-treasury-reward", + "edgeware-evm-tracer", "edgeware-primitives", + "edgeware-rpc-primitives-debug", + "edgeware-rpc-primitives-txpool", + "evm", "evm-runtime", "fp-rpc", "frame-benchmarking", @@ -1577,6 +1896,10 @@ dependencies = [ "frame-system-rpc-runtime-api", "hex-literal", "integer-sqrt", + "log", + "module-nft", + "orml-nft", + "pallet-assets", "pallet-aura", "pallet-authority-discovery", "pallet-authorship", @@ -1587,16 +1910,26 @@ dependencies = [ "pallet-contracts-primitives", "pallet-contracts-rpc-runtime-api", "pallet-democracy", + "pallet-dynamic-fee", + "pallet-election-provider-multi-phase", "pallet-elections-phragmen", "pallet-ethereum", "pallet-evm", + "pallet-evm-precompile-blake2", + "pallet-evm-precompile-bn128", + "pallet-evm-precompile-curve25519", + "pallet-evm-precompile-dispatch", "pallet-evm-precompile-ed25519", "pallet-evm-precompile-modexp", + "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", "pallet-grandpa", "pallet-identity", "pallet-im-online", "pallet-indices", + "pallet-merkle", + "pallet-merkle-rpc", + "pallet-mixer", "pallet-multisig", "pallet-offences", "pallet-proxy", @@ -1614,10 +1947,11 @@ dependencies = [ "pallet-treasury", "pallet-utility", "pallet-vesting", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "rustc-hex", "safe-mix", "serde", + "sha3 0.9.1", "sp-api", "sp-application-crypto", "sp-authority-discovery", @@ -1627,78 +1961,50 @@ dependencies = [ "sp-inherents", "sp-io", "sp-keyring", + "sp-npos-elections", "sp-offchain", "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 3.0.0", "sp-transaction-pool", "sp-version", "static_assertions", "substrate-wasm-builder", + "webb-currencies", + "webb-tokens", + "webb-traits", ] [[package]] name = "edgeware-runtime-interface" -version = "3.2.0" +version = "3.3.0" dependencies = [ "edgeware-primitives", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-runtime", "sp-runtime-interface", "sp-runtime-interface-proc-macro", ] -[[package]] -name = "edgeware-testing" -version = "3.2.0" -dependencies = [ - "criterion", - "edge-treasury-reward", - "edgeware-executor", - "edgeware-primitives", - "edgeware-runtime", - "frame-support", - "frame-system", - "fs_extra", - "futures 0.3.12", - "log", - "pallet-balances", - "pallet-contracts", - "pallet-grandpa", - "pallet-indices", - "pallet-session", - "pallet-staking", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-treasury", - "parity-scale-codec", - "sc-block-builder", - "sc-cli", - "sc-client-api", - "sc-client-db", - "sc-executor", - "sc-service", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-runtime", - "sp-timestamp", - "substrate-test-client", - "tempfile", -] - [[package]] name = "either" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "enum-as-inner" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "enumflags2" version = "0.6.4" @@ -1706,6 +2012,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83c8d82922337cd23a15f88b70d8e4ef5f11da38dd7cdb55e84dd5de99695da0" dependencies = [ "enumflags2_derive", + "serde", ] [[package]] @@ -1734,15 +2041,15 @@ dependencies = [ [[package]] name = "environmental" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6576a1755ddffd988788025e75bce9e74b018f7cc226198fe931d077911c6d7e" +checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" [[package]] name = "erased-serde" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0465971a8cc1fa2455c8465aaa377131e1f1cf4983280f474a13e68793aa770c" +checksum = "e5b36e6f2295f393f44894c6031f67df4d185b984cd54d08f768ce678007efcd" dependencies = [ "serde", ] @@ -1770,9 +2077,9 @@ dependencies = [ [[package]] name = "ethbloom" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a621dcebea74f2a6f2002d0a885c81ccf6cbdf86760183316a7722b5707ca4" +checksum = "779864b9c7f7ead1f092972c3257496c6a84b46dba2ce131dd8a282cb2cc5972" dependencies = [ "crunchy", "fixed-hash", @@ -1784,14 +2091,15 @@ dependencies = [ [[package]] name = "ethereum" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8603f637f22e3ab9aff8466b37850cd7ea2ae52034b07e41fdc82f1f68dfa2c" +checksum = "567ce064a8232c16e2b2c2173a936b91fbe35c2f2c5278871f5a1a31688b42e9" dependencies = [ "ethereum-types", + "funty", "hash-db", "hash256-std-hasher", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "rlp", "rlp-derive", "serde", @@ -1801,9 +2109,9 @@ dependencies = [ [[package]] name = "ethereum-types" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05dc5f0df4915fa6dff7f975a8366ecfaaa8959c74235469495153e7bb1b280e" +checksum = "f64b5df66a228d85e4b17e5d6c6aa43b0310898ffe8a85988c4c032357aaabfd" dependencies = [ "ethbloom", "fixed-hash", @@ -1811,7 +2119,7 @@ dependencies = [ "impl-rlp", "impl-serde", "primitive-types", - "uint 0.9.0", + "uint", ] [[package]] @@ -1822,16 +2130,17 @@ checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" [[package]] name = "evm" -version = "0.21.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b38d664e59bf9ae0114a275cdf785d4112c32b3df0e522f16585a77599e7c614" +checksum = "f833b0e642bec8286b80f00ad6cc6a95e50210c77949b9cb484637e6a05ed596" dependencies = [ + "environmental", "ethereum", "evm-core", "evm-gasometer", "evm-runtime", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "primitive-types", "rlp", "serde", @@ -1840,21 +2149,23 @@ dependencies = [ [[package]] name = "evm-core" -version = "0.21.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11690b7226e83602067b6ba9568055e642971158b2c3af210c80d37ce2b8629" +checksum = "908739da31125d17a69533c290a6c818b494176e59a2ce8accbf122f7d76835c" dependencies = [ - "parity-scale-codec", + "funty", + "parity-scale-codec 2.1.1", "primitive-types", "serde", ] [[package]] name = "evm-gasometer" -version = "0.21.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f566265c4b49fab36e74db39f8c5499a7d4bbfb54c83896ef56f3f517b945eca" +checksum = "4118f952ce320c11e1b7b8a575e477d70bc86a3b92ea23e427174d979cf1da26" dependencies = [ + "environmental", "evm-core", "evm-runtime", "primitive-types", @@ -1862,10 +2173,11 @@ dependencies = [ [[package]] name = "evm-runtime" -version = "0.21.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d22e83135ff4870046706c7bd8dd70bb321df98b42218812e99444332222250" +checksum = "952296b416c3b334b26933ad1f9cfa9203e251691586fb317e411872886ca31b" dependencies = [ + "environmental", "evm-core", "primitive-types", "sha3 0.8.2", @@ -1877,7 +2189,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", ] [[package]] @@ -1916,23 +2228,26 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" +checksum = "77b705829d1e87f762c2df6da140b26af5839e1033aa84aa5f56bb688e4e1bdb" dependencies = [ "instant", ] [[package]] name = "fc-consensus" -version = "0.1.0" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ + "async-trait", "derive_more", + "fc-db", "fp-consensus", - "futures 0.3.12", + "fp-rpc", + "futures 0.3.15", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sc-client-api", "sp-api", "sp-block-builder", @@ -1945,26 +2260,63 @@ dependencies = [ "substrate-prometheus-endpoint", ] +[[package]] +name = "fc-db" +version = "1.0.0" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" +dependencies = [ + "kvdb", + "kvdb-rocksdb", + "parity-scale-codec 2.1.1", + "parking_lot 0.11.1", + "sp-core", + "sp-database", + "sp-runtime", +] + +[[package]] +name = "fc-mapping-sync" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" +dependencies = [ + "fc-consensus", + "fc-db", + "fp-consensus", + "fp-rpc", + "futures 0.3.15", + "futures-timer 3.0.2", + "log", + "sc-client-api", + "sp-api", + "sp-blockchain", + "sp-runtime", +] + [[package]] name = "fc-rpc" -version = "0.1.0" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ "ethereum", "ethereum-types", + "evm", "fc-consensus", + "fc-db", "fc-rpc-core", + "fp-consensus", + "fp-evm", "fp-rpc", - "futures 0.3.12", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-pubsub", + "fp-storage", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 14.2.0", + "jsonrpc-derive 14.2.2", + "jsonrpc-pubsub 15.1.0", "libsecp256k1", "log", "pallet-ethereum", "pallet-evm", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "rand 0.7.3", "rlp", "rustc-hex", @@ -1983,14 +2335,14 @@ dependencies = [ [[package]] name = "fc-rpc-core" -version = "0.1.0" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "1.1.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ "ethereum-types", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-pubsub", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 14.2.0", + "jsonrpc-derive 14.2.2", + "jsonrpc-pubsub 15.1.0", "rustc-hex", "serde", "serde_json", @@ -2017,17 +2369,17 @@ dependencies = [ [[package]] name = "finality-grandpa" -version = "0.12.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8feb87a63249689640ac9c011742c33139204e3c134293d3054022276869133b" +checksum = "c6447e2f8178843749e8c8003206def83ec124a7859475395777a28b5338647c" dependencies = [ "either", - "futures 0.3.12", - "futures-timer 2.0.2", + "futures 0.3.15", + "futures-timer 3.0.2", "log", "num-traits", - "parity-scale-codec", - "parking_lot 0.9.0", + "parity-scale-codec 2.1.1", + "parking_lot 0.11.1", ] [[package]] @@ -2037,7 +2389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.2", + "rand 0.8.3", "rustc-hex", "static_assertions", ] @@ -2050,9 +2402,9 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" [[package]] name = "flate2" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129" +checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" dependencies = [ "cfg-if 1.0.0", "crc32fast", @@ -2069,17 +2421,17 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", ] [[package]] name = "form_urlencoded" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", "percent-encoding 2.1.0", @@ -2087,72 +2439,81 @@ dependencies = [ [[package]] name = "fp-consensus" -version = "0.1.0" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "1.0.0" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ - "parity-scale-codec", + "ethereum", + "parity-scale-codec 2.1.1", + "rlp", + "sha3 0.8.2", "sp-core", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "fp-evm" -version = "0.8.0" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "2.0.0" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ "evm", "impl-trait-for-tuples 0.1.3", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-core", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "fp-rpc" -version = "0.1.0" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "2.0.0" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ "ethereum", "ethereum-types", "fp-evm", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-api", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] +[[package]] +name = "fp-storage" +version = "1.0.1" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" + [[package]] name = "frame-benchmarking" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.1.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", "linregress", - "parity-scale-codec", + "log", + "parity-scale-codec 2.1.1", "paste", "sp-api", "sp-io", "sp-runtime", "sp-runtime-interface", - "sp-std", + "sp-std 3.0.0", "sp-storage", ] [[package]] name = "frame-benchmarking-cli" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "Inflector", "chrono", "frame-benchmarking", "handlebars", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sc-cli", "sc-client-db", "sc-executor", @@ -2166,45 +2527,57 @@ dependencies = [ "structopt", ] +[[package]] +name = "frame-election-provider-support" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 2.1.1", + "sp-arithmetic", + "sp-npos-elections", + "sp-std 3.0.0", +] + [[package]] name = "frame-executive" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", "sp-tracing", ] [[package]] name = "frame-metadata" -version = "12.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "13.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-core", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "frame-support" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "bitflags", "frame-metadata", "frame-support-procedural", - "impl-trait-for-tuples 0.2.0", + "impl-trait-for-tuples 0.2.1", "log", "once_cell", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "paste", "serde", "smallvec 1.6.1", @@ -2213,15 +2586,16 @@ dependencies = [ "sp-inherents", "sp-io", "sp-runtime", + "sp-staking", "sp-state-machine", - "sp-std", + "sp-std 3.0.0", "sp-tracing", ] [[package]] name = "frame-support-procedural" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2232,11 +2606,11 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -2244,8 +2618,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "proc-macro2", "quote", @@ -2254,61 +2628,66 @@ dependencies = [ [[package]] name = "frame-system" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", - "impl-trait-for-tuples 0.2.0", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "log", + "parity-scale-codec 2.1.1", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", "sp-version", ] [[package]] name = "frame-system-benchmarking" -version = "2.0.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c1c7102ca1f9f40220682dff62af93292db159e2457b1e439e882c11a4be646" +checksum = "e93602f58cdab9820b6d607b7b50834d9b878efa33405a65c89ebfb5a596b584" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-core", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-api", ] [[package]] name = "fs-swap" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5839fda247e24ca4919c87c71dd5ca658f1f39e4f06829f80e3f15c3bafcfc2c" +checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" dependencies = [ "lazy_static", "libc", - "libloading", + "libloading 0.5.2", "winapi 0.3.9", ] [[package]] -name = "fs_extra" -version = "1.2.0" +name = "fs2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi 0.3.9", +] [[package]] name = "fuchsia-cprng" @@ -2332,17 +2711,23 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + [[package]] name = "futures" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9052a1a50244d8d5aa9bf55cbc2fb6f357c86cc52e46c62ed390a7180cf150" +checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" dependencies = [ "futures-channel", "futures-core", @@ -2355,9 +2740,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" +checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" dependencies = [ "futures-core", "futures-sink", @@ -2365,9 +2750,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" +checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" [[package]] name = "futures-cpupool" @@ -2375,7 +2760,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "num_cpus", ] @@ -2385,21 +2770,21 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" dependencies = [ - "futures 0.1.30", - "futures 0.3.12", + "futures 0.1.31", + "futures 0.3.15", "lazy_static", "log", "parking_lot 0.9.0", - "pin-project 0.4.27", + "pin-project 0.4.28", "serde", "serde_json", ] [[package]] name = "futures-executor" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9" +checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" dependencies = [ "futures-core", "futures-task", @@ -2409,51 +2794,60 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28be053525281ad8259d47e4de5de657b25e7bac113458555bb4b70bc6870500" +checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" [[package]] name = "futures-lite" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ "fastrand", "futures-core", "futures-io", "memchr", "parking", - "pin-project-lite 0.2.4", + "pin-project-lite 0.2.6", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd" +checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" dependencies = [ + "autocfg", "proc-macro-hack", "proc-macro2", "quote", "syn", ] +[[package]] +name = "futures-rustls" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8b" +dependencies = [ + "futures-io", + "rustls 0.19.1", + "webpki", +] + [[package]] name = "futures-sink" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" +checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" [[package]] name = "futures-task" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" -dependencies = [ - "once_cell", -] +checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" [[package]] name = "futures-timer" @@ -2473,11 +2867,12 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" +checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" dependencies = [ - "futures 0.1.30", + "autocfg", + "futures 0.1.31", "futures-channel", "futures-core", "futures-io", @@ -2485,25 +2880,13 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.4", + "pin-project-lite 0.2.6", "pin-utils", "proc-macro-hack", "proc-macro-nested", "slab", ] -[[package]] -name = "futures_codec" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce54d63f8b0c75023ed920d46fd71d0cbbb830b0ee012726b5b4f506fb6dea5b" -dependencies = [ - "bytes 0.5.6", - "futures 0.3.12", - "memchr", - "pin-project 0.4.27", -] - [[package]] name = "gcc" version = "0.3.55" @@ -2512,18 +2895,18 @@ checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" [[package]] name = "generic-array" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ "typenum", ] [[package]] name = "generic-array" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed1e761351b56f54eb9dcd0cfaca9fd0daecf93918e1cfc01c8a3d26ee7adcd" +checksum = "f797e67af32588215eaaab8327027ee8e71b9dd0b2b26996aedf20c030fce309" dependencies = [ "typenum", ] @@ -2553,14 +2936,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if 1.0.0", "js-sys", "libc", - "wasi 0.10.1+wasi-snapshot-preview1", + "wasi 0.10.0+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -2576,9 +2959,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" dependencies = [ "fallible-iterator", "indexmap", @@ -2587,9 +2970,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" +checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" [[package]] name = "glob" @@ -2638,7 +3021,7 @@ dependencies = [ "byteorder", "bytes 0.4.12", "fnv", - "futures 0.1.30", + "futures 0.1.31", "http 0.1.21", "indexmap", "log", @@ -2658,10 +3041,10 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.3", + "http 0.2.4", "indexmap", "slab", - "tokio 0.2.24", + "tokio 0.2.25", "tokio-util", "tracing", "tracing-futures", @@ -2675,14 +3058,14 @@ checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" [[package]] name = "handlebars" -version = "3.5.2" +version = "3.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "964d0e99a61fe9b1b347389b77ebf8b7e1587b70293676aaca7d27e59b9073b2" +checksum = "4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3" dependencies = [ "log", "pest", "pest_derive", - "quick-error 2.0.0", + "quick-error 2.0.1", "serde", "serde_json", ] @@ -2713,9 +3096,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] @@ -2737,9 +3120,12 @@ checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" [[package]] name = "hex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-literal" @@ -2780,10 +3166,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b" dependencies = [ "digest 0.8.1", - "generic-array 0.12.3", + "generic-array 0.12.4", "hmac 0.7.1", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi 0.3.9", +] + [[package]] name = "http" version = "0.1.21" @@ -2797,9 +3194,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ "bytes 1.0.1", "fnv", @@ -2813,7 +3210,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "http 0.1.21", "tokio-buf", ] @@ -2825,14 +3222,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http 0.2.3", + "http 0.2.4", ] [[package]] name = "httparse" -version = "1.3.4" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" [[package]] name = "httpdate" @@ -2851,12 +3248,12 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.35" +version = "0.12.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "futures-cpupool", "h2 0.1.26", "http 0.1.21", @@ -2866,7 +3263,7 @@ dependencies = [ "itoa", "log", "net2", - "rustc_version", + "rustc_version 0.2.3", "time", "tokio 0.1.22", "tokio-buf", @@ -2881,23 +3278,23 @@ dependencies = [ [[package]] name = "hyper" -version = "0.13.9" +version = "0.13.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" +checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" dependencies = [ "bytes 0.5.6", "futures-channel", "futures-core", "futures-util", "h2 0.2.7", - "http 0.2.3", + "http 0.2.4", "http-body 0.3.1", "httparse", "httpdate", "itoa", - "pin-project 1.0.4", - "socket2", - "tokio 0.2.24", + "pin-project 1.0.7", + "socket2 0.3.19", + "tokio 0.2.25", "tower-service", "tracing", "want 0.3.0", @@ -2912,11 +3309,11 @@ dependencies = [ "bytes 0.5.6", "ct-logs", "futures-util", - "hyper 0.13.9", + "hyper 0.13.10", "log", "rustls 0.18.1", "rustls-native-certs", - "tokio 0.2.24", + "tokio 0.2.25", "tokio-rustls", "webpki", ] @@ -2934,9 +3331,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", @@ -2966,12 +3363,12 @@ dependencies = [ [[package]] name = "if-watch" -version = "0.1.7" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d7c5e361e6b05c882b4847dd98992534cebc6fcde7f4bc98225bcf10fd6d0d" +checksum = "ae8ab7f67bad3240049cb24fb9cb0b4c2c6af4c245840917fbbdededeee91179" dependencies = [ "async-io", - "futures 0.3.12", + "futures 0.3.15", "futures-lite", "if-addrs", "ipnet", @@ -2982,11 +3379,11 @@ dependencies = [ [[package]] name = "impl-codec" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" +checksum = "df170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877ed" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", ] [[package]] @@ -3020,9 +3417,9 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f65a8ecf74feeacdab8d38cb129e550ca871cccaa7d1921d8636ecd75534903" +checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" dependencies = [ "proc-macro2", "quote", @@ -3031,9 +3428,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.1" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" +checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" dependencies = [ "autocfg", "hashbrown", @@ -3067,7 +3464,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "futures-timer 2.0.2", ] @@ -3086,6 +3483,18 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ee15951c035f79eddbef745611ec962f63f4558f1dadf98ab723cc603487c6f" +[[package]] +name = "ipconfig" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" +dependencies = [ + "socket2 0.3.19", + "widestring", + "winapi 0.3.9", + "winreg", +] + [[package]] name = "ipnet" version = "2.3.0" @@ -3094,18 +3503,18 @@ checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" [[package]] name = "itertools" -version = "0.8.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" dependencies = [ "either", ] [[package]] name = "itertools" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" dependencies = [ "either", ] @@ -3118,22 +3527,38 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jobserver" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" +checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.46" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175" +checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpc-client-transports" +version = "14.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2773fa94a2a1fd51efb89a8f45b8861023dbb415d18d3c9235ae9388d780f9ec" +dependencies = [ + "failure", + "futures 0.1.31", + "jsonrpc-core 14.2.0", + "jsonrpc-pubsub 14.2.0", + "log", + "serde", + "serde_json", + "url 1.7.2", +] + [[package]] name = "jsonrpc-client-transports" version = "15.1.0" @@ -3141,36 +3566,70 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "489b9c612e60c766f751ab40fcb43cbb55a1e10bb44a9b4307ed510ca598cbd7" dependencies = [ "failure", - "futures 0.1.30", - "hyper 0.12.35", - "jsonrpc-core", - "jsonrpc-pubsub", + "futures 0.1.31", + "hyper 0.12.36", + "jsonrpc-core 15.1.0", + "jsonrpc-pubsub 15.1.0", "log", "serde", "serde_json", "url 1.7.2", ] +[[package]] +name = "jsonrpc-core" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62" +dependencies = [ + "futures 0.1.31", + "log", + "serde", + "serde_derive", + "serde_json", +] + [[package]] name = "jsonrpc-core" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0745a6379e3edc893c84ec203589790774e4247420033e71a76d3ab4687991fa" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "log", "serde", "serde_derive", "serde_json", ] +[[package]] +name = "jsonrpc-core-client" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713" +dependencies = [ + "jsonrpc-client-transports 14.2.1", +] + [[package]] name = "jsonrpc-core-client" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f764902d7b891344a0acb65625f32f6f7c6db006952143bd650209fbe7d94db" dependencies = [ - "jsonrpc-client-transports", + "jsonrpc-client-transports 15.1.0", +] + +[[package]] +name = "jsonrpc-derive" +version = "14.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0e77e8812f02155b85a677a96e1d16b60181950c0636199bc4528524fba98dc" +dependencies = [ + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3179,7 +3638,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99a847f9ec7bb52149b2786a17c9cb260d6effc6b8eeb8c16b343a487a7563a3" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -3191,8 +3650,8 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb5c4513b7b542f42da107942b7b759f27120b5cc894729f88254b28dff44b7" dependencies = [ - "hyper 0.12.35", - "jsonrpc-core", + "hyper 0.12.36", + "jsonrpc-core 15.1.0", "jsonrpc-server-utils", "log", "net2", @@ -3206,7 +3665,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf50e53e4eea8f421a7316c5f63e395f7bc7c4e786a6dc54d76fab6ff7aa7ce7" dependencies = [ - "jsonrpc-core", + "jsonrpc-core 15.1.0", "jsonrpc-server-utils", "log", "parity-tokio-ipc", @@ -3214,13 +3673,26 @@ dependencies = [ "tokio-service", ] +[[package]] +name = "jsonrpc-pubsub" +version = "14.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986" +dependencies = [ + "jsonrpc-core 14.2.0", + "log", + "parking_lot 0.10.2", + "rand 0.7.3", + "serde", +] + [[package]] name = "jsonrpc-pubsub" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "639558e0604013be9787ae52f798506ae42bf4220fe587bdc5625871cc8b9c77" dependencies = [ - "jsonrpc-core", + "jsonrpc-core 15.1.0", "log", "parking_lot 0.10.2", "rand 0.7.3", @@ -3235,7 +3707,7 @@ checksum = "72f1f3990650c033bd8f6bd46deac76d990f9bbfb5f8dc8c4767bf0a00392176" dependencies = [ "bytes 0.4.12", "globset", - "jsonrpc-core", + "jsonrpc-core 15.1.0", "lazy_static", "log", "tokio 0.1.22", @@ -3249,7 +3721,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6596fe75209b73a2a75ebe1dce4e60e03b88a2b25e8807b667597f6315150d22" dependencies = [ - "jsonrpc-core", + "jsonrpc-core 15.1.0", "jsonrpc-server-utils", "log", "parity-ws", @@ -3284,9 +3756,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92312348daade49976a6dc59263ad39ed54f840aacb5664874f7c9aa16e5f848" +checksum = "8891bd853eff90e33024195d79d578dc984c82f9e0715fcd2b525a0c19d52811" dependencies = [ "parity-util-mem", "smallvec 1.6.1", @@ -3294,9 +3766,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "986052a8d16c692eaebe775391f9a3ac26714f3907132658500b601dec94c8c2" +checksum = "30a0da8e08caf08d384a620ec19bb6c9b85c84137248e202617fb91881f25912" dependencies = [ "kvdb", "parity-util-mem", @@ -3305,9 +3777,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d92c36be64baba5ea549116ff0d7ffd445456a7be8aaee21ec05882b980cd11" +checksum = "94b27cdb788bf1c8ade782289f9dbee626940be2961fd75c7cde993fa2f1ded1" dependencies = [ "fs-swap", "kvdb", @@ -3323,11 +3795,11 @@ dependencies = [ [[package]] name = "kvdb-web" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7bfe11b3202691673766b1224c432996f6b8047db17ceb743675bef3404e714" +checksum = "eb1e98ba343d0b35f9009a8844cd2b87fa3192f7e79033ac05b00aeae0f3b0b5" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "js-sys", "kvdb", "kvdb-memorydb", @@ -3344,6 +3816,9 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] [[package]] name = "lazycell" @@ -3359,9 +3834,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "libc" -version = "0.2.82" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" +checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" [[package]] name = "libloading" @@ -3373,6 +3848,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "libloading" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +dependencies = [ + "cfg-if 1.0.0", + "winapi 0.3.9", +] + [[package]] name = "libm" version = "0.2.1" @@ -3381,16 +3866,15 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.33.0" +version = "0.37.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e17c636b5fe5ff900ccc2840b643074bfac321551d821243a781d0d46f06588" +checksum = "08053fbef67cd777049ef7a95ebaca2ece370b4ed7712c3fa404d69a88cb741b" dependencies = [ "atomic", - "bytes 0.5.6", - "futures 0.3.12", + "bytes 1.0.1", + "futures 0.3.15", "lazy_static", "libp2p-core", - "libp2p-core-derive", "libp2p-deflate", "libp2p-dns", "libp2p-floodsub", @@ -3403,8 +3887,10 @@ dependencies = [ "libp2p-ping", "libp2p-plaintext", "libp2p-pnet", + "libp2p-relay", "libp2p-request-response", "libp2p-swarm", + "libp2p-swarm-derive", "libp2p-tcp", "libp2p-uds", "libp2p-wasm-ext", @@ -3412,23 +3898,23 @@ dependencies = [ "libp2p-yamux", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.4", + "pin-project 1.0.7", "smallvec 1.6.1", "wasm-timer", ] [[package]] name = "libp2p-core" -version = "0.26.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cb706da14c064dce54d8864ade6836b3486b51689300da74eeb7053aa4551e" +checksum = "554d3e7e9e65f939d66b75fd6a4c67f258fe250da61b91f46c545fc4a89b51d9" dependencies = [ "asn1_der", "bs58", "ed25519-dalek", "either", "fnv", - "futures 0.3.12", + "futures 0.3.15", "futures-timer 3.0.2", "lazy_static", "libsecp256k1", @@ -3437,61 +3923,54 @@ dependencies = [ "multistream-select", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.4", + "pin-project 1.0.7", "prost", "prost-build", "rand 0.7.3", "ring", "rw-stream-sink", - "sha2 0.9.2", + "sha2 0.9.5", "smallvec 1.6.1", "thiserror", - "unsigned-varint", + "unsigned-varint 0.7.0", "void", "zeroize", ] -[[package]] -name = "libp2p-core-derive" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4bc40943156e42138d22ed3c57ff0e1a147237742715937622a99b10fbe0156" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "libp2p-deflate" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3257a41f376aa23f237231971fee7e350e4d8353cfcf233aef34d6d6b638f0c" +checksum = "a2181a641cd15f9b6ba71b1335800f309012a0a97a29ffaabbbf40e9d3d58f08" dependencies = [ "flate2", - "futures 0.3.12", + "futures 0.3.15", "libp2p-core", ] [[package]] name = "libp2p-dns" -version = "0.26.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e09bab25af01326b4ed9486d31325911437448edda30bc57681502542d49f20" +checksum = "62e63dab8b5ff35e0c101a3e51e843ba782c07bbb1682f5fd827622e0d02b98b" dependencies = [ - "futures 0.3.12", + "async-std-resolver", + "futures 0.3.15", "libp2p-core", "log", + "smallvec 1.6.1", + "trust-dns-resolver", ] [[package]] name = "libp2p-floodsub" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd8cdd5ef1dd0b7346975477216d752de976b92e43051bc8bd808c372ea6cec" +checksum = "48a9b570f6766301d9c4aa00fce3554cad1598e2f466debbc4dde909028417cf" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.12", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", @@ -3503,37 +3982,37 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.26.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d489531aa9d4ba8726a08b3b74e21c2e10a518ad266ebca98d79040123ab0036" +checksum = "e7b0c8506a6ec3344b9e706d7c7a6dba826f8ede735cfe13dde12a8c263c4af9" dependencies = [ + "asynchronous-codec 0.6.0", "base64 0.13.0", "byteorder", - "bytes 0.5.6", + "bytes 1.0.1", "fnv", - "futures 0.3.12", - "futures_codec", + "futures 0.3.15", "hex_fmt", "libp2p-core", "libp2p-swarm", "log", - "lru_time_cache", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.2", + "regex", + "sha2 0.9.5", "smallvec 1.6.1", - "unsigned-varint", + "unsigned-varint 0.7.0", "wasm-timer", ] [[package]] name = "libp2p-identify" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43bc51a9bc3780288c526615ba0f5f8216820ea6dcc02b89e8daee526c5fccb" +checksum = "5f668f00efd9883e8b7bcc582eaf0164615792608f886f6577da18bcbeea0a46" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", @@ -3545,85 +4024,85 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.27.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe68563ee33f3848293919afd61470ebcdea4e757a36cc2c33a5508abec2216" +checksum = "b07312ebe5ee4fd2404447a0609814574df55c65d4e20838b957bbd34907d820" dependencies = [ "arrayvec 0.5.2", - "bytes 0.5.6", + "asynchronous-codec 0.6.0", + "bytes 1.0.1", "either", "fnv", - "futures 0.3.12", - "futures_codec", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.2", + "sha2 0.9.5", "smallvec 1.6.1", - "uint 0.8.5", - "unsigned-varint", + "uint", + "unsigned-varint 0.7.0", "void", "wasm-timer", ] [[package]] name = "libp2p-mdns" -version = "0.27.0" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9e12688e8f14008c950c1efde587cb44dbf316fa805f419cd4e524991236f5" +checksum = "4efa70c1c3d2d91237f8546e27aeb85e287d62c066a7b4f3ea6a696d43ced714" dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.12", + "futures 0.3.15", "if-watch", "lazy_static", "libp2p-core", "libp2p-swarm", "log", - "rand 0.7.3", + "rand 0.8.3", "smallvec 1.6.1", - "socket2", + "socket2 0.4.0", "void", ] [[package]] name = "libp2p-mplex" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3200fbe6608e623bd9efa459cc8bafa0e4efbb0a2dfcdd0e1387ff4181264b" +checksum = "85e9b544335d1ed30af71daa96edbefadef6f19c7a55f078b9fc92c87163105d" dependencies = [ - "bytes 0.5.6", - "futures 0.3.12", - "futures_codec", + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "futures 0.3.15", "libp2p-core", "log", "nohash-hasher", "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", - "unsigned-varint", + "unsigned-varint 0.7.0", ] [[package]] name = "libp2p-noise" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0580e0d18019d254c9c349c03ff7b22e564b6f2ada70c045fc39738e144f2139" +checksum = "36db0f0db3b0433f5b9463f1c0cd9eadc0a3734a9170439ce501ff99733a88bd" dependencies = [ - "bytes 0.5.6", - "curve25519-dalek 3.0.2", - "futures 0.3.12", + "bytes 1.0.1", + "curve25519-dalek 3.1.0", + "futures 0.3.15", "lazy_static", "libp2p-core", "log", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.2", + "sha2 0.9.5", "snow", "static_assertions", "x25519-dalek", @@ -3632,11 +4111,11 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b2ec86a18cbf09d7df440e7786a2409640c774e476e9a3b4d031382c3d7588" +checksum = "bf4bfaffac63bf3c7ec11ed9d8879d455966ddea7e78ee14737f0b6dce0d1cd1" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", @@ -3647,18 +4126,18 @@ dependencies = [ [[package]] name = "libp2p-plaintext" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7b1bdcbe46a3a2159c231601ed29645282653c0a96ce3a2ad8352c9fbe6800" +checksum = "0c8c37b4d2a075b4be8442760a5f8c037180f0c8dd5b5734b9978ab868b3aa11" dependencies = [ - "bytes 0.5.6", - "futures 0.3.12", - "futures_codec", + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "futures 0.3.15", "libp2p-core", "log", "prost", "prost-build", - "unsigned-varint", + "unsigned-varint 0.7.0", "void", ] @@ -3668,23 +4147,46 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "log", - "pin-project 1.0.4", + "pin-project 1.0.7", "rand 0.7.3", "salsa20", "sha3 0.9.1", ] +[[package]] +name = "libp2p-relay" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8786aca3f18671d8776289706a5521f6c9124a820f69e358de214b9939440d" +dependencies = [ + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "futures 0.3.15", + "futures-timer 3.0.2", + "libp2p-core", + "libp2p-swarm", + "log", + "pin-project 1.0.7", + "prost", + "prost-build", + "rand 0.7.3", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", + "void", + "wasm-timer", +] + [[package]] name = "libp2p-request-response" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620e2950decbf77554b5aed3824f7d0e2c04923f28c70f9bff1a402c47ef6b1e" +checksum = "1cdbe172f08e6d0f95fa8634e273d4c4268c4063de2e33e7435194b0130c62e3" dependencies = [ "async-trait", - "bytes 0.5.6", - "futures 0.3.12", + "bytes 1.0.1", + "futures 0.3.15", "libp2p-core", "libp2p-swarm", "log", @@ -3692,18 +4194,18 @@ dependencies = [ "minicbor", "rand 0.7.3", "smallvec 1.6.1", - "unsigned-varint", + "unsigned-varint 0.7.0", "wasm-timer", ] [[package]] name = "libp2p-swarm" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf5894ee1ee63a38aa58d58a16e3dcf7ede6b59ea7b22302c00c1a41d7aec41" +checksum = "1e04d8e1eef675029ec728ba14e8d0da7975d84b6679b699b4ae91a1de9c3a92" dependencies = [ "either", - "futures 0.3.12", + "futures 0.3.15", "libp2p-core", "log", "rand 0.7.3", @@ -3712,41 +4214,52 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "libp2p-swarm-derive" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "365b0a699fea5168676840567582a012ea297b1ca02eee467e58301b9c9c5eed" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "libp2p-tcp" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2113a7dab2b502c55fe290910cd7399a2aa04fe70a2f5a415a87a1db600c0e" +checksum = "2b1a27d21c477951799e99d5c105d78868258502ce092988040a808d5a19bbd9" dependencies = [ - "async-std", - "futures 0.3.12", + "async-io", + "futures 0.3.15", "futures-timer 3.0.2", - "if-addrs", + "if-watch", "ipnet", + "libc", "libp2p-core", "log", - "socket2", + "socket2 0.4.0", ] [[package]] name = "libp2p-uds" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af05fe92c2a3aa320bc82a308ddb7b33bef3b060154c5a4b9fb0b01f15385fc0" +checksum = "ffd6564bb3b7ff203661ccbb69003c2b551e34cef974f2d6c6a28306a12170b5" dependencies = [ "async-std", - "futures 0.3.12", + "futures 0.3.15", "libp2p-core", "log", ] [[package]] name = "libp2p-wasm-ext" -version = "0.26.0" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37cd44ea05a4523f40183f60ab6e6a80e400a5ddfc98b0df1c55edeb85576cd9" +checksum = "e2d413e4cf9b8e5dfbcd2a60d3dc5a3391308bdb463684093d4f67137b7113de" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -3756,31 +4269,29 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "270c80528e21089ea25b41dd1ab8fd834bdf093ebee422fed3b68699a857a083" +checksum = "cace60995ef6f637e4752cccbb2590f6bc358e8741a0d066307636c69a4b3a74" dependencies = [ - "async-tls", "either", - "futures 0.3.12", + "futures 0.3.15", + "futures-rustls", "libp2p-core", "log", "quicksink", - "rustls 0.19.0", "rw-stream-sink", "soketto", - "url 2.2.0", - "webpki", + "url 2.2.2", "webpki-roots", ] [[package]] name = "libp2p-yamux" -version = "0.29.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36799de9092c35782f080032eddbc8de870f94a0def87cf9f8883efccd5cacf0" +checksum = "f35da42cfc6d5cb0dcf3ad6881bc68d146cdf38f98655e09e33fbba4d13eabc4" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "libp2p-core", "parking_lot 0.11.1", "thiserror", @@ -3789,9 +4300,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "6.11.4" +version = "6.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b56f651c204634b936be2f92dbb42c36867e00ff7fe2405591f3b9fa66f09" +checksum = "5da125e1c0f22c7cae785982115523a0738728498547f415c9054cb17c7e89f9" dependencies = [ "bindgen", "cc", @@ -3817,9 +4328,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" dependencies = [ "cc", "pkg-config", @@ -3843,11 +4354,11 @@ dependencies = [ [[package]] name = "linregress" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0ad4b5cc8385a881c561fac3501353d63d2a2b7a357b5064d71815c9a92724" +checksum = "b36162d2e1dcbdeb61223cb788f029f8ac9f2ab19969b89c5a8f4517aad4d940" dependencies = [ - "nalgebra", + "nalgebra 0.25.4", "statrs", ] @@ -3862,36 +4373,40 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" dependencies = [ "scopeguard", ] [[package]] name = "log" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf3805d4480bb5b86070dcfeb9e2cb2ebc148adb753c5cca5f884d1d65a42b2" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", + "value-bag", ] [[package]] name = "lru" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3aae342b73d57ad0b8b364bd12584819f2c1fe9114285dfcf8b0722607671635" +checksum = "1f374d42cdfc1d7dbf3d3dec28afab2eb97ffbf43a3234d795b5986dbf4b90ba" dependencies = [ "hashbrown", ] [[package]] -name = "lru_time_cache" -version = "0.11.5" +name = "lru-cache" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f957950068c53af3b32a1b3a6e69f6dd3c19fa6f0dcc1168b846662d5e10b1" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] [[package]] name = "mach" @@ -3908,6 +4423,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + [[package]] name = "matchers" version = "0.0.1" @@ -3932,6 +4453,15 @@ dependencies = [ "rawpointer", ] +[[package]] +name = "matrixmultiply" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a8a15b776d9dfaecd44b03c5828c2199cddff5247215858aac14624f8d6b741" +dependencies = [ + "rawpointer", +] + [[package]] name = "maybe-uninit" version = "2.0.0" @@ -3940,18 +4470,17 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" [[package]] -name = "memmap" -version = "0.7.0" +name = "memmap2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" dependencies = [ "libc", - "winapi 0.3.9", ] [[package]] @@ -3965,18 +4494,18 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" +checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" dependencies = [ "autocfg", ] [[package]] name = "memory-db" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbd2a22f201c03cc1706a727842490abfea17b7b53260358239828208daba3c" +checksum = "814bbecfc0451fc314eeea34f05bbcd5b98a7ad7af37faee088b86a1e633f1d4" dependencies = [ "hash-db", "hashbrown", @@ -4003,18 +4532,18 @@ dependencies = [ [[package]] name = "minicbor" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3265a9f5210bb726f81ef9c456ae0aff5321cd95748c0e71889b0e19d8f0332b" +checksum = "51aa5bb0ca22415daca596a227b507f880ad1b2318a87fa9325312a5d285ca0d" dependencies = [ "minicbor-derive", ] [[package]] name = "minicbor-derive" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130b9455e28a3f308f6579671816a6f2621e2e0cbf55dc2f886345bef699481e" +checksum = "7f2b9e8883d58e34b18facd16c4564a77ea50fce028ad3d0ee6753440e37acc8" dependencies = [ "proc-macro2", "quote", @@ -4023,9 +4552,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", "autocfg", @@ -4070,7 +4599,7 @@ checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" dependencies = [ "log", "mio", - "miow 0.3.6", + "miow 0.3.7", "winapi 0.3.9", ] @@ -4099,40 +4628,78 @@ dependencies = [ [[package]] name = "miow" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "socket2", "winapi 0.3.9", ] +[[package]] +name = "module-nft" +version = "1.0.0" +dependencies = [ + "edgeware-primitives", + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "orml-nft", + "pallet-balances", + "pallet-proxy", + "pallet-utility", + "parity-scale-codec 2.1.1", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", + "webb-currencies", + "webb-tokens", + "webb-traits", +] + [[package]] name = "more-asserts" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +[[package]] +name = "multibase" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + [[package]] name = "multihash" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab" dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", "digest 0.9.0", "generic-array 0.14.4", "multihash-derive", - "sha2 0.9.2", - "unsigned-varint", + "sha2 0.9.5", + "sha3 0.9.1", + "unsigned-varint 0.5.1", ] [[package]] name = "multihash-derive" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ee3c48cb9d9b275ad967a0e96715badc13c6029adb92f34fa17b9ff28fd81f" +checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro-error", "proc-macro2", "quote", @@ -4142,59 +4709,66 @@ dependencies = [ [[package]] name = "multimap" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multistream-select" -version = "0.9.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda822043bba2d6da31c4e14041f9794f8fb130a5959289038d0b809d8888614" +checksum = "7d91ec0a2440aaff5f78ec35631a7027d50386c6163aa975f7caa0d5da4b6ff8" dependencies = [ - "bytes 0.5.6", - "futures 0.3.12", + "bytes 1.0.1", + "futures 0.3.15", "log", - "pin-project 1.0.4", + "pin-project 1.0.7", "smallvec 1.6.1", - "unsigned-varint", + "unsigned-varint 0.7.0", ] [[package]] name = "nalgebra" -version = "0.21.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b6147c3d50b4f3cdabfe2ecc94a0191fd3d6ad58aefd9664cf396285883486" +checksum = "0abb021006c01b126a936a8dd1351e0720d83995f4fc942d0d426c654f990745" dependencies = [ - "approx", - "generic-array 0.13.2", - "matrixmultiply", + "alga", + "approx 0.3.2", + "generic-array 0.13.3", + "matrixmultiply 0.2.4", "num-complex 0.2.4", "num-rational 0.2.4", "num-traits", "rand 0.7.3", "rand_distr", - "simba", "typenum", ] [[package]] -name = "names" -version = "0.11.0" +name = "nalgebra" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2da" +checksum = "c70c9e8c5f213c8e93fc8c112ade4edd3ee62062fb897776c23dcebac7932900" dependencies = [ - "rand 0.3.23", + "approx 0.4.0", + "generic-array 0.14.4", + "matrixmultiply 0.3.1", + "num-complex 0.3.1", + "num-rational 0.3.2", + "num-traits", + "serde", + "simba", + "typenum", ] [[package]] -name = "nb-connect" -version = "1.0.2" +name = "names" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8123a81538e457d44b933a02faf885d3fe8408806b23fa700e8f01c6c3a98998" +checksum = "ef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2da" dependencies = [ - "libc", - "winapi 0.3.9", + "rand 0.3.23", ] [[package]] @@ -4249,7 +4823,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f" dependencies = [ - "num-bigint 0.3.1", + "num-bigint 0.3.2", "num-complex 0.3.1", "num-integer", "num-iter", @@ -4270,9 +4844,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a41747ae4633fce5adffb4d2e81ffc5e89593cb19917f8fb2cc5ff76507bf" +checksum = "7d0a3d5e207573f948a9e5376662aa743a2ea13f7c50a554d7af443a73fbfeba" dependencies = [ "autocfg", "num-integer", @@ -4338,7 +4912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" dependencies = [ "autocfg", - "num-bigint 0.3.1", + "num-bigint 0.3.2", "num-integer", "num-traits", ] @@ -4365,32 +4939,28 @@ dependencies = [ [[package]] name = "object" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" - -[[package]] -name = "object" -version = "0.20.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" dependencies = [ "crc32fast", "indexmap", - "wasmparser 0.57.0", ] [[package]] name = "object" -version = "0.23.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" +checksum = "9023c1c0973b327f073c7f2fceb9bcc049862f93a7d14c6feb46c8a56460a0d5" +dependencies = [ + "memchr", +] [[package]] name = "once_cell" -version = "1.5.2" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" dependencies = [ "parking_lot 0.11.1", ] @@ -4415,9 +4985,23 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" + +[[package]] +name = "orml-nft" +version = "0.4.1-dev" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 2.1.1", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", +] [[package]] name = "output_vt100" @@ -4437,136 +5021,147 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "pallet-assets" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 2.1.1", + "sp-runtime", + "sp-std 3.0.0", +] + [[package]] name = "pallet-aura" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", "pallet-session", "pallet-timestamp", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-application-crypto", "sp-consensus-aura", - "sp-inherents", "sp-runtime", - "sp-std", - "sp-timestamp", + "sp-std 3.0.0", ] [[package]] name = "pallet-authority-discovery" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", "pallet-session", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-authorship" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples 0.2.0", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.1", "sp-authorship", - "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-balances" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "log", + "parity-scale-codec 2.1.1", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-bounties" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", "pallet-treasury", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-collective" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "log", + "parity-scale-codec 2.1.1", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-contracts" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", + "log", "pallet-contracts-primitives", "pallet-contracts-proc-macro", - "parity-scale-codec", - "parity-wasm 0.41.0", - "pwasm-utils 0.16.0", + "parity-scale-codec 2.1.1", + "parity-wasm 0.42.2", + "pwasm-utils 0.17.1", "serde", + "smallvec 1.6.1", "sp-core", "sp-io", "sp-runtime", "sp-sandbox", - "sp-std", - "wasmi-validation", + "sp-std 3.0.0", + "wasmi-validation 0.4.0", ] [[package]] name = "pallet-contracts-primitives" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "bitflags", - "parity-scale-codec", + "parity-scale-codec 2.1.1", + "serde", + "sp-core", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-contracts-proc-macro" -version = "0.1.0" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "proc-macro2", "quote", @@ -4575,15 +5170,15 @@ dependencies = [ [[package]] name = "pallet-contracts-rpc" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 15.1.0", + "jsonrpc-derive 15.1.0", "pallet-contracts-primitives", "pallet-contracts-rpc-runtime-api", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-api", "sp-blockchain", @@ -4594,49 +5189,87 @@ dependencies = [ [[package]] name = "pallet-contracts-rpc-runtime-api" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "pallet-contracts-primitives", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-api", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-democracy" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.1", + "serde", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", +] + +[[package]] +name = "pallet-dynamic-fee" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" +dependencies = [ + "async-trait", + "frame-support", + "frame-system", + "pallet-evm", + "parity-scale-codec 2.1.1", "serde", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std 3.0.0", +] + +[[package]] +name = "pallet-election-provider-multi-phase" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" +dependencies = [ + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 2.1.1", + "sp-arithmetic", + "sp-core", "sp-io", + "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 3.0.0", + "static_assertions", ] [[package]] name = "pallet-elections-phragmen" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "4.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "log", + "parity-scale-codec 2.1.1", + "sp-core", + "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-ethereum" -version = "0.1.0" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ "ethereum", "ethereum-types", @@ -4644,26 +5277,27 @@ dependencies = [ "fp-consensus", "fp-evm", "fp-rpc", + "fp-storage", "frame-support", "frame-system", "libsecp256k1", "pallet-balances", "pallet-evm", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "rlp", "rustc-hex", "serde", "sha3 0.8.2", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-evm" -version = "2.0.1" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "4.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ "evm", "evm-gasometer", @@ -4671,9 +5305,10 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", + "log", "pallet-balances", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "primitive-types", "rlp", "serde", @@ -4681,13 +5316,64 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", +] + +[[package]] +name = "pallet-evm-precompile-blake2" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" +dependencies = [ + "evm", + "fp-evm", + "sp-core", + "sp-io", +] + +[[package]] +name = "pallet-evm-precompile-bn128" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" +dependencies = [ + "evm", + "fp-evm", + "sp-core", + "sp-io", + "substrate-bn", +] + +[[package]] +name = "pallet-evm-precompile-curve25519" +version = "1.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" +dependencies = [ + "curve25519-dalek 3.1.0", + "evm", + "fp-evm", + "frame-support", + "parity-scale-codec 2.1.1", + "sp-core", + "sp-io", +] + +[[package]] +name = "pallet-evm-precompile-dispatch" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" +dependencies = [ + "evm", + "fp-evm", + "frame-support", + "pallet-evm", + "parity-scale-codec 2.1.1", + "sp-core", + "sp-io", ] [[package]] name = "pallet-evm-precompile-ed25519" -version = "2.0.1" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ "ed25519-dalek", "evm", @@ -4698,8 +5384,8 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" -version = "2.0.1" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ "evm", "fp-evm", @@ -4708,10 +5394,22 @@ dependencies = [ "sp-io", ] +[[package]] +name = "pallet-evm-precompile-sha3fips" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" +dependencies = [ + "evm", + "fp-evm", + "sp-core", + "sp-io", + "tiny-keccak", +] + [[package]] name = "pallet-evm-precompile-simple" -version = "2.0.1" -source = "git+https://github.com/hicommonwealth/frontier.git?rev=d3179acb5a111d58af6c48a12588ecd38750a9bb#d3179acb5a111d58af6c48a12588ecd38750a9bb" +version = "2.0.0-dev" +source = "git+https://github.com/webb-tools/frontier.git?branch=erup-4-minimal-changes#dede92a2f078a85994bef88d6ea4df1ea2fadd51" dependencies = [ "evm", "fp-evm", @@ -4722,210 +5420,272 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "pallet-authorship", "pallet-session", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-application-crypto", "sp-core", "sp-finality-grandpa", "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-identity" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "enumflags2", "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-im-online" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", + "log", "pallet-authorship", - "pallet-session", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-application-crypto", "sp-core", "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-indices" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-core", "sp-io", "sp-keyring", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] -name = "pallet-multisig" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +name = "pallet-merkle" +version = "3.0.0" +source = "git+https://github.com/webb-tools/anon?branch=erup-4#f493dd9dd6385e584346fb210c674ea5f5578aad" +dependencies = [ + "bulletproofs-gadgets", + "curve25519-dalek 3.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "lazy_static", + "merlin", + "pallet-balances", + "parity-scale-codec 2.1.1", + "rand_core 0.5.1", + "serde", + "sha2 0.9.5", + "sp-api", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", + "webb-bulletproofs", +] + +[[package]] +name = "pallet-merkle-rpc" +version = "3.0.0" +source = "git+https://github.com/webb-tools/anon?branch=erup-4#f493dd9dd6385e584346fb210c674ea5f5578aad" +dependencies = [ + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 15.1.0", + "jsonrpc-derive 15.1.0", + "pallet-merkle", + "parity-scale-codec 2.1.1", + "sc-rpc", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "pallet-mixer" +version = "3.0.0" +source = "git+https://github.com/webb-tools/anon?branch=erup-4#f493dd9dd6385e584346fb210c674ea5f5578aad" dependencies = [ + "bencher", + "bulletproofs-gadgets", + "curve25519-dalek 3.1.0", + "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "log", + "merlin", + "pallet-balances", + "pallet-merkle", + "parity-scale-codec 2.1.1", "serde", + "sp-runtime", + "sp-std 3.0.0", + "webb-bulletproofs", + "webb-currencies", + "webb-tokens", + "webb-traits", +] + +[[package]] +name = "pallet-multisig" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 2.1.1", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-offences" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", + "log", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-proxy" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-randomness-collective-flip" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "safe-mix", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-recovery" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "enumflags2", "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-scheduler" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "log", + "parity-scale-codec 2.1.1", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-session" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples 0.1.3", + "impl-trait-for-tuples 0.2.1", "pallet-timestamp", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-core", "sp-io", "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 3.0.0", "sp-trie", ] [[package]] name = "pallet-staking" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ + "frame-election-provider-support", "frame-support", "frame-system", + "log", "pallet-authorship", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 2.1.1", + "paste", "serde", "sp-application-crypto", "sp-io", - "sp-npos-elections", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 3.0.0", "static_assertions", ] [[package]] name = "pallet-staking-reward-curve" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -4933,77 +5693,74 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-timestamp" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "impl-trait-for-tuples 0.2.0", - "parity-scale-codec", - "serde", + "impl-trait-for-tuples 0.2.1", + "log", + "parity-scale-codec 2.1.1", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0", "sp-timestamp", ] [[package]] name = "pallet-tips" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-transaction-payment" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "smallvec 1.6.1", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-transaction-payment-rpc" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 15.1.0", + "jsonrpc-derive 15.1.0", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-api", "sp-blockchain", "sp-core", @@ -5013,80 +5770,79 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "frame-support", - "parity-scale-codec", - "serde", + "pallet-transaction-payment", + "parity-scale-codec 2.1.1", "sp-api", "sp-runtime", - "sp-std", ] [[package]] name = "pallet-treasury" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples 0.2.0", + "impl-trait-for-tuples 0.2.1", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-utility" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "pallet-vesting" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "enumflags2", "frame-support", "frame-system", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.1.1", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "parity-db" -version = "0.1.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00d595e372d119261593297debbe4193811a4dc811d2a1ccbb8caaa6666ad7ab" +checksum = "495197c078e54b8735181aa35c00a327f7f3a3cc00a1ee8c95926dd010f0ec6b" dependencies = [ "blake2-rfc", "crc32fast", + "fs2", + "hex 0.4.3", "libc", "log", - "memmap", - "parking_lot 0.10.2", + "memmap2", + "parking_lot 0.11.1", + "rand 0.8.3", ] [[package]] name = "parity-multiaddr" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180cd097078b337d2ba6400c6a67b181b38b611273cb1d8d12f3d8d5d8eaaacb" +checksum = "58341485071825827b7f03cf7efd1cb21e6a709bea778fb50227fd45d2f361b4" dependencies = [ "arrayref", "bs58", @@ -5096,30 +5852,53 @@ dependencies = [ "percent-encoding 2.1.0", "serde", "static_assertions", - "unsigned-varint", - "url 2.2.0", + "unsigned-varint 0.7.0", + "url 2.2.2", ] [[package]] name = "parity-scale-codec" -version = "1.3.6" +version = "1.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79602888a81ace83e3d1d4b2873286c1f5f906c84db667594e8db8da3506c383" +checksum = "a4b26b16c7687c3075982af47719e481815df30bc544f7a6690763a25ca16e9d" dependencies = [ "arrayvec 0.5.2", + "byte-slice-cast 0.3.5", + "parity-scale-codec-derive 1.2.3", +] + +[[package]] +name = "parity-scale-codec" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f518afaa5a47d0d6386229b0a6e01e86427291d643aa4cabb4992219f504f8" +dependencies = [ + "arrayvec 0.7.0", "bitvec", - "byte-slice-cast", - "parity-scale-codec-derive", + "byte-slice-cast 1.0.0", + "parity-scale-codec-derive 2.1.0", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "1.2.2" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41512944b1faff334a5f1b9447611bf4ef40638ccb6328173dacefb338e878c" +dependencies = [ + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "198db82bb1c18fc00176004462dd809b2a6d851669550aa17af6dacd21ae0c14" +checksum = "f44c5f94427bd0b5076e8f7e15ca3f60a4d8ac0077e4793884e6fdfd8915344e" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -5138,11 +5917,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bf" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "libc", "log", "mio-named-pipes", - "miow 0.3.6", + "miow 0.3.7", "rand 0.7.3", "tokio 0.1.22", "tokio-named-pipes", @@ -5152,13 +5931,13 @@ dependencies = [ [[package]] name = "parity-util-mem" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f17f15cb05897127bf36a240085a1f0bbef7bce3024849eccf7f93f6171bc27" +checksum = "664a8c6b8e62d8f9f2f937e391982eb433ab285b4cd9545b342441e04a906e42" dependencies = [ "cfg-if 1.0.0", "hashbrown", - "impl-trait-for-tuples 0.2.0", + "impl-trait-for-tuples 0.2.1", "parity-util-mem-derive", "parking_lot 0.11.1", "primitive-types", @@ -5192,6 +5971,12 @@ version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" +[[package]] +name = "parity-wasm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" + [[package]] name = "parity-ws" version = "0.10.0" @@ -5207,7 +5992,7 @@ dependencies = [ "rand 0.7.3", "sha-1 0.8.2", "slab", - "url 2.2.0", + "url 2.2.2", ] [[package]] @@ -5224,7 +6009,7 @@ checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" dependencies = [ "lock_api 0.3.4", "parking_lot_core 0.6.2", - "rustc_version", + "rustc_version 0.2.3", ] [[package]] @@ -5244,8 +6029,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.2", - "parking_lot_core 0.8.2", + "lock_api 0.4.4", + "parking_lot_core 0.8.3", ] [[package]] @@ -5258,7 +6043,7 @@ dependencies = [ "cloudabi", "libc", "redox_syscall 0.1.57", - "rustc_version", + "rustc_version 0.2.3", "smallvec 0.6.14", "winapi 0.3.9", ] @@ -5279,36 +6064,23 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccb628cad4f84851442432c60ad8e1f607e29752d0bf072cbd0baf28aa34272" +checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall 0.1.57", + "redox_syscall 0.2.8", "smallvec 1.6.1", "winapi 0.3.9", ] [[package]] name = "paste" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" -dependencies = [ - "paste-impl", - "proc-macro-hack", -] - -[[package]] -name = "paste-impl" -version = "0.1.18" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" -dependencies = [ - "proc-macro-hack", -] +checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" [[package]] name = "pbkdf2" @@ -5408,27 +6180,27 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" +checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" dependencies = [ - "pin-project-internal 0.4.27", + "pin-project-internal 0.4.28", ] [[package]] name = "pin-project" -version = "1.0.4" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b70b68509f17aa2857863b6fa00bf21fc93674c7a8893de2f469f6aa7ca2f2" +checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" dependencies = [ - "pin-project-internal 1.0.4", + "pin-project-internal 1.0.7", ] [[package]] name = "pin-project-internal" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" +checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" dependencies = [ "proc-macro2", "quote", @@ -5437,9 +6209,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.4" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caa25a6393f22ce819b0f50e0be89287292fda8d425be38ee0ca14c4931d9e71" +checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" dependencies = [ "proc-macro2", "quote", @@ -5448,15 +6220,15 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" +checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" [[package]] name = "pin-utils" @@ -5476,25 +6248,47 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e" +[[package]] +name = "platforms" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" + [[package]] name = "plotters" -version = "0.2.15" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" +checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" dependencies = [ - "js-sys", "num-traits", + "plotters-backend", + "plotters-svg", "wasm-bindgen", "web-sys", ] +[[package]] +name = "plotters-backend" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07fffcddc1cb3a1de753caa4e4df03b79922ba43cf882acc1bdd7e8df9f4590" + +[[package]] +name = "plotters-svg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b38a02e23bd9604b842a812063aec4ef702b57989c37b655254bb61c471ad211" +dependencies = [ + "plotters-backend", +] + [[package]] name = "polling" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4" +checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "log", "wepoll-sys", @@ -5507,7 +6301,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b7456bc1ad2d4cf82b3a016be4c2ac48daf11bf990c1603ebd447fe6f30fca8" dependencies = [ - "cpuid-bool 0.2.0", + "cpuid-bool", "universal-hash", ] @@ -5517,7 +6311,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" dependencies = [ - "cpuid-bool 0.2.0", + "cpuid-bool", "opaque-debug 0.3.0", "universal-hash", ] @@ -5530,9 +6324,9 @@ checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "predicates" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73dd9b7b200044694dfede9edf907c1ca19630908443e9447e624993700c6932" +checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" dependencies = [ "difference", "predicates-core", @@ -5540,15 +6334,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3dbeaaf793584e29c58c7e3a82bbb3c7c06b63cea68d13b0e3cddc124104dc" +checksum = "57e35a3326b75e49aa85f5dc6ec15b41108cf5aee58eabb1f274dd18b73c2451" [[package]] name = "predicates-tree" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aee95d988ee893cb35c06b148c80ed2cd52c8eea927f50ba7a0be1a786aeab73" +checksum = "15f553275e5721409451eb85e15fd9a860a6e5ab4496eb215987502b5f5391f2" dependencies = [ "predicates-core", "treeline", @@ -5568,15 +6362,15 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3824ae2c5e27160113b9e029a10ec9e3f0237bad8029f69c7724393c9fdefd8" +checksum = "2415937401cb030a2a0a4d922483f945fa068f52a7dbb22ce0fe5f2b6f6adace" dependencies = [ "fixed-hash", "impl-codec", "impl-rlp", "impl-serde", - "uint 0.9.0", + "uint", ] [[package]] @@ -5588,6 +6382,16 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-crate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92" +dependencies = [ + "thiserror", + "toml", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -5626,20 +6430,20 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" dependencies = [ "unicode-xid", ] [[package]] name = "prometheus" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d70cf4412832bcac9cffe27906f4a66e450d323525e977168c70d1b36120ae" +checksum = "c8425533e7122f0c3cc7a37e6244b16ad3a2cc32ae7ac6276e2a75da0d9c200d" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "fnv", "lazy_static", "parking_lot 0.11.1", @@ -5649,23 +6453,23 @@ dependencies = [ [[package]] name = "prost" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" +checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "prost-derive", ] [[package]] name = "prost-build" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" +checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "heck", - "itertools 0.8.2", + "itertools 0.9.0", "log", "multimap", "petgraph", @@ -5677,12 +6481,12 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" +checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" dependencies = [ "anyhow", - "itertools 0.8.2", + "itertools 0.9.0", "proc-macro2", "quote", "syn", @@ -5690,14 +6494,23 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" +checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "prost", ] +[[package]] +name = "psm" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21ff0279b4a85e576b97e4a21d13e437ebcd56612706cde5d3f0d5c9399490c0" +dependencies = [ + "cc", +] + [[package]] name = "pwasm-utils" version = "0.14.0" @@ -5711,13 +6524,13 @@ dependencies = [ [[package]] name = "pwasm-utils" -version = "0.16.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c8ac87af529432d3a4f0e2b3bbf08af49f28f09cc73ed7e551161bdaef5f78d" +checksum = "78778a25194f953d1766fc8c6a331ed56f070d09a0511267ee2c150cb71ea8c2" dependencies = [ "byteorder", "log", - "parity-wasm 0.41.0", + "parity-wasm 0.42.2", ] [[package]] @@ -5728,9 +6541,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-error" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ac73b1112776fc109b2e61909bc46c7e1bf0d7f690ffb1676553acce16d5cda" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quicksink" @@ -5740,23 +6553,23 @@ checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" dependencies = [ "futures-core", "futures-sink", - "pin-project-lite 0.1.11", + "pin-project-lite 0.1.12", ] [[package]] name = "quote" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ "proc-macro2", ] [[package]] name = "radium" -version = "0.3.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" [[package]] name = "rand" @@ -5797,13 +6610,13 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18519b42a40024d661e1714153e9ad0c3de27cd495760ceb09710920f1098b1e" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" dependencies = [ "libc", "rand_chacha 0.3.0", - "rand_core 0.6.1", + "rand_core 0.6.2", "rand_hc 0.3.0", ] @@ -5824,7 +6637,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" dependencies = [ "ppv-lite86", - "rand_core 0.6.1", + "rand_core 0.6.2", ] [[package]] @@ -5853,11 +6666,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.3", ] [[package]] @@ -5884,7 +6697,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ - "rand_core 0.6.1", + "rand_core 0.6.2", ] [[package]] @@ -5896,17 +6709,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "raw-cpuid" -version = "7.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb71f708fe39b2c5e98076204c3cc094ee5a4c12c4cdb119a2b72dc34164f41" -dependencies = [ - "bitflags", - "cc", - "rustc_version", -] - [[package]] name = "rawpointer" version = "0.2.1" @@ -5915,9 +6717,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ "autocfg", "crossbeam-deque 0.8.0", @@ -5927,13 +6729,13 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.5", "lazy_static", "num_cpus", ] @@ -5955,22 +6757,21 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.4" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570" +checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc" dependencies = [ "bitflags", ] [[package]] name = "redox_users" -version = "0.3.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.1.16", - "redox_syscall 0.1.57", - "rust-argon2", + "getrandom 0.2.3", + "redox_syscall 0.2.8", ] [[package]] @@ -5995,42 +6796,41 @@ dependencies = [ [[package]] name = "regalloc" -version = "0.0.27" +version = "0.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ba8aaf5fe7cf307c6dbdaeed85478961d29e25e3bee5169e11b92fa9f027a8" +checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" dependencies = [ "log", "rustc-hash", + "serde", "smallvec 1.6.1", ] [[package]] name = "regex" -version = "1.4.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ "aho-corasick", "memchr", "regex-syntax", - "thread_local", ] [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "byteorder", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.22" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "region" @@ -6053,17 +6853,27 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error 1.2.3", +] + [[package]] name = "retain_mut" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53552c6c49e1e13f1a203ef0080ab3bbef0beb570a528993e83df057a9d9bba1" +checksum = "e9c17925a9027d298a4603d286befe3f9dc0e8ed02523141914eb628798d6e5b" [[package]] name = "ring" -version = "0.16.19" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "024a1e66fea74c66c66624ee5622a7ff0e4b73a13b4f5c326ddb50c708944226" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", @@ -6108,9 +6918,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d83c02c429044d58474eaf5ae31e062d0de894e21125b47437ec0edc1397e6" +checksum = "c749134fda8bfc90d0de643d59bfc841dcb3ac8a1062e12b6754bd60235c48b3" dependencies = [ "libc", "librocksdb-sys", @@ -6126,23 +6936,11 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rust-argon2" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" -dependencies = [ - "base64 0.13.0", - "blake2b_simd", - "constant_time_eq", - "crossbeam-utils 0.8.1", -] - [[package]] name = "rustc-demangle" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "410f7acf3cb3a44527c5d9546bad4bf4e6c460915d5f9f2fc524498bfe8f70ce" [[package]] name = "rustc-hash" @@ -6165,6 +6963,15 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustls" version = "0.18.1" @@ -6180,9 +6987,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ "base64 0.13.0", "log", @@ -6203,14 +7010,24 @@ dependencies = [ "security-framework", ] +[[package]] +name = "ruzstd" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d425143485a37727c7a46e689bbe3b883a00f42b4a52c4ac0f44855c1009b00" +dependencies = [ + "byteorder", + "twox-hash", +] + [[package]] name = "rw-stream-sink" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.12", - "pin-project 0.4.27", + "futures 0.3.15", + "pin-project 0.4.28", "static_assertions", ] @@ -6226,7 +7043,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" dependencies = [ - "rustc_version", + "rustc_version 0.2.3", ] [[package]] @@ -6249,17 +7066,18 @@ dependencies = [ [[package]] name = "sc-authority-discovery" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "async-trait", "derive_more", "either", - "futures 0.3.12", + "futures 0.3.15", "futures-timer 3.0.2", + "ip_network", "libp2p", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "prost", "prost-build", "rand 0.7.3", @@ -6277,13 +7095,13 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "futures-timer 3.0.2", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sc-block-builder", "sc-client-api", "sc-proposer-metrics", @@ -6300,15 +7118,14 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sc-client-api", "sp-api", "sp-block-builder", "sp-blockchain", - "sp-consensus", "sp-core", "sp-inherents", "sp-runtime", @@ -6317,11 +7134,11 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "impl-trait-for-tuples 0.2.0", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.1", "sc-chain-spec-derive", "sc-consensus-babe", "sc-consensus-epochs", @@ -6338,10 +7155,10 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -6349,22 +7166,20 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "atty", "chrono", "fdlimit", - "futures 0.3.12", - "hex 0.4.2", + "futures 0.3.15", + "hex 0.4.3", "libp2p", "log", "names", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "rand 0.7.3", "regex", "rpassword", - "sc-cli-proc-macro", "sc-client-api", "sc-keystore", "sc-network", @@ -6384,36 +7199,22 @@ dependencies = [ "structopt", "thiserror", "tiny-bip39", - "tokio 0.2.24", - "tracing", - "tracing-log", - "tracing-subscriber", -] - -[[package]] -name = "sc-cli-proc-macro" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "tokio 0.2.25", ] [[package]] name = "sc-client-api" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "derive_more", "fnv", - "futures 0.3.12", + "futures 0.3.15", "hash-db", "kvdb", "lazy_static", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "sc-executor", "sp-api", @@ -6426,7 +7227,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 3.0.0", "sp-storage", "sp-transaction-pool", "sp-trie", @@ -6437,8 +7238,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "blake2-rfc", "hash-db", @@ -6448,7 +7249,7 @@ dependencies = [ "linked-hash-map", "log", "parity-db", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parity-util-mem", "parking_lot 0.11.1", "sc-client-api", @@ -6467,9 +7268,10 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ + "parking_lot 0.11.1", "sc-client-api", "sp-blockchain", "sp-consensus", @@ -6478,15 +7280,15 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ + "async-trait", "derive_more", - "futures 0.3.12", + "futures 0.3.15", "futures-timer 3.0.2", "log", - "parity-scale-codec", - "parking_lot 0.11.1", + "parity-scale-codec 2.1.1", "sc-block-builder", "sc-client-api", "sc-consensus-slots", @@ -6497,31 +7299,32 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-aura", + "sp-consensus-slots", "sp-core", "sp-inherents", "sp-io", "sp-keystore", "sp-runtime", - "sp-timestamp", "sp-version", "substrate-prometheus-endpoint", ] [[package]] name = "sc-consensus-babe" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ + "async-trait", "derive_more", "fork-tree", - "futures 0.3.12", + "futures 0.3.15", "futures-timer 3.0.2", "log", "merlin", "num-bigint 0.2.6", "num-rational 0.2.4", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "pdqselect", "rand 0.7.3", @@ -6540,13 +7343,13 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-slots", "sp-consensus-vrf", "sp-core", "sp-inherents", "sp-io", "sp-keystore", "sp-runtime", - "sp-timestamp", "sp-utils", "sp-version", "substrate-prometheus-endpoint", @@ -6554,27 +7357,28 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "fork-tree", - "parity-scale-codec", - "parking_lot 0.11.1", + "parity-scale-codec 2.1.1", "sc-client-api", + "sc-consensus", "sp-blockchain", "sp-runtime", ] [[package]] name = "sc-consensus-slots" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "async-trait", + "futures 0.3.15", "futures-timer 3.0.2", + "impl-trait-for-tuples 0.2.1", "log", - "parity-scale-codec", - "parking_lot 0.11.1", + "parity-scale-codec 2.1.1", "sc-client-api", "sc-telemetry", "sp-api", @@ -6587,34 +7391,32 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", + "sp-timestamp", "sp-trie", "thiserror", ] [[package]] name = "sc-consensus-uncles" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "log", "sc-client-api", "sp-authorship", - "sp-consensus", - "sp-core", - "sp-inherents", "sp-runtime", + "thiserror", ] [[package]] name = "sc-executor" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "derive_more", "lazy_static", "libsecp256k1", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parity-wasm 0.41.0", "parking_lot 0.11.1", "sc-executor-common", @@ -6636,14 +7438,16 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "derive_more", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parity-wasm 0.41.0", + "pwasm-utils 0.14.0", "sp-allocator", "sp-core", + "sp-maybe-compressed-blob", "sp-serializer", "sp-wasm-interface", "thiserror", @@ -6652,11 +7456,11 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sc-executor-common", "sp-allocator", "sp-core", @@ -6667,11 +7471,11 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parity-wasm 0.41.0", "pwasm-utils 0.14.0", "sc-executor-common", @@ -6685,18 +7489,21 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ + "async-trait", "derive_more", + "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.12", + "futures 0.3.15", "futures-timer 3.0.2", + "linked-hash-map", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", - "pin-project 0.4.27", + "pin-project 1.0.7", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -6722,18 +7529,18 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "derive_more", "finality-grandpa", - "futures 0.3.12", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-pubsub", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 15.1.0", + "jsonrpc-derive 15.1.0", + "jsonrpc-pubsub 15.1.0", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sc-client-api", "sc-finality-grandpa", "sc-rpc", @@ -6744,13 +7551,34 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "sc-finality-grandpa-warp-sync" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" +dependencies = [ + "derive_more", + "futures 0.3.15", + "log", + "num-traits", + "parity-scale-codec 2.1.1", + "parking_lot 0.11.1", + "prost", + "sc-client-api", + "sc-finality-grandpa", + "sc-network", + "sc-service", + "sp-blockchain", + "sp-finality-grandpa", + "sp-runtime", +] + [[package]] name = "sc-informant" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "ansi_term 0.12.1", - "futures 0.3.12", + "futures 0.3.15", "log", "parity-util-mem", "sc-client-api", @@ -6764,14 +7592,14 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "async-trait", "derive_more", - "futures 0.3.12", + "futures 0.3.15", "futures-util", - "hex 0.4.2", + "hex 0.4.3", "merlin", "parking_lot 0.11.1", "rand 0.7.3", @@ -6784,12 +7612,12 @@ dependencies = [ [[package]] name = "sc-light" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "hash-db", "lazy_static", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "sc-client-api", "sc-executor", @@ -6803,32 +7631,34 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "async-std", "async-trait", + "asynchronous-codec 0.5.0", "bitflags", "bs58", - "bytes 0.5.6", + "bytes 1.0.1", + "cid", "derive_more", "either", "erased-serde", "fnv", "fork-tree", - "futures 0.3.12", + "futures 0.3.15", "futures-timer 3.0.2", - "futures_codec", - "hex 0.4.2", + "hex 0.4.3", "ip_network", "libp2p", "linked-hash-map", "linked_hash_set", "log", + "lru", "nohash-hasher", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", - "pin-project 0.4.27", + "pin-project 1.0.7", "prost", "prost-build", "rand 0.7.3", @@ -6837,8 +7667,6 @@ dependencies = [ "sc-peerset", "serde", "serde_json", - "slog", - "slog_derive", "smallvec 1.6.1", "sp-arithmetic", "sp-blockchain", @@ -6848,7 +7676,7 @@ dependencies = [ "sp-utils", "substrate-prometheus-endpoint", "thiserror", - "unsigned-varint", + "unsigned-varint 0.6.0", "void", "wasm-timer", "zeroize", @@ -6856,10 +7684,10 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "futures-timer 3.0.2", "libp2p", "log", @@ -6867,23 +7695,25 @@ dependencies = [ "sc-network", "sp-runtime", "substrate-prometheus-endpoint", + "tracing", "wasm-timer", ] [[package]] name = "sc-offchain" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.12", + "futures 0.3.15", "futures-timer 3.0.2", - "hyper 0.13.9", + "hex 0.4.3", + "hyper 0.13.10", "hyper-rustls", "log", "num_cpus", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "rand 0.7.3", "sc-client-api", @@ -6899,10 +7729,10 @@ dependencies = [ [[package]] name = "sc-peerset" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "libp2p", "log", "serde_json", @@ -6912,8 +7742,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -6921,15 +7751,15 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "hash-db", - "jsonrpc-core", - "jsonrpc-pubsub", + "jsonrpc-core 15.1.0", + "jsonrpc-pubsub 15.1.0", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "sc-block-builder", "sc-client-api", @@ -6948,6 +7778,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-state-machine", + "sp-tracing", "sp-transaction-pool", "sp-utils", "sp-version", @@ -6955,17 +7786,17 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "derive_more", - "futures 0.3.12", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-pubsub", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 15.1.0", + "jsonrpc-derive 15.1.0", + "jsonrpc-pubsub 15.1.0", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "serde", "serde_json", @@ -6973,20 +7804,21 @@ dependencies = [ "sp-core", "sp-rpc", "sp-runtime", + "sp-tracing", "sp-transaction-pool", "sp-version", ] [[package]] name = "sc-rpc-server" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.1.30", - "jsonrpc-core", + "futures 0.1.31", + "jsonrpc-core 15.1.0", "jsonrpc-http-server", "jsonrpc-ipc-server", - "jsonrpc-pubsub", + "jsonrpc-pubsub 15.1.0", "jsonrpc-ws-server", "log", "serde", @@ -6997,23 +7829,24 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "directories 3.0.1", + "async-trait", + "directories", "exit-future", - "futures 0.1.30", - "futures 0.3.12", + "futures 0.1.31", + "futures 0.3.15", "futures-timer 3.0.2", "hash-db", - "jsonrpc-core", - "jsonrpc-pubsub", + "jsonrpc-core 15.1.0", + "jsonrpc-pubsub 15.1.0", "lazy_static", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parity-util-mem", "parking_lot 0.11.1", - "pin-project 0.4.27", + "pin-project 1.0.7", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -7032,7 +7865,6 @@ dependencies = [ "sc-transaction-pool", "serde", "serde_json", - "slog", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -7061,11 +7893,11 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parity-util-mem", "parity-util-mem-derive", "parking_lot 0.11.1", @@ -7076,31 +7908,31 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", - "futures-timer 3.0.2", + "chrono", + "futures 0.3.15", "libp2p", "log", "parking_lot 0.11.1", - "pin-project 0.4.27", + "pin-project 1.0.7", "rand 0.7.3", "serde", - "slog", - "slog-json", - "slog-scope", + "serde_json", "take_mut", + "thiserror", "void", "wasm-timer", ] [[package]] name = "sc-tracing" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "ansi_term 0.12.1", + "atty", "erased-serde", "lazy_static", "log", @@ -7108,24 +7940,47 @@ dependencies = [ "parking_lot 0.11.1", "regex", "rustc-hash", + "sc-client-api", + "sc-rpc-server", "sc-telemetry", + "sc-tracing-proc-macro", "serde", "serde_json", - "slog", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-storage", "sp-tracing", + "thiserror", "tracing", - "tracing-core", "tracing-log", "tracing-subscriber", + "wasm-bindgen", + "wasm-timer", + "web-sys", +] + +[[package]] +name = "sc-tracing-proc-macro" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" +dependencies = [ + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "sc-transaction-graph" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "derive_more", - "futures 0.3.12", + "futures 0.3.15", "linked-hash-map", "log", "parity-util-mem", @@ -7143,14 +7998,14 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "futures-diagnose", "intervalier", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parity-util-mem", "parking_lot 0.11.1", "sc-client-api", @@ -7219,9 +8074,9 @@ dependencies = [ [[package]] name = "scroll_derive" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12bd20b94c7cdfda8c7ba9b92ad0d9a56e3fa018c25fca83b51aa664c9b4c0d" +checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0" dependencies = [ "proc-macro2", "quote", @@ -7230,9 +8085,9 @@ dependencies = [ [[package]] name = "sct" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ "ring", "untrusted", @@ -7327,9 +8182,9 @@ checksum = "930c0acf610d3fdb5e2ab6213019aaa04e227ebe9547b0649ba599b16d788bd7" [[package]] name = "serde" -version = "1.0.120" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "166b2349061381baf54a58e4b13c89369feb0ef2eaa57198899e2312aac30aab" +checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" dependencies = [ "serde_derive", ] @@ -7346,9 +8201,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.120" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca2a8cb5805ce9e3b95435e3765b7b553cecc762d938d409434338386cb5775" +checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" dependencies = [ "proc-macro2", "quote", @@ -7357,9 +8212,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.61" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" dependencies = [ "itoa", "ryu", @@ -7380,13 +8235,13 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3cdf1b5e620a498ee6f2a171885ac7e22f0e12089ec4b3d22b84921792507c" +checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpuid-bool 0.1.2", + "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -7405,13 +8260,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8" +checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpuid-bool 0.1.2", + "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -7458,9 +8313,9 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "signal-hook" -version = "0.1.17" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e31d442c16f047a671b5a71e2161d6e68814012b7f5379d269ebd915fac2729" +checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39" dependencies = [ "libc", "signal-hook-registry", @@ -7468,9 +8323,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] @@ -7483,21 +8338,21 @@ checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" [[package]] name = "simba" -version = "0.1.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb931b1367faadea6b1ab1c306a860ec17aaa5fa39f367d0c744e69d971a1fb2" +checksum = "5132a955559188f3d13c9ba831e77c802ddc8782783f050ed0c52f5988b95f4c" dependencies = [ - "approx", - "num-complex 0.2.4", + "approx 0.4.0", + "num-complex 0.3.1", "num-traits", "paste", ] [[package]] name = "slab" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" [[package]] name = "slog" @@ -7508,41 +8363,6 @@ dependencies = [ "erased-serde", ] -[[package]] -name = "slog-json" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc0d2aff1f8f325ef660d9a0eb6e6dcd20b30b3f581a5897f58bf42d061c37a" -dependencies = [ - "chrono", - "erased-serde", - "serde", - "serde_json", - "slog", -] - -[[package]] -name = "slog-scope" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f95a4b4c3274cd2869549da82b57ccc930859bdbf5bcea0424bc5f140b3c786" -dependencies = [ - "arc-swap", - "lazy_static", - "slog", -] - -[[package]] -name = "slog_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "smallvec" version = "0.6.14" @@ -7570,8 +8390,8 @@ dependencies = [ "rand 0.7.3", "rand_core 0.5.1", "ring", - "rustc_version", - "sha2 0.9.2", + "rustc_version 0.2.3", + "sha2 0.9.5", "subtle 2.4.0", "x25519-dalek", ] @@ -7587,6 +8407,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "socket2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "soketto" version = "0.4.2" @@ -7596,48 +8426,49 @@ dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.12", + "futures 0.3.15", "httparse", "log", "rand 0.7.3", - "sha-1 0.9.2", + "sha-1 0.9.6", ] [[package]] name = "sp-allocator" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "log", "sp-core", - "sp-std", + "sp-std 3.0.0", "sp-wasm-interface", "thiserror", ] [[package]] name = "sp-api" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "hash-db", - "parity-scale-codec", + "log", + "parity-scale-codec 2.1.1", "sp-api-proc-macro", "sp-core", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 3.0.0", "sp-version", "thiserror", ] [[package]] name = "sp-api-proc-macro" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "blake2-rfc", - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -7645,73 +8476,75 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-core", "sp-io", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-arithmetic" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-debug-derive", - "sp-std", + "sp-std 3.0.0", + "static_assertions", ] [[package]] name = "sp-authority-discovery" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-authorship" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "async-trait", + "parity-scale-codec 2.1.1", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-block-builder" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-api", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-blockchain" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "log", "lru", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "sp-api", "sp-consensus", @@ -7723,8 +8556,8 @@ dependencies = [ [[package]] name = "sp-chain-spec" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "serde", "serde_json", @@ -7732,14 +8565,15 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "async-trait", + "futures 0.3.15", "futures-timer 3.0.2", "libp2p", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "serde", "sp-api", @@ -7747,7 +8581,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 3.0.0", "sp-trie", "sp-utils", "sp-version", @@ -7758,25 +8592,30 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "async-trait", + "parity-scale-codec 2.1.1", "sp-api", "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0", "sp-timestamp", ] [[package]] name = "sp-consensus-babe" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ + "async-trait", "merlin", - "parity-scale-codec", + "parity-scale-codec 2.1.1", + "serde", "sp-api", "sp-application-crypto", "sp-consensus", @@ -7786,52 +8625,53 @@ dependencies = [ "sp-inherents", "sp-keystore", "sp-runtime", - "sp-std", + "sp-std 3.0.0", "sp-timestamp", ] [[package]] name = "sp-consensus-slots" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", + "sp-arithmetic", "sp-runtime", ] [[package]] name = "sp-consensus-vrf" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "schnorrkel", "sp-core", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-core" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "base58", "blake2-rfc", "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.12", + "futures 0.3.15", "hash-db", "hash256-std-hasher", - "hex 0.4.2", + "hex 0.4.3", "impl-serde", "lazy_static", "libsecp256k1", "log", "merlin", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parity-util-mem", "parking_lot 0.11.1", "primitive-types", @@ -7840,11 +8680,11 @@ dependencies = [ "schnorrkel", "secrecy", "serde", - "sha2 0.9.2", + "sha2 0.9.5", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", - "sp-std", + "sp-std 3.0.0", "sp-storage", "substrate-bip39", "thiserror", @@ -7857,8 +8697,8 @@ dependencies = [ [[package]] name = "sp-database" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -7866,8 +8706,8 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "proc-macro2", "quote", @@ -7876,61 +8716,64 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "environmental", - "parity-scale-codec", - "sp-std", + "parity-scale-codec 2.1.1", + "sp-std 3.0.0", "sp-storage", ] [[package]] name = "sp-finality-grandpa" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "finality-grandpa", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-api", "sp-application-crypto", "sp-core", "sp-keystore", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-inherents" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", - "parking_lot 0.11.1", + "async-trait", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.1", "sp-core", - "sp-std", + "sp-runtime", + "sp-std 3.0.0", "thiserror", ] [[package]] name = "sp-io" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "hash-db", "libsecp256k1", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "sp-core", "sp-externalities", "sp-keystore", + "sp-maybe-compressed-blob", "sp-runtime-interface", "sp-state-machine", - "sp-std", + "sp-std 3.0.0", "sp-tracing", "sp-trie", "sp-wasm-interface", @@ -7940,8 +8783,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "lazy_static", "sp-core", @@ -7951,14 +8794,14 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.8.0" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "async-trait", "derive_more", - "futures 0.3.12", + "futures 0.3.15", "merlin", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "schnorrkel", "serde", @@ -7966,24 +8809,34 @@ dependencies = [ "sp-externalities", ] +[[package]] +name = "sp-maybe-compressed-blob" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" +dependencies = [ + "ruzstd", + "zstd", +] + [[package]] name = "sp-npos-elections" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-arithmetic", + "sp-core", "sp-npos-elections-compact", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-npos-elections-compact" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -7991,8 +8844,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "sp-api", "sp-core", @@ -8001,31 +8854,33 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "backtrace", ] [[package]] name = "sp-rpc" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ + "rustc-hash", "serde", "sp-core", + "tracing-core", ] [[package]] name = "sp-runtime" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "either", "hash256-std-hasher", - "impl-trait-for-tuples 0.2.0", + "impl-trait-for-tuples 0.2.1", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parity-util-mem", "paste", "rand 0.7.3", @@ -8034,20 +8889,20 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-runtime-interface" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "impl-trait-for-tuples 0.2.0", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.1", "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std", + "sp-std 3.0.0", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -8056,11 +8911,11 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "Inflector", - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -8068,21 +8923,21 @@ dependencies = [ [[package]] name = "sp-sandbox" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-core", "sp-io", - "sp-std", + "sp-std 3.0.0", "sp-wasm-interface", "wasmi", ] [[package]] name = "sp-serializer" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "serde", "serde_json", @@ -8090,45 +8945,46 @@ dependencies = [ [[package]] name = "sp-session" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-api", "sp-core", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-staking" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-runtime", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-state-machine" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "hash-db", "log", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std", + "sp-std 3.0.0", "sp-trie", "thiserror", + "tracing", "trie-db", "trie-root", ] @@ -8136,56 +8992,70 @@ dependencies = [ [[package]] name = "sp-std" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2585fb8f5f4fde53c2f9ccebac4517da4dc435373a8fcaf5db7f54b798da66c2" + +[[package]] +name = "sp-std" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" [[package]] name = "sp-storage" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "impl-serde", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "ref-cast", "serde", "sp-debug-derive", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-tasks" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "log", "sp-core", "sp-externalities", "sp-io", "sp-runtime-interface", - "sp-std", + "sp-std 3.0.0", ] [[package]] name = "sp-timestamp" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "impl-trait-for-tuples 0.2.0", - "parity-scale-codec", + "async-trait", + "futures-timer 3.0.2", + "log", + "parity-scale-codec 2.1.1", "sp-api", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 3.0.0", + "thiserror", "wasm-timer", ] [[package]] name = "sp-tracing" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ + "erased-serde", "log", - "parity-scale-codec", - "sp-std", + "parity-scale-codec 2.1.1", + "parking_lot 0.10.2", + "serde", + "serde_json", + "slog", + "sp-std 3.0.0", "tracing", "tracing-core", "tracing-subscriber", @@ -8193,13 +9063,13 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "derive_more", - "futures 0.3.12", + "futures 0.3.15", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-api", "sp-blockchain", @@ -8209,24 +9079,24 @@ dependencies = [ [[package]] name = "sp-trie" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "hash-db", "memory-db", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sp-core", - "sp-std", + "sp-std 3.0.0", "trie-db", "trie-root", ] [[package]] name = "sp-utils" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "futures-core", "futures-timer 3.0.2", "lazy_static", @@ -8235,24 +9105,37 @@ dependencies = [ [[package]] name = "sp-version" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "impl-serde", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "serde", "sp-runtime", - "sp-std", + "sp-std 3.0.0", + "sp-version-proc-macro", +] + +[[package]] +name = "sp-version-proc-macro" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" +dependencies = [ + "parity-scale-codec 2.1.1", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "sp-wasm-interface" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ - "impl-trait-for-tuples 0.2.0", - "parity-scale-codec", - "sp-std", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.1", + "sp-std 3.0.0", "wasmi", ] @@ -8276,10 +9159,11 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "statrs" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce16f6de653e88beca7bd13780d08e09d4489dbca1f9210e041bc4852481382" +checksum = "1e34b58a8f9b7462b6922e0b4e3c83d1b3c2075f7f996a56d6c66afa81590064" dependencies = [ + "nalgebra 0.19.0", "rand 0.7.3", ] @@ -8334,18 +9218,18 @@ dependencies = [ [[package]] name = "strum" -version = "0.16.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6138f8f88a16d90134763314e3fc76fa3ed6a7db4725d6acf9a3ef95a3188d22" +checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.16.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" +checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" dependencies = [ "heck", "proc-macro2", @@ -8366,18 +9250,30 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-bn" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.3", + "rustc-hex", +] + [[package]] name = "substrate-browser-utils" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "chrono", "console_error_panic_hook", - "console_log", - "futures 0.1.30", - "futures 0.3.12", + "futures 0.1.31", + "futures 0.3.15", "futures-timer 3.0.2", - "getrandom 0.2.2", + "getrandom 0.2.3", "js-sys", "kvdb-web", "libp2p-wasm-ext", @@ -8387,6 +9283,7 @@ dependencies = [ "sc-informant", "sc-network", "sc-service", + "sc-tracing", "sp-database", "wasm-bindgen", "wasm-bindgen-futures", @@ -8394,18 +9291,19 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" -version = "2.0.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9726c2926418239f73d4d939fcc4ceb5c6697609426c64dd3bcf664f06986afa" +checksum = "bd540ba72520174c2c73ce96bf507eeba3cc8a481f58be92525b69110e1fa645" dependencies = [ - "platforms", + "platforms 1.1.0", ] [[package]] name = "substrate-frame-cli" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ + "frame-support", "frame-system", "sc-cli", "sp-core", @@ -8415,16 +9313,16 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "3.0.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.12", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", + "futures 0.3.15", + "jsonrpc-core 15.1.0", + "jsonrpc-core-client 15.1.0", + "jsonrpc-derive 15.1.0", "log", - "parity-scale-codec", + "parity-scale-codec 2.1.1", "sc-client-api", "sc-rpc-api", "serde", @@ -8438,43 +9336,16 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" +version = "0.9.0" +source = "git+https://github.com/webb-tools/substrate.git?branch=erup-4#0e5c23844faa7a99f0a9e24731827205db7094fb" dependencies = [ "async-std", "derive_more", "futures-util", - "hyper 0.13.9", + "hyper 0.13.10", "log", "prometheus", - "tokio 0.2.24", -] - -[[package]] -name = "substrate-test-client" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?rev=b2a50198d3fa71959c77d22edb5fdb8c1e74006c#b2a50198d3fa71959c77d22edb5fdb8c1e74006c" -dependencies = [ - "futures 0.1.30", - "futures 0.3.12", - "hash-db", - "hex 0.4.2", - "parity-scale-codec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-executor", - "sc-light", - "sc-service", - "serde", - "serde_json", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-keyring", - "sp-keystore", - "sp-runtime", - "sp-state-machine", + "tokio 0.2.25", ] [[package]] @@ -8507,9 +9378,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.58" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" +checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" dependencies = [ "proc-macro2", "quote", @@ -8534,11 +9405,17 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "target-lexicon" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" +checksum = "422045212ea98508ae3d28025bc5aaa2bd4a9cdaecd442a08da2ee620ee9ea95" [[package]] name = "tempfile" @@ -8548,8 +9425,8 @@ checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ "cfg-if 1.0.0", "libc", - "rand 0.8.2", - "redox_syscall 0.2.4", + "rand 0.8.3", + "redox_syscall 0.2.8", "remove_dir_all", "winapi 0.3.9", ] @@ -8574,18 +9451,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" +checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" +checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" dependencies = [ "proc-macro2", "quote", @@ -8594,11 +9471,11 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb9bc092d0d51e76b2b19d9d85534ffc9ec2db959a2523cdae0697e2972cd447" +checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -8612,11 +9489,12 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] @@ -8632,7 +9510,7 @@ dependencies = [ "pbkdf2 0.4.0", "rand 0.7.3", "rustc-hash", - "sha2 0.9.2", + "sha2 0.9.5", "thiserror", "unicode-normalization", "zeroize", @@ -8649,9 +9527,9 @@ dependencies = [ [[package]] name = "tinytemplate" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ada8616fad06a2d0c455adc530de4ef57605a8120cc65da9653e0e9623ca74" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ "serde", "serde_json", @@ -8659,9 +9537,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f" +checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" dependencies = [ "tinyvec_macros", ] @@ -8679,7 +9557,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "mio", "num_cpus", "tokio-codec", @@ -8698,9 +9576,9 @@ dependencies = [ [[package]] name = "tokio" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099837d3464c16a808060bb3f02263b412f6fafcb5d01c533d309985fbeebe48" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" dependencies = [ "bytes 0.5.6", "fnv", @@ -8712,9 +9590,10 @@ dependencies = [ "mio", "mio-uds", "num_cpus", - "pin-project-lite 0.1.11", + "pin-project-lite 0.1.12", "signal-hook-registry", "slab", + "tokio-macros", "winapi 0.3.9", ] @@ -8726,7 +9605,7 @@ checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" dependencies = [ "bytes 0.4.12", "either", - "futures 0.1.30", + "futures 0.1.31", ] [[package]] @@ -8736,7 +9615,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "tokio-io", ] @@ -8746,7 +9625,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "tokio-executor", ] @@ -8757,7 +9636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" dependencies = [ "crossbeam-utils 0.7.2", - "futures 0.1.30", + "futures 0.1.31", ] [[package]] @@ -8766,7 +9645,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "tokio-io", "tokio-threadpool", ] @@ -8778,10 +9657,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "log", ] +[[package]] +name = "tokio-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tokio-named-pipes" version = "0.1.0" @@ -8789,7 +9679,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "mio", "mio-named-pipes", "tokio 0.1.22", @@ -8802,7 +9692,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" dependencies = [ "crossbeam-utils 0.7.2", - "futures 0.1.30", + "futures 0.1.31", "lazy_static", "log", "mio", @@ -8822,7 +9712,7 @@ checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a" dependencies = [ "futures-core", "rustls 0.18.1", - "tokio 0.2.24", + "tokio 0.2.25", "webpki", ] @@ -8832,7 +9722,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", ] [[package]] @@ -8842,7 +9732,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" dependencies = [ "fnv", - "futures 0.1.30", + "futures 0.1.31", ] [[package]] @@ -8852,7 +9742,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "iovec", "mio", "tokio-io", @@ -8868,7 +9758,7 @@ dependencies = [ "crossbeam-deque 0.7.3", "crossbeam-queue", "crossbeam-utils 0.7.2", - "futures 0.1.30", + "futures 0.1.31", "lazy_static", "log", "num_cpus", @@ -8883,7 +9773,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" dependencies = [ "crossbeam-utils 0.7.2", - "futures 0.1.30", + "futures 0.1.31", "slab", "tokio-executor", ] @@ -8895,7 +9785,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "log", "mio", "tokio-codec", @@ -8910,7 +9800,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "iovec", "libc", "log", @@ -8931,8 +9821,8 @@ dependencies = [ "futures-core", "futures-sink", "log", - "pin-project-lite 0.1.11", - "tokio 0.2.24", + "pin-project-lite 0.1.12", + "tokio 0.2.25", ] [[package]] @@ -8946,28 +9836,28 @@ dependencies = [ [[package]] name = "tower-service" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.22" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" +checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.4", + "pin-project-lite 0.2.6", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.11" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" +checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" dependencies = [ "proc-macro2", "quote", @@ -8976,28 +9866,28 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" dependencies = [ "lazy_static", ] [[package]] name = "tracing-futures" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 0.4.27", + "pin-project 1.0.7", "tracing", ] [[package]] name = "tracing-log" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0f8c7178e13481ff6765bd169b33e8d554c5d2bbede5e32c356194be02b9b9" +checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" dependencies = [ "lazy_static", "log", @@ -9016,9 +9906,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1fa8f0c8f4c594e4fc9debc1990deab13238077271ba84dd853d54902ee3401" +checksum = "aa5553bf0883ba7c9cbe493b085c29926bd41b66afc31ff72cf17ff4fb60dcd5" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -9044,9 +9934,9 @@ checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" [[package]] name = "trie-db" -version = "0.22.2" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc176c377eb24d652c9c69c832c832019011b6106182bf84276c66b66d5c9a6" +checksum = "cd81fe0c8bc2b528a51c9d2c31dae4483367a26a723a3c9a4a8120311d7774e3" dependencies = [ "hash-db", "hashbrown", @@ -9074,6 +9964,49 @@ dependencies = [ "rlp", ] +[[package]] +name = "trust-dns-proto" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0d7f5db438199a6e2609debe3f69f808d074e0a2888ee0bccb45fe234d03f4" +dependencies = [ + "async-trait", + "cfg-if 1.0.0", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "log", + "rand 0.8.3", + "smallvec 1.6.1", + "thiserror", + "tinyvec", + "url 2.2.2", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ad17b608a64bd0735e67bde16b0636f8aa8591f831a25d18443ed00a699770" +dependencies = [ + "cfg-if 1.0.0", + "futures-util", + "ipconfig", + "lazy_static", + "log", + "lru-cache", + "parking_lot 0.11.1", + "resolv-conf", + "smallvec 1.6.1", + "thiserror", + "trust-dns-proto", +] + [[package]] name = "try-lock" version = "0.2.3" @@ -9093,9 +10026,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" [[package]] name = "ucd-trie" @@ -9103,18 +10036,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" -[[package]] -name = "uint" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177" -dependencies = [ - "byteorder", - "crunchy", - "rustc-hex", - "static_assertions", -] - [[package]] name = "uint" version = "0.9.0" @@ -9123,7 +10044,7 @@ checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" dependencies = [ "byteorder", "crunchy", - "hex 0.4.2", + "hex 0.4.3", "static_assertions", ] @@ -9138,18 +10059,18 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" dependencies = [ "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.16" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] @@ -9168,9 +10089,9 @@ checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "universal-hash" @@ -9187,11 +10108,29 @@ name = "unsigned-varint" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" + +[[package]] +name = "unsigned-varint" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2" dependencies = [ - "bytes 0.5.6", + "asynchronous-codec 0.5.0", + "bytes 1.0.1", + "futures-io", + "futures-util", +] + +[[package]] +name = "unsigned-varint" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f8d425fafb8cd76bc3f22aace4af471d3156301d7508f2107e98fbeae10bc7f" +dependencies = [ + "asynchronous-codec 0.6.0", + "bytes 1.0.1", "futures-io", "futures-util", - "futures_codec", ] [[package]] @@ -9213,27 +10152,31 @@ dependencies = [ [[package]] name = "url" -version = "2.2.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", - "idna 0.2.0", + "idna 0.2.3", "matches", "percent-encoding 2.1.0", ] [[package]] -name = "vcpkg" -version = "0.2.11" +name = "value-bag" +version = "1.0.0-alpha.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" +checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae" +dependencies = [ + "ctor", + "version_check", +] [[package]] -name = "vec-arena" -version = "1.0.0" +name = "vcpkg" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d" +checksum = "025ce40a007e1907e58d5bc1a594def78e5573bb0b1160bc389634e8f12e4faa" [[package]] name = "vec_map" @@ -9243,9 +10186,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "void" @@ -9293,9 +10236,9 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", "winapi 0.3.9", @@ -9308,7 +10251,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "log", "try-lock", ] @@ -9331,15 +10274,15 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.1+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93c6c3420963c5c64bca373b25e77acb562081b9bb4dd5bb864187742186cea9" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.69" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" +checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -9347,9 +10290,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.69" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" +checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" dependencies = [ "bumpalo", "lazy_static", @@ -9362,9 +10305,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.19" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe9756085a84584ee9457a002b7cdfe0bfff169f45d2591d8be1345a6780e35" +checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -9374,9 +10317,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.69" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" +checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9384,9 +10327,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.69" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" +checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" dependencies = [ "proc-macro2", "quote", @@ -9397,9 +10340,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.69" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" +checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" [[package]] name = "wasm-gc-api" @@ -9418,7 +10361,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "js-sys", "parking_lot 0.11.1", "pin-utils", @@ -9439,7 +10382,7 @@ dependencies = [ "num-rational 0.2.4", "num-traits", "parity-wasm 0.41.0", - "wasmi-validation", + "wasmi-validation 0.3.0", ] [[package]] @@ -9452,35 +10395,44 @@ dependencies = [ ] [[package]] -name = "wasmparser" -version = "0.57.0" +name = "wasmi-validation" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6" +checksum = "a2eb8e860796d8be48efef530b60eebf84e74a88bce107374fffb0da97d504b8" +dependencies = [ + "parity-wasm 0.42.2", +] [[package]] name = "wasmparser" -version = "0.59.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9" +checksum = "755a9a4afe3f6cccbbe6d7e965eef44cf260b001f93e547eba84255c1d0187d8" [[package]] name = "wasmtime" -version = "0.19.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd3c4f449382779ef6e0a7c3ec6752ae614e20a42e4100000c3efdc973100e2" +checksum = "718cb52a9fdb7ab12471e9b9d051c9adfa6b5c504e0a1fea045e5eabc81eedd9" dependencies = [ "anyhow", "backtrace", - "cfg-if 0.1.10", - "lazy_static", + "bincode", + "cfg-if 1.0.0", + "cpp_demangle", + "indexmap", "libc", "log", + "paste", "region", "rustc-demangle", + "serde", "smallvec 1.6.1", "target-lexicon", - "wasmparser 0.59.0", + "wasmparser", + "wasmtime-cache", "wasmtime-environ", + "wasmtime-fiber", "wasmtime-jit", "wasmtime-profiling", "wasmtime-runtime", @@ -9488,74 +10440,113 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "wasmtime-cache" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f984df56c4adeba91540f9052db9f7a8b3b00cfaac1a023bee50a972f588b0c" +dependencies = [ + "anyhow", + "base64 0.13.0", + "bincode", + "directories-next", + "errno", + "file-per-thread-logger", + "libc", + "log", + "serde", + "sha2 0.9.5", + "toml", + "winapi 0.3.9", + "zstd", +] + +[[package]] +name = "wasmtime-cranelift" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a05abbf94e03c2c8ee02254b1949320c4d45093de5d9d6ed4d9351d536075c9" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-wasm", + "wasmparser", + "wasmtime-environ", +] + [[package]] name = "wasmtime-debug" -version = "0.19.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e634af9067a3af6cf2c7d33dc3b84767ddaf5d010ba68e80eecbcea73d4a349" +checksum = "382eecd6281c6c1d1f3c904c3c143e671fc1a9573820cbfa777fba45ce2eda9c" dependencies = [ "anyhow", - "gimli 0.21.0", + "gimli 0.23.0", "more-asserts", - "object 0.20.0", + "object 0.23.0", "target-lexicon", "thiserror", - "wasmparser 0.59.0", + "wasmparser", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "0.19.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f85619a94ee4034bd5bb87fc3dcf71fd2237b81c840809da1201061eec9ab3" +checksum = "81011b2b833663d7e0ce34639459a0e301e000fc7331e0298b3a27c78d0cec60" dependencies = [ "anyhow", - "base64 0.12.3", - "bincode", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "cranelift-codegen", "cranelift-entity", - "cranelift-frontend", "cranelift-wasm", - "directories 2.0.2", - "errno", - "file-per-thread-logger", + "gimli 0.23.0", "indexmap", - "libc", "log", "more-asserts", - "rayon", "serde", - "sha2 0.8.2", "thiserror", - "toml", - "wasmparser 0.59.0", + "wasmparser", +] + +[[package]] +name = "wasmtime-fiber" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92da32e31af2e3d828f485f5f24651ed4d3b7f03a46ea6555eae6940d1402cd" +dependencies = [ + "cc", + "libc", "winapi 0.3.9", - "zstd", ] [[package]] name = "wasmtime-jit" -version = "0.19.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e914c013c7a9f15f4e429d5431f2830fb8adb56e40567661b69c5ec1d645be23" +checksum = "9b5f649623859a12d361fe4cc4793de44f7c3ff34c322c5714289787e89650bb" dependencies = [ + "addr2line 0.14.1", "anyhow", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.21.0", + "gimli 0.23.0", "log", "more-asserts", - "object 0.20.0", + "object 0.23.0", + "rayon", "region", + "serde", "target-lexicon", "thiserror", - "wasmparser 0.59.0", + "wasmparser", + "wasmtime-cranelift", "wasmtime-debug", "wasmtime-environ", "wasmtime-obj", @@ -9566,13 +10557,13 @@ dependencies = [ [[package]] name = "wasmtime-obj" -version = "0.19.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e81d8e02e9bc9fe2da9b6d48bbc217f96e089f7df613f11a28a3958abc44641e" +checksum = "ef2e99cd9858f57fd062e9351e07881cedfc8597928385e02a48d9333b9e15a1" dependencies = [ "anyhow", "more-asserts", - "object 0.20.0", + "object 0.23.0", "target-lexicon", "wasmtime-debug", "wasmtime-environ", @@ -9580,16 +10571,16 @@ dependencies = [ [[package]] name = "wasmtime-profiling" -version = "0.19.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8d4d1af8dd5f7096cfcc89dd668d358e52980c38cce199643372ffd6590e27" +checksum = "e46c0a590e49278ba7f79ef217af9db4ecc671b50042c185093e22d73524abb2" dependencies = [ "anyhow", - "cfg-if 0.1.10", - "gimli 0.21.0", + "cfg-if 1.0.0", + "gimli 0.23.0", "lazy_static", "libc", - "object 0.19.0", + "object 0.23.0", "scroll", "serde", "target-lexicon", @@ -9599,19 +10590,20 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.19.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a25f140bbbaadb07c531cba99ce1a966dba216138dc1b2a0ddecec851a01a93" +checksum = "1438a09185fc7ca067caf1a80d7e5b398eefd4fb7630d94841448ade60feb3d0" dependencies = [ "backtrace", "cc", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "indexmap", "lazy_static", "libc", "log", - "memoffset 0.5.6", + "memoffset 0.6.4", "more-asserts", + "psm", "region", "thiserror", "wasmtime-environ", @@ -9620,32 +10612,119 @@ dependencies = [ [[package]] name = "wast" -version = "32.0.0" +version = "35.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c24a3ee360d01d60ed0a0f960ab76a6acce64348cdb0bf8699c2a866fad57c7c" +checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.33" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e8f7f34773fa6318e8897283abf7941c1f250faae4e1a52f82df09c3bad7cce" +checksum = "8ec280a739b69173e0ffd12c1658507996836ba4e992ed9bc1e5385a0bd72a02" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.46" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" +checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" dependencies = [ "js-sys", "wasm-bindgen", ] +[[package]] +name = "webb-bulletproofs" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dcc103f95a2509aea2ca010f7f06b137bc4693cf57f39947937ae00d487266" +dependencies = [ + "byteorder", + "clear_on_drop", + "curve25519-dalek 3.1.0", + "digest 0.9.0", + "merlin", + "rand 0.7.3", + "rand_core 0.5.1", + "serde", + "serde_derive", + "sha3 0.9.1", + "sp-std 2.0.1", + "subtle 2.4.0", + "thiserror", +] + +[[package]] +name = "webb-currencies" +version = "3.0.0" +source = "git+https://github.com/webb-tools/anon?branch=erup-4#f493dd9dd6385e584346fb210c674ea5f5578aad" +dependencies = [ + "frame-support", + "frame-system", + "funty", + "parity-scale-codec 2.1.1", + "serde", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", + "webb-traits", + "webb-utilities", +] + +[[package]] +name = "webb-tokens" +version = "3.0.0" +source = "git+https://github.com/webb-tools/anon?branch=erup-4#f493dd9dd6385e584346fb210c674ea5f5578aad" +dependencies = [ + "bencher", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-treasury", + "parity-scale-codec 2.1.1", + "serde", + "sp-runtime", + "sp-std 3.0.0", + "webb-traits", +] + +[[package]] +name = "webb-traits" +version = "3.0.0" +source = "git+https://github.com/webb-tools/anon?branch=erup-4#f493dd9dd6385e584346fb210c674ea5f5578aad" +dependencies = [ + "frame-support", + "funty", + "impl-trait-for-tuples 0.2.1", + "num-traits", + "parity-scale-codec 2.1.1", + "serde", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", + "webb-utilities", +] + +[[package]] +name = "webb-utilities" +version = "3.0.0" +source = "git+https://github.com/webb-tools/anon?branch=erup-4#f493dd9dd6385e584346fb210c674ea5f5578aad" +dependencies = [ + "frame-support", + "funty", + "parity-scale-codec 2.1.1", + "serde", + "sp-io", + "sp-runtime", + "sp-std 3.0.0", +] + [[package]] name = "webpki" version = "0.21.4" @@ -9658,9 +10737,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" dependencies = [ "webpki", ] @@ -9676,13 +10755,20 @@ dependencies = [ [[package]] name = "which" -version = "3.1.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" +checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" dependencies = [ + "either", "libc", ] +[[package]] +name = "widestring" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" + [[package]] name = "winapi" version = "0.2.8" @@ -9726,6 +10812,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -9736,45 +10831,51 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + [[package]] name = "x25519-dalek" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" dependencies = [ - "curve25519-dalek 3.0.2", + "curve25519-dalek 3.1.0", "rand_core 0.5.1", "zeroize", ] [[package]] name = "yamux" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aeb8c4043cac71c3c299dff107171c220d179492350ea198e109a414981b83c" +checksum = "e7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107" dependencies = [ - "futures 0.3.12", + "futures 0.3.15", "log", "nohash-hasher", "parking_lot 0.11.1", - "rand 0.7.3", + "rand 0.8.3", "static_assertions", ] [[package]] name = "zeroize" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" +checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1" dependencies = [ "proc-macro2", "quote", @@ -9784,18 +10885,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.5.4+zstd.1.4.7" +version = "0.6.1+zstd.1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69996ebdb1ba8b1517f61387a883857818a66c8a295f487b1ffd8fd9d2c82910" +checksum = "5de55e77f798f205d8561b8fe2ef57abfb6e0ff2abe7fd3c089e119cdb5631a3" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "2.0.6+zstd.1.4.7" +version = "3.0.1+zstd.1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98aa931fb69ecee256d44589d19754e61851ae4769bf963b385119b1cc37a49e" +checksum = "1387cabcd938127b30ce78c4bf00b30387dddf704e3f0881dbc4ff62b5566f8c" dependencies = [ "libc", "zstd-sys", @@ -9803,12 +10904,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.4.18+zstd.1.4.7" +version = "1.4.20+zstd.1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6e8778706838f43f771d80d37787cb2fe06dafe89dd3aebaf6721b9eaec81" +checksum = "ebd5b733d7cf2d9447e2c3e76a5589b4f5e5ae065c22a2bc0b023cbc331b6c8e" dependencies = [ "cc", - "glob 0.3.0", - "itertools 0.9.0", "libc", ] diff --git a/Cargo.toml b/Cargo.toml index 1f1eacad..e3e93f99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,16 +1,26 @@ [workspace] members = [ - "modules/edge-treasury-reward", - "modules/chainbridge", - "modules/edge-chainbridge", + "client/rpc/debug", + "client/rpc/trace", + "client/rpc/txpool", + "client/rpc-core/debug", + "client/rpc-core/trace", + "client/rpc-core/txpool", + "pallets/edge-treasury-reward", + "pallets/orml-nft", + "pallets/nft", "node/cli", + "node/opts", "node/executor", + "node/evm_tracer", "node/primitives", + "node/opts", "node/rpc", "node/rpc-client", "node/runtime", "node/runtime-interface", - "node/testing", + "node/debug", + "node/txpool", ] exclude = ["vendor"] @@ -66,157 +76,159 @@ x25519-dalek = { opt-level = 3 } yamux = { opt-level = 3 } zeroize = { opt-level = 3 } -# Generated with: `cargo lock -s | grep substrate.git | cut -d' ' -f2 | awk '{print $0, "= { git = \"https://github.com/paritytech/substrate.git\", rev = \"b2a50198d3fa71959c77d22edb5fdb8c1e74006c\" }"}'` +# Generated with: `cargo lock -s | grep substrate.git | cut -d' ' -f2 | awk '{print $0, "= { git = \"https://github.com/webb-tools/substrate.git\", rev = \"22f09c602704aeee2b59b14f427f73f6cb8b5e2f\" }"}'` # Make sure to have cargo-lock installed with: `cargo install cargo-lock --features=cli` [patch.crates-io] # frontier deps -fc-consensus = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -fc-rpc = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -fc-rpc-core = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -fp-consensus = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -fp-evm = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -fp-rpc = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -pallet-ethereum = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -pallet-evm = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -pallet-evm-precompile-ed25519 = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -pallet-evm-precompile-modexp = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } -pallet-evm-precompile-simple = { git = "https://github.com/hicommonwealth/frontier.git", rev = "d3179acb5a111d58af6c48a12588ecd38750a9bb" } +fc-consensus = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +fc-rpc = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +fc-rpc-core = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +fp-consensus = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +fp-evm = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +fp-rpc = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +pallet-dynamic-fee = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +pallet-ethereum = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +pallet-evm = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +pallet-evm-precompile-ed25519 = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +pallet-evm-precompile-modexp = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } +pallet-evm-precompile-simple = { git = "https://github.com/webb-tools/frontier.git", branch = "erup-4-minimal-changes" } # substrate deps -fork-tree = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-executive = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-metadata = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-support = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-support-procedural = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-support-procedural-tools = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-support-procedural-tools-derive = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-system = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-aura = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-authority-discovery = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-authorship = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-bounties = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-collective = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-contracts = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-contracts-proc-macro = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-contracts-rpc = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-contracts-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-democracy = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-grandpa = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-identity = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-im-online = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-indices = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-multisig = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-offences = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-proxy = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-recovery = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-session = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-staking = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-sudo = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-tips = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-treasury = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-utility = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -pallet-vesting = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-authority-discovery = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-block-builder = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-chain-spec-derive = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-cli = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-cli-proc-macro = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-client-api = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-client-db = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-consensus = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-consensus-slots = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-consensus-uncles = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-executor = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-executor-common = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-executor-wasmi = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-executor-wasmtime = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-informant = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-keystore = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-light = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-network = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-network-gossip = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-offchain = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-peerset = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-proposer-metrics = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-rpc = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-rpc-server = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-service = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-state-db = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-telemetry = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-tracing = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-transaction-graph = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-allocator = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-api = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-api-proc-macro = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-authorship = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-block-builder = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-blockchain = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-chain-spec = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-consensus = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-consensus-slots = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-consensus-vrf = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-core = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-database = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-debug-derive = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-externalities = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-io = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-keystore = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-npos-elections = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-npos-elections-compact = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-offchain = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-panic-handler = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-rpc = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-runtime-interface = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-runtime-interface-proc-macro = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-sandbox = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-serializer = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-session = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-staking = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-state-machine = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-std = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-storage = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-tasks = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-timestamp = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-tracing = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-trie = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-utils = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-version = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -sp-wasm-interface = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -substrate-browser-utils = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -substrate-frame-cli = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } -substrate-test-client = { git = "https://github.com/paritytech/substrate.git", rev = "b2a50198d3fa71959c77d22edb5fdb8c1e74006c" } +sc-finality-grandpa-warp-sync = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +fork-tree = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-benchmarking = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-benchmarking-cli = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-executive = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-metadata = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-support = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-support-procedural = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-support-procedural-tools = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-support-procedural-tools-derive = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-system = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +frame-system-rpc-runtime-api = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-assets = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-aura = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-authority-discovery = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-authorship = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-balances = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-bounties = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-collective = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-contracts = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-contracts-primitives = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-contracts-proc-macro = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-contracts-rpc = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-contracts-rpc-runtime-api = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-democracy = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-elections-phragmen = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-election-provider-multi-phase = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-grandpa = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-identity = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-im-online = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-indices = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-multisig = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-offences = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-proxy = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-randomness-collective-flip = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-recovery = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-scheduler = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-session = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-staking = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-staking-reward-curve = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-sudo = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-timestamp = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-tips = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-transaction-payment = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-transaction-payment-rpc = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-treasury = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-utility = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +pallet-vesting = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-authority-discovery = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-basic-authorship = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-block-builder = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-chain-spec = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-chain-spec-derive = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-cli = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-client-api = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-client-db = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-consensus = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-consensus-aura = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-consensus-babe = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-consensus-epochs = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-consensus-slots = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-consensus-uncles = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-executor = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-executor-common = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-executor-wasmi = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-executor-wasmtime = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-finality-grandpa = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-finality-grandpa-rpc = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-informant = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-keystore = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-light = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-network = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-network-gossip = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-offchain = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-peerset = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-proposer-metrics = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-rpc = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-rpc-api = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-rpc-server = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-service = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-state-db = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-telemetry = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-tracing = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-transaction-graph = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sc-transaction-pool = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-allocator = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-api = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-api-proc-macro = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-application-crypto = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-arithmetic = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-authority-discovery = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-authorship = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-block-builder = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-blockchain = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-chain-spec = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-consensus = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-consensus-aura = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-consensus-babe = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-consensus-slots = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-consensus-vrf = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-core = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-database = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-debug-derive = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-externalities = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-finality-grandpa = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-inherents = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-io = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-keyring = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-keystore = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-npos-elections = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-npos-elections-compact = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-offchain = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-panic-handler = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-rpc = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-runtime = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-runtime-interface = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-runtime-interface-proc-macro = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-sandbox = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-serializer = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-session = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-staking = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-state-machine = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-std = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-storage = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-tasks = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-timestamp = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-tracing = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-transaction-pool = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-trie = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-utils = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-version = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +sp-wasm-interface = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +substrate-browser-utils = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +substrate-frame-cli = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +substrate-frame-rpc-system = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } +substrate-prometheus-endpoint = { git = "https://github.com/webb-tools/substrate.git", branch = "erup-4" } diff --git a/client/rpc-core/debug/Cargo.toml b/client/rpc-core/debug/Cargo.toml new file mode 100644 index 00000000..7ebcdfd4 --- /dev/null +++ b/client/rpc-core/debug/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "edgeware-rpc-core-debug" +version = '0.1.0' +authors = ['PureStake'] +edition = '2018' +homepage = 'https://edgewa.re' +license = 'GPL-3.0-only' +repository = 'https://github.com/PureStake/moonbeam/' + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +futures = { version = "0.3", features = ["compat"] } +ethereum-types = "0.11.0" +jsonrpc-core = "15.0.0" +jsonrpc-core-client = "14.0.3" +jsonrpc-derive = "14.0.3" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +sp-core = { git = "https://github.com/webb-tools/substrate", branch = "erup-4" } +edgeware-rpc-primitives-debug = { path = "../../../node/debug" } +#evm = { version = "0.20.0", default-features = false, features = ["with-codec"] } diff --git a/client/rpc-core/debug/src/lib.rs b/client/rpc-core/debug/src/lib.rs new file mode 100644 index 00000000..abaab2bb --- /dev/null +++ b/client/rpc-core/debug/src/lib.rs @@ -0,0 +1,48 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . +use ethereum_types::H256; +use futures::{compat::Compat, future::BoxFuture}; +use jsonrpc_core::Result as RpcResult; +use jsonrpc_derive::rpc; +use serde::Deserialize; + +pub use rpc_impl_Debug::gen_server::Debug as DebugServer; +pub mod types { + pub use edgeware_rpc_primitives_debug::single; +} + +use crate::types::single; + +#[derive(Clone, Eq, PartialEq, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TraceParams { + pub disable_storage: Option, + pub disable_memory: Option, + pub disable_stack: Option, + /// Javascript tracer (we just check if it's Blockscout tracer string) + pub tracer: Option, + pub timeout: Option, +} + +#[rpc(server)] +pub trait Debug { + #[rpc(name = "debug_traceTransaction")] + fn trace_transaction( + &self, + transaction_hash: H256, + params: Option, + ) -> Compat>>; +} diff --git a/client/rpc-core/trace/Cargo.toml b/client/rpc-core/trace/Cargo.toml new file mode 100644 index 00000000..c3e153de --- /dev/null +++ b/client/rpc-core/trace/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "edgeware-rpc-core-trace" +version = '0.6.0' +authors = ['PureStake'] +edition = '2018' +homepage = 'https://edgewa.re' +license = 'GPL-3.0-only' +repository = 'https://github.com/PureStake/moonbeam/' + +[dependencies] +ethereum-types = "0.11.0" +jsonrpc-core = "15.0.0" +jsonrpc-core-client = "14.0.3" +jsonrpc-derive = "14.0.3" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +futures = { version = "0.3.1", features = ["compat"] } +edgeware-rpc-primitives-debug = { path = "../../../node/debug" } \ No newline at end of file diff --git a/client/rpc-core/trace/src/lib.rs b/client/rpc-core/trace/src/lib.rs new file mode 100644 index 00000000..98a48e15 --- /dev/null +++ b/client/rpc-core/trace/src/lib.rs @@ -0,0 +1,83 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +use ethereum_types::H160; +use futures::{compat::Compat, future::BoxFuture}; +use jsonrpc_derive::rpc; +pub use edgeware_rpc_primitives_debug::block::TransactionTrace; +use serde::{de::Error, Deserialize, Deserializer}; + +pub use rpc_impl_Trace::gen_server::Trace as TraceServer; + +#[rpc(server)] +pub trait Trace { + #[rpc(name = "trace_filter")] + fn filter( + &self, + filter: FilterRequest, + ) -> Compat>>>; +} + +#[derive(Clone, Eq, PartialEq, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct FilterRequest { + /// (optional?) From this block. + pub from_block: Option, + + /// (optional?) To this block. + pub to_block: Option, + + /// (optional) Sent from these addresses. + pub from_address: Option>, + + /// (optional) Sent to these addresses. + pub to_address: Option>, + + /// (optional) The offset trace number + pub after: Option, + + /// (optional) Integer number of traces to display in a batch. + pub count: Option, +} + +#[derive(Copy, Clone, Eq, PartialEq, Debug, Deserialize)] +#[serde(rename_all = "camelCase", untagged)] +pub enum RequestBlockId { + Number(#[serde(deserialize_with = "deserialize_u32_0x")] u32), + Tag(RequestBlockTag), +} + +#[derive(Copy, Clone, Eq, PartialEq, Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub enum RequestBlockTag { + Earliest, + Latest, + Pending, +} + +fn deserialize_u32_0x<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let buf = String::deserialize(deserializer)?; + + let parsed = match buf.strip_prefix("0x") { + Some(buf) => u32::from_str_radix(&buf, 16), + None => u32::from_str_radix(&buf, 10), + }; + + parsed.map_err(|e| Error::custom(format!("parsing error: {:?} from '{}'", e, buf))) +} diff --git a/client/rpc-core/txpool/Cargo.toml b/client/rpc-core/txpool/Cargo.toml new file mode 100644 index 00000000..3177ba5d --- /dev/null +++ b/client/rpc-core/txpool/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "edgeware-rpc-core-txpool" +version = '0.6.0' +authors = ['PureStake'] +edition = '2018' +homepage = 'https://edgewa.re' +license = 'GPL-3.0-only' +repository = 'https://github.com/PureStake/moonbeam/' + +[dependencies] +ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] } +ethereum-types = "0.11.0" +jsonrpc-core = "15.0.0" +jsonrpc-core-client = "14.0.3" +jsonrpc-derive = "14.0.3" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" + +fc-rpc-core = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } diff --git a/client/rpc-core/txpool/src/lib.rs b/client/rpc-core/txpool/src/lib.rs new file mode 100644 index 00000000..02fa94cb --- /dev/null +++ b/client/rpc-core/txpool/src/lib.rs @@ -0,0 +1,37 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +use ethereum_types::U256; +use jsonrpc_core::Result; +use jsonrpc_derive::rpc; + +mod types; + +pub use crate::types::{Get as GetT, Summary, Transaction, TransactionMap, TxPoolResult}; + +pub use rpc_impl_TxPool::gen_server::TxPool as TxPoolServer; + +#[rpc(server)] +pub trait TxPool { + #[rpc(name = "txpool_content")] + fn content(&self) -> Result>>; + + #[rpc(name = "txpool_inspect")] + fn inspect(&self) -> Result>>; + + #[rpc(name = "txpool_status")] + fn status(&self) -> Result>; +} diff --git a/client/rpc-core/txpool/src/types/content.rs b/client/rpc-core/txpool/src/types/content.rs new file mode 100644 index 00000000..afda3233 --- /dev/null +++ b/client/rpc-core/txpool/src/types/content.rs @@ -0,0 +1,85 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +use crate::GetT; +use ethereum::{Transaction as EthereumTransaction, TransactionAction}; +use ethereum_types::{H160, H256, U256}; +use fc_rpc_core::types::Bytes; +use serde::{Serialize, Serializer}; + +#[derive(Debug, Default, Clone, PartialEq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct Transaction { + /// Hash + pub hash: H256, + /// Nonce + pub nonce: U256, + /// Block hash + #[serde(serialize_with = "block_hash_serialize")] + pub block_hash: Option, + /// Block number + pub block_number: Option, + /// Sender + pub from: H160, + /// Recipient + #[serde(serialize_with = "to_serialize")] + pub to: Option, + /// Transfered value + pub value: U256, + /// Gas Price + pub gas_price: U256, + /// Gas + pub gas: U256, + /// Data + pub input: Bytes, + /// Transaction Index + pub transaction_index: Option, +} + +fn block_hash_serialize(hash: &Option, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("0x{:x}", hash.unwrap_or_default())) +} + +fn to_serialize(hash: &Option, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("0x{:x}", hash.unwrap_or_default())) +} + +impl GetT for Transaction { + fn get(hash: H256, from_address: H160, txn: &EthereumTransaction) -> Self { + Self { + hash, + nonce: txn.nonce, + block_hash: None, + block_number: None, + from: from_address, + to: match txn.action { + TransactionAction::Call(to) => Some(to), + _ => None, + }, + value: txn.value, + gas_price: txn.gas_price, + gas: txn.gas_limit, + input: Bytes(txn.input.clone()), + transaction_index: None, + } + } +} diff --git a/client/rpc-core/txpool/src/types/inspect.rs b/client/rpc-core/txpool/src/types/inspect.rs new file mode 100644 index 00000000..dc42b706 --- /dev/null +++ b/client/rpc-core/txpool/src/types/inspect.rs @@ -0,0 +1,58 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +use crate::GetT; +use ethereum::{Transaction as EthereumTransaction, TransactionAction}; +use ethereum_types::{H160, H256, U256}; +use serde::{Serialize, Serializer}; + +#[derive(Clone, Debug)] +pub struct Summary { + pub to: Option, + pub value: U256, + pub gas: U256, + pub gas_price: U256, +} + +impl Serialize for Summary { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let res = format!( + "0x{:x}: {} wei + {} gas x {} wei", + self.to.unwrap_or_default(), + self.value, + self.gas, + self.gas_price + ); + serializer.serialize_str(&res) + } +} + +impl GetT for Summary { + fn get(_hash: H256, _from_address: H160, txn: &EthereumTransaction) -> Self { + Self { + to: match txn.action { + TransactionAction::Call(to) => Some(to), + _ => None, + }, + value: txn.value, + gas_price: txn.gas_price, + gas: txn.gas_limit, + } + } +} diff --git a/client/rpc-core/txpool/src/types/mod.rs b/client/rpc-core/txpool/src/types/mod.rs new file mode 100644 index 00000000..d22c5ad3 --- /dev/null +++ b/client/rpc-core/txpool/src/types/mod.rs @@ -0,0 +1,38 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +mod content; +mod inspect; + +use ethereum::Transaction as EthereumTransaction; +use ethereum_types::{H160, H256, U256}; +use serde::Serialize; +use std::collections::HashMap; + +pub use self::content::Transaction; +pub use self::inspect::Summary; + +pub type TransactionMap = HashMap>; + +#[derive(Debug, Serialize)] +pub struct TxPoolResult { + pub pending: T, + pub queued: T, +} + +pub trait Get { + fn get(hash: H256, from_address: H160, txn: &EthereumTransaction) -> Self; +} diff --git a/client/rpc/debug/Cargo.toml b/client/rpc/debug/Cargo.toml new file mode 100644 index 00000000..d63f1e12 --- /dev/null +++ b/client/rpc/debug/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "edgeware-rpc-debug" +version = '0.1.0' +authors = ['PureStake'] +edition = '2018' +homepage = 'https://edgewa.re' +license = 'GPL-3.0-only' +repository = 'https://github.com/PureStake/moonbeam/' + +[dependencies] +tokio = { version = "0.2.21", features = ["sync", "time"] } +futures = { version = "0.3", features = ["compat"] } +jsonrpc-core = "15.0.0" + +ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] } +ethereum-types = "0.11.0" +sp-core = { git = "https://github.com/webb-tools/substrate", branch = "erup-4" } +sp-api = { git = "https://github.com/webb-tools/substrate", branch = "erup-4" } +sp-io = { git = "https://github.com/webb-tools/substrate", branch = "erup-4" } +sp-blockchain = { git = "https://github.com/webb-tools/substrate", branch = "erup-4" } +sc-client-api = { git = "https://github.com/webb-tools/substrate", branch = "erup-4" } +sp-block-builder = { git = "https://github.com/webb-tools/substrate", branch = "erup-4" } +sp-runtime = { git = "https://github.com/webb-tools/substrate", branch = "erup-4" } +sp-utils = { git = "https://github.com/webb-tools/substrate", branch = "erup-4" } + +edgeware-rpc-core-debug = { path = "../../rpc-core/debug" } +edgeware-rpc-primitives-debug = { path = "../../../node/debug" } +fc-consensus = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-db = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-rpc = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fp-rpc = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } diff --git a/client/rpc/debug/src/lib.rs b/client/rpc/debug/src/lib.rs new file mode 100644 index 00000000..62077968 --- /dev/null +++ b/client/rpc/debug/src/lib.rs @@ -0,0 +1,248 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . +use futures::{ + compat::Compat, + future::{BoxFuture, TryFutureExt}, + FutureExt, SinkExt, StreamExt, +}; +use jsonrpc_core::Result as RpcResult; +pub use edgeware_rpc_core_debug::{Debug as DebugT, DebugServer, TraceParams}; + +use tokio::{ + self, + sync::{oneshot, Semaphore}, +}; + +use ethereum_types::{H128, H256}; +use fc_rpc::{frontier_backend_client, internal_err}; +use fp_rpc::EthereumRuntimeRPCApi; +use edgeware_rpc_primitives_debug::{single, DebugRuntimeApi}; +use sc_client_api::backend::Backend; +use sp_api::{BlockId, HeaderT, ProvideRuntimeApi}; +use sp_block_builder::BlockBuilder; +use sp_blockchain::{ + Backend as BlockchainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata, +}; +use sp_runtime::traits::Block as BlockT; +use sp_utils::mpsc::TracingUnboundedSender; +use std::{future::Future, marker::PhantomData, str::FromStr, sync::Arc}; + +pub type Responder = oneshot::Sender>; +pub type DebugRequester = TracingUnboundedSender<((H256, Option), Responder)>; + +pub struct Debug { + pub requester: DebugRequester, +} + +impl Debug { + pub fn new(requester: DebugRequester) -> Self { + Self { requester } + } +} + +impl DebugT for Debug { + /// Handler for `debug_traceTransaction` request. Communicates with the service-defined task + /// using channels. + fn trace_transaction( + &self, + transaction_hash: H256, + params: Option, + ) -> Compat>> { + let mut requester = self.requester.clone(); + + async move { + let (tx, rx) = oneshot::channel(); + // Send a message from the rpc handler to the service level task. + requester + .send(((transaction_hash, params), tx)) + .await + .map_err(|err| { + internal_err(format!( + "failed to send request to debug service : {:?}", + err + )) + })?; + + // Receive a message from the service level task and send the rpc response. + rx.await.map_err(|err| { + internal_err(format!("debug service dropped the channel : {:?}", err)) + })? + } + .boxed() + .compat() + } +} + +pub struct DebugHandler(PhantomData<(B, C, BE)>); + +impl DebugHandler +where + BE: Backend + 'static, + C: ProvideRuntimeApi, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, + B: BlockT + Send + Sync + 'static, + C::Api: BlockBuilder, + C::Api: DebugRuntimeApi, + C::Api: EthereumRuntimeRPCApi, +{ + /// Task spawned at service level that listens for messages on the rpc channel and spawns + /// blocking tasks using a permit pool. + pub fn task( + client: Arc, + backend: Arc, + frontier_backend: Arc>, + permit_pool: Arc, + ) -> (impl Future, DebugRequester) { + let (tx, mut rx): (DebugRequester, _) = + sp_utils::mpsc::tracing_unbounded("debug-requester"); + + let fut = async move { + loop { + if let Some(((transaction_hash, params), response_tx)) = rx.next().await { + let client = client.clone(); + let backend = backend.clone(); + let frontier_backend = frontier_backend.clone(); + let permit_pool = permit_pool.clone(); + // Note on spawned tasks https://tokio.rs/tokio/tutorial/spawning#tasks. + // + // Substrate uses the default value for `core_threads` (number of cores of the + // machine running the node) and `max_threads` (512 total). + // + // Task below is spawned in the substrate's built tokio::Runtime, so they share + // the same thread pool as the rest of the service-spawned tasks. Additionally, + // blocking tasks use a more restrictive permit pool shared by trace modules. + // https://docs.rs/tokio/0.2.23/tokio/sync/struct.Semaphore.html + tokio::task::spawn(async move { + let _ = response_tx.send( + async { + let _permit = permit_pool.acquire().await; + tokio::task::spawn_blocking(move || { + Self::handle_request( + client.clone(), + backend.clone(), + frontier_backend.clone(), + transaction_hash, + params, + ) + }) + .await + .map_err(|e| { + internal_err(format!( + "Internal error on spawned task : {:?}", + e + )) + })? + } + .await, + ); + }); + } + } + }; + (fut, tx) + } + /// Replays a transaction in the Runtime at a given block height. + /// + /// In order to succesfully reproduce the result of the original transaction we need a correct + /// state to replay over. + /// + /// Substrate allows to apply extrinsics in the Runtime and thus creating an overlayed state. + /// This overlayed changes will live in-memory for the lifetime of the ApiRef. + fn handle_request( + client: Arc, + backend: Arc, + frontier_backend: Arc>, + transaction_hash: H256, + params: Option, + ) -> RpcResult { + let (hash, index) = match frontier_backend_client::load_transactions::( + client.as_ref(), + frontier_backend.as_ref(), + transaction_hash, + ) { + Ok(Some((hash, index))) => (hash, index as usize), + Ok(None) => return Err(internal_err("Transaction hash not found".to_string())), + Err(e) => return Err(e), + }; + + let reference_id = + match frontier_backend_client::load_hash::(frontier_backend.as_ref(), hash) { + Ok(Some(hash)) => hash, + Ok(_) => return Err(internal_err("Block hash not found".to_string())), + Err(e) => return Err(e), + }; + // Get ApiRef. This handle allow to keep changes between txs in an internal buffer. + let api = client.runtime_api(); + // Get Blockchain backend + let blockchain = backend.blockchain(); + // Get the header I want to work with. + let header = client.header(reference_id).unwrap().unwrap(); + // Get parent blockid. + let parent_block_id = BlockId::Hash(*header.parent_hash()); + + // Get the extrinsics. + let ext = blockchain.body(reference_id).unwrap().unwrap(); + + // Get the block that contains the requested transaction. + let reference_block = match api.current_block(&reference_id) { + Ok(block) => block, + Err(e) => return Err(internal_err(format!("Runtime block call failed: {:?}", e))), + }; + + // Set trace type + let trace_type = match params { + Some(TraceParams { + tracer: Some(tracer), + .. + }) => { + let hash: H128 = sp_io::hashing::twox_128(&tracer.as_bytes()).into(); + let blockscout_hash = H128::from_str("0x94d9f08796f91eb13a2e82a6066882f7").unwrap(); + if hash == blockscout_hash { + single::TraceType::CallList + } else { + return Err(internal_err(format!( + "javascript based tracing is not available (hash :{:?})", + hash + ))); + } + } + Some(params) => single::TraceType::Raw { + disable_storage: params.disable_storage.unwrap_or(false), + disable_memory: params.disable_memory.unwrap_or(false), + disable_stack: params.disable_stack.unwrap_or(false), + }, + _ => single::TraceType::Raw { + disable_storage: false, + disable_memory: false, + disable_stack: false, + }, + }; + + // Get the actual ethereum transaction. + if let Some(block) = reference_block { + let transactions = block.transactions; + if let Some(transaction) = transactions.get(index) { + return client + .runtime_api() + .trace_transaction(&parent_block_id, ext, &transaction, trace_type) + .map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))? + .map_err(|e| internal_err(format!("DispatchError: {:?}", e))); + } + } + return Err(internal_err("Runtime block call failed".to_string())); + } +} diff --git a/client/rpc/trace/Cargo.toml b/client/rpc/trace/Cargo.toml new file mode 100644 index 00000000..d61204cc --- /dev/null +++ b/client/rpc/trace/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "edgeware-rpc-trace" +version = '0.6.0' +authors = ['PureStake'] +edition = '2018' +homepage = 'https://edgewa.re' +license = 'GPL-3.0-only' +repository = 'https://github.com/PureStake/moonbeam/' + +[dependencies] +# Utils +serde = { version = "1.0", features = ["derive"] } +sha3 = "0.8" +ethereum-types = "0.11.0" +ethereum = { version = "0.7.1", features = ["with-codec"] } + +# Async and logs +tokio = { version = "0.2.13", features = ["sync", "time"] } +futures = { version = "0.3", features = ["compat"] } +tracing = "0.1.25" + +# Primitives +sp-runtime = {version = "*" } +sp-utils = {version = "*" } +sp-api = {version = "*" } +sp-io = {version = "*" } +sp-std = {version = "*" } +sp-blockchain = {version = "*" } +sp-transaction-pool = {version = "*" } +sp-block-builder = {version = "*" } +fp-rpc = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +edgeware-rpc-primitives-debug = { path = "../../../node/debug" } + +# Client and RPC +jsonrpc-core = "15.0.0" +sc-client-api = {version = "*" } +sc-network = {version = "*" } +sc-transaction-graph = {version = "*" } +fc-rpc = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-consensus = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-rpc-core = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +edgeware-rpc-core-trace = { path = "../../rpc-core/trace" } diff --git a/client/rpc/trace/src/lib.rs b/client/rpc/trace/src/lib.rs new file mode 100644 index 00000000..85ec23e8 --- /dev/null +++ b/client/rpc/trace/src/lib.rs @@ -0,0 +1,885 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +//! `trace_filter` RPC handler and its associated service task. +//! The RPC handler rely on `CacheTask` which provides a future that must be run inside a tokio +//! executor. +//! +//! The implementation is composed of multiple tasks : +//! - Many calls the the RPC handler `Trace::filter`, communicating with the main task. +//! - A main `CacheTask` managing the cache and the communication between tasks. +//! - For each traced block an async task responsible to wait for a permit, spawn a blocking +//! task and waiting for the result, then send it to the main `CacheTask`. + +use futures::{ + compat::Compat, + future::{BoxFuture, TryFutureExt}, + select, + stream::FuturesUnordered, + FutureExt, SinkExt, StreamExt, +}; +use std::{collections::BTreeMap, future::Future, marker::PhantomData, sync::Arc, time::Duration}; +use tokio::{ + sync::{mpsc, oneshot, Semaphore}, + time::delay_for, +}; +use tracing::{instrument, Instrument}; + +use jsonrpc_core::Result; +use sc_client_api::backend::Backend; +use sp_api::{BlockId, HeaderT, ProvideRuntimeApi}; +use sp_block_builder::BlockBuilder; +use sp_blockchain::{ + Backend as BlockchainBackend, Error as BlockChainError, HeaderBackend, HeaderMetadata, +}; +use sp_runtime::traits::Block as BlockT; +use sp_utils::mpsc::TracingUnboundedSender; + +use ethereum_types::H256; +use fc_rpc::internal_err; +use fp_rpc::EthereumRuntimeRPCApi; + +pub use edgeware_rpc_core_trace::{ + FilterRequest, RequestBlockId, RequestBlockTag, Trace as TraceT, TraceServer, TransactionTrace, +}; +use edgeware_rpc_primitives_debug::{block, DebugRuntimeApi}; + +/// RPC handler. Will communicate with a `CacheTask` through a `CacheRequester`. +pub struct Trace { + _phantom: PhantomData, + client: Arc, + requester: CacheRequester, + max_count: u32, +} + +impl Clone for Trace { + fn clone(&self) -> Self { + Self { + _phantom: PhantomData::default(), + client: Arc::clone(&self.client), + requester: self.requester.clone(), + max_count: self.max_count, + } + } +} + +impl Trace +where + B: BlockT + Send + Sync + 'static, + B::Header: HeaderT, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, +{ + /// Create a new RPC handler. + pub fn new(client: Arc, requester: CacheRequester, max_count: u32) -> Self { + Self { + client, + requester, + max_count, + _phantom: PhantomData::default(), + } + } + + /// Convert an optional block ID (number or tag) to a block height. + fn block_id(&self, id: Option) -> Result { + match id { + Some(RequestBlockId::Number(n)) => Ok(n), + None | Some(RequestBlockId::Tag(RequestBlockTag::Latest)) => { + Ok(self.client.info().best_number) + } + Some(RequestBlockId::Tag(RequestBlockTag::Earliest)) => Ok(0), + Some(RequestBlockId::Tag(RequestBlockTag::Pending)) => { + Err(internal_err("'pending' is not supported")) + } + } + } + + /// `trace_filter` endpoint (wrapped in the trait implementation with futures compatibilty) + async fn filter(self, req: FilterRequest) -> Result> { + let from_block = self.block_id(req.from_block)?; + let to_block = self.block_id(req.to_block)?; + let block_heights = from_block..=to_block; + + let count = req.count.unwrap_or(self.max_count); + if count > self.max_count { + return Err(internal_err(format!( + "count ({}) can't be greater than maximum ({})", + count, self.max_count + ))); + } + + // Build a list of all the Substrate block hashes that need to be traced. + let mut block_hashes = vec![]; + for block_height in block_heights { + if block_height == 0 { + continue; // no traces for genesis block. + } + + let block_id = BlockId::::Number(block_height); + let block_header = self + .client + .header(block_id) + .map_err(|e| { + internal_err(format!( + "Error when fetching block {} header : {:?}", + block_height, e + )) + })? + .ok_or_else(|| { + internal_err(format!("Block with height {} don't exist", block_height)) + })?; + + let block_hash = block_header.hash(); + + block_hashes.push(block_hash); + } + + // Start a batch with these blocks. + let batch_id = self.requester.start_batch(block_hashes.clone()).await?; + // Fetch all the traces. It is done in another function to simplify error handling and allow + // to call the following `stop_batch` regardless of the result. This is important for the + // cache cleanup to work properly. + let res = self.fetch_traces(req, &block_hashes, count as usize).await; + // Stop the batch, allowing the cache task to remove useless non-started block traces and + // start the expiration delay. + self.requester.stop_batch(batch_id).await; + + res + } + + async fn fetch_traces( + &self, + req: FilterRequest, + block_hashes: &[H256], + count: usize, + ) -> Result> { + let from_address = req.from_address.unwrap_or_default(); + let to_address = req.to_address.unwrap_or_default(); + + let mut traces_amount: i64 = -(req.after.unwrap_or(0) as i64); + let mut traces = vec![]; + + for &block_hash in block_hashes { + // Request the traces of this block to the cache service. + // This will resolve quickly if the block is already cached, or wait until the block + // has finished tracing. + let block_traces = self.requester.get_traces(block_hash).await?; + + // Filter addresses. + let mut block_traces: Vec<_> = block_traces + .iter() + .filter(|trace| match trace.action { + block::TransactionTraceAction::Call { from, to, .. } => { + (from_address.is_empty() || from_address.contains(&from)) + && (to_address.is_empty() || to_address.contains(&to)) + } + block::TransactionTraceAction::Create { from, .. } => { + (from_address.is_empty() || from_address.contains(&from)) + && to_address.is_empty() + } + block::TransactionTraceAction::Suicide { address, .. } => { + (from_address.is_empty() || from_address.contains(&address)) + && to_address.is_empty() + } + }) + .cloned() + .collect(); + + // Don't insert anything if we're still before "after" + traces_amount += block_traces.len() as i64; + if traces_amount > 0 { + let traces_amount = traces_amount as usize; + // If the current Vec of traces is across the "after" marker, + // we skip some elements of it. + if traces_amount < block_traces.len() { + let skip = block_traces.len() - traces_amount; + block_traces = block_traces.into_iter().skip(skip).collect(); + } + + traces.append(&mut block_traces); + + // If we go over "count" (the limit), we trim and exit the loop, + // unless we used the default maximum, in which case we return an error. + if traces_amount >= count { + if req.count.is_none() { + return Err(internal_err(format!( + "the amount of traces goes over the maximum ({}), please use 'after' \ + and 'count' in your request", + self.max_count + ))); + } + + traces = traces.into_iter().take(count).collect(); + break; + } + } + } + + Ok(traces) + } +} + +impl TraceT for Trace +where + B: BlockT + Send + Sync + 'static, + B::Header: HeaderT, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, +{ + fn filter( + &self, + filter: FilterRequest, + ) -> Compat>>> { + // Wraps the async function into futures compatibility layer. + self.clone().filter(filter).boxed().compat() + } +} + +/// An opaque batch ID. +#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +pub struct CacheBatchId(u64); + +/// Requests the cache task can accept. +enum CacheRequest { + /// Request to start caching the provided range of blocks. + /// The task will add to blocks to its pool and immediately return a new batch ID. + StartBatch { + /// Returns the ID of the batch for cancellation. + sender: oneshot::Sender, + /// List of block hash to trace. + blocks: Vec, + }, + /// Fetch the traces for given block hash. + /// The task will answer only when it has processed this block. + GetTraces { + /// Returns the array of traces or an error. + sender: oneshot::Sender>>, + /// Hash of the block. + block: H256, + }, + /// Notify the cache that it can stop the batch with that ID. Any block contained only in + /// this batch and still not started will be discarded. + StopBatch { batch_id: CacheBatchId }, +} + +/// Allows to interact with the cache task. +#[derive(Clone)] +pub struct CacheRequester(TracingUnboundedSender); + +impl CacheRequester { + /// Request to start caching the provided range of blocks. + /// The task will add to blocks to its pool and immediately return the batch ID. + #[instrument(skip(self))] + pub async fn start_batch(&self, blocks: Vec) -> Result { + let (response_tx, response_rx) = oneshot::channel(); + let mut sender = self.0.clone(); + + sender + .send(CacheRequest::StartBatch { + sender: response_tx, + blocks, + }) + .await + .map_err(|e| { + internal_err(format!( + "Failed to send request to the trace cache task. Error : {:?}", + e + )) + })?; + + response_rx.await.map_err(|e| { + internal_err(format!( + "Trace cache task closed the response channel. Error : {:?}", + e + )) + }) + } + + /// Fetch the traces for given block hash. + /// The task will answer only when it has processed this block. + /// The block should be part of a batch first. If no batch has requested the block it will + /// return an error. + #[instrument(skip(self))] + pub async fn get_traces(&self, block: H256) -> Result> { + let (response_tx, response_rx) = oneshot::channel(); + let mut sender = self.0.clone(); + + sender + .send(CacheRequest::GetTraces { + sender: response_tx, + block, + }) + .await + .map_err(|e| { + internal_err(format!( + "Failed to send request to the trace cache task. Error : {:?}", + e + )) + })?; + + response_rx + .await + .map_err(|e| { + internal_err(format!( + "Trace cache task closed the response channel. Error : {:?}", + e + )) + })? + .map_err(|e| internal_err(format!("Failed to replay block. Error : {:?}", e))) + } + + /// Notify the cache that it can stop the batch with that ID. Any block contained only in + /// this batch and still in the waiting pool will be discarded. + #[instrument(skip(self))] + pub async fn stop_batch(&self, batch_id: CacheBatchId) { + let mut sender = self.0.clone(); + + // Here we don't care if the request has been accepted or refused, the caller can't + // do anything with it. + let _ = sender + .send(CacheRequest::StopBatch { batch_id }) + .await + .map_err(|e| { + internal_err(format!( + "Failed to send request to the trace cache task. Error : {:?}", + e + )) + }); + } +} + +/// Data stored for each block in the cache. +/// `active_batch_count` represents the number of batches using this +/// block. It will increase immediatly when a batch is created, but will be +/// decrease only after the batch ends and its expiration delay passes. +/// It allows to keep the data in the cache for following requests that would use +/// this block, which is important to handle pagination efficiently. +struct CacheBlock { + active_batch_count: usize, + state: CacheBlockState, +} + +/// State of a cached block. It can either be polled to be traced or cached. +enum CacheBlockState { + /// Block has been added to the pool blocks to be replayed. + /// It may be currently waiting to be replayed or being replayed. + Pooled { + started: bool, + /// Multiple requests might query the same block while it is pooled to be + /// traced. They response channel is stored here, and the result will be + /// sent in all of them when the tracing is finished. + waiting_requests: Vec>>>, + /// Channel used to unqueue a tracing that has not yet started. + /// A tracing will be unqueued if it has not yet been started and the last batch + /// needing this block is ended (ignoring the expiration delay). + /// It is not used directly, but dropping will wake up the receiver. + #[allow(dead_code)] + unqueue_sender: oneshot::Sender<()>, + }, + /// Tracing has completed and the result is available. No Runtime API call + /// will be needed until this block cache is removed. + Cached { + traces: Result>, + }, +} + +/// Tracing a block is done in a separate tokio blocking task to avoid clogging the async threads. +/// For this reason a channel using this type is used by the blocking task to communicate with the +/// main cache task. +enum BlockingTaskMessage { + /// Notify the tracing for this block has started as the blocking task got a permit from + /// the semaphore. This is used to prevent the deletion of a cache entry for a block that has + /// started being traced. + Started { block_hash: H256 }, + /// The tracing is finished and the result is send to the main task. + Finished { + block_hash: H256, + result: Result>, + }, +} + +/// Type wrapper for the cache task, generic over the Client, Block and Backend types. +pub struct CacheTask { + client: Arc, + backend: Arc, + blocking_permits: Arc, + cached_blocks: BTreeMap, + batches: BTreeMap>, + next_batch_id: u64, + _phantom: PhantomData, +} + +impl CacheTask +where + BE: Backend + 'static, + C: ProvideRuntimeApi, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, + B: BlockT + Send + Sync + 'static, + B::Header: HeaderT, + C::Api: BlockBuilder, + C::Api: DebugRuntimeApi, + C::Api: EthereumRuntimeRPCApi, +{ + /// Create a new cache task. + /// + /// Returns a Future that needs to be added to a tokio executor, and an handle allowing to + /// send requests to the task. + pub fn create( + client: Arc, + backend: Arc, + cache_duration: Duration, + blocking_permits: Arc, + ) -> (impl Future, CacheRequester) { + // Communication with the outside world : + let (requester_tx, mut requester_rx) = + sp_utils::mpsc::tracing_unbounded("trace-filter-cache"); + + // Task running in the service. + let task = async move { + // The following variables are polled by the select! macro, and thus cannot be + // part of Self without introducing borrowing issues. + let mut batch_expirations = FuturesUnordered::new(); + let (blocking_tx, blocking_rx) = + mpsc::channel(blocking_permits.available_permits() * 2); + let mut blocking_rx = blocking_rx.fuse(); + + // Contains the inner state of the cache task, excluding the pooled futures/channels. + // Having this object allow to refactor each event into its own function, simplifying + // the main loop. + let mut inner = Self { + client, + backend, + blocking_permits, + cached_blocks: BTreeMap::new(), + batches: BTreeMap::new(), + next_batch_id: 0, + _phantom: Default::default(), + }; + + // Main event loop. This loop must not contain any direct .await, as we want to + // react to events as fast as possible. + loop { + select! { + request = requester_rx.next() => { + match request { + None => break, + Some(CacheRequest::StartBatch {sender, blocks}) + => inner.request_start_batch(&blocking_tx, sender, blocks), + Some(CacheRequest::GetTraces {sender, block}) + => inner.request_get_traces(sender, block), + Some(CacheRequest::StopBatch {batch_id}) => { + // Cannot be refactored inside `request_stop_batch` because + // it has an unnamable type :C + batch_expirations.push(async move { + delay_for(cache_duration).await; + batch_id + }); + + inner.request_stop_batch(batch_id); + }, + } + }, + message = blocking_rx.next() => { + match message { + None => (), + Some(BlockingTaskMessage::Started { block_hash }) + => inner.blocking_started(block_hash), + Some(BlockingTaskMessage::Finished { block_hash, result }) + => inner.blocking_finished(block_hash, result), + } + }, + batch_id = batch_expirations.next() => { + match batch_id { + None => (), + Some(batch_id) => inner.expired_batch(batch_id), + } + } + } + } + } + .instrument(tracing::debug_span!("trace_filter_cache")); + + (task, CacheRequester(requester_tx)) + } + + /// Handle the creation of a batch. + /// Will start the tracing process for blocks that are not already in the cache. + #[instrument(skip(self, blocking_tx, sender, blocks))] + fn request_start_batch( + &mut self, + blocking_tx: &mpsc::Sender, + sender: oneshot::Sender, + blocks: Vec, + ) { + tracing::trace!("Starting batch {}", self.next_batch_id); + self.batches.insert(self.next_batch_id, blocks.clone()); + + for block in blocks { + // The block is already in the cache, awesome ! + if let Some(block_cache) = self.cached_blocks.get_mut(&block) { + block_cache.active_batch_count += 1; + tracing::trace!( + "Cache hit for block {}, now used by {} batches.", + block, + block_cache.active_batch_count + ); + } + // Otherwise we need to queue this block for tracing. + else { + tracing::trace!("Cache miss for block {}, pooling it for tracing.", block); + + let blocking_permits = Arc::clone(&self.blocking_permits); + let (unqueue_sender, unqueue_receiver) = oneshot::channel(); + let client = Arc::clone(&self.client); + let backend = Arc::clone(&self.backend); + let mut blocking_tx = blocking_tx.clone(); + + // Spawn all block caching asynchronously. + // It will wait to obtain a permit, then spawn a blocking task. + // When the blocking task returns its result, it is send + // thought a channel to the main task loop. + tokio::spawn( + async move { + tracing::trace!("Waiting for blocking permit or task cancellation"); + let _permit = select!( + _ = unqueue_receiver.fuse() => { + tracing::trace!("Tracing of the block has been cancelled."); + return; + }, + permit = blocking_permits.acquire().fuse() => permit, + ); + + // Warn the main task that block tracing as started, and + // this block cache entry should not be removed. + let _ = blocking_tx + .send(BlockingTaskMessage::Started { block_hash: block }) + .await; + + tracing::trace!("Start block tracing in a blocking task."); + + // Perform block tracing in a tokio blocking task. + let result = async { + tokio::task::spawn_blocking(move || { + Self::cache_block(client, backend, block) + }) + .await + .map_err(|e| { + internal_err(format!( + "Tracing Substrate block {} panicked : {:?}", + block, e + )) + })? + } + .await; + + tracing::trace!("Block tracing finished, sending result to main task."); + + // Send response to main task. + let _ = blocking_tx + .send(BlockingTaskMessage::Finished { + block_hash: block, + result, + }) + .await; + } + .instrument(tracing::trace_span!("Block tracing", block = %block)), + ); + + // Insert the block in the cache. + self.cached_blocks.insert( + block, + CacheBlock { + active_batch_count: 1, + state: CacheBlockState::Pooled { + started: false, + waiting_requests: vec![], + unqueue_sender, + }, + }, + ); + } + } + + // Respond with the batch ID. + let _ = sender.send(CacheBatchId(self.next_batch_id)); + + // Increase batch ID for next request. + self.next_batch_id = self.next_batch_id.overflowing_add(1).0; + } + + /// Handle a request to get the traces of the provided block. + /// - If the result is stored in the cache, it sends it immediatly. + /// - If the block is currently being pooled, it is added in this block cache waiting list, + /// and all requests concerning this block will be satisfied when the tracing for this block + /// is finished. + /// - If this block is missing from the cache, it means no batch asked for it. All requested + /// blocks should be contained in a batch beforehand, and thus an error is returned. + #[instrument(skip(self))] + fn request_get_traces( + &mut self, + sender: oneshot::Sender>>, + block: H256, + ) { + if let Some(block_cache) = self.cached_blocks.get_mut(&block) { + match &mut block_cache.state { + CacheBlockState::Pooled { + ref mut waiting_requests, + .. + } => { + tracing::warn!( + "A request asked a pooled block ({}), adding it to the list of \ + waiting requests.", + block + ); + waiting_requests.push(sender); + } + CacheBlockState::Cached { ref traces, .. } => { + tracing::warn!( + "A request asked a cached block ({}), sending the traces directly.", + block + ); + let _ = sender.send(traces.clone()); + } + } + } else { + tracing::warn!( + "An RPC request asked to get a block ({}) which was not batched.", + block + ); + let _ = sender.send(Err(internal_err(format!( + "RPC request asked a block ({}) that was not batched", + block + )))); + } + } + + /// Handle a request to stop a batch. + /// For all blocks that needed to be traced, are only in this batch and not yet started, their + /// tracing is cancelled to save CPU-time and avoid attacks requesting large amount of blocks. + /// This batch data is not yet removed however. Instead a expiration delay timer is started + /// after which the data will indeed be cleared. (the code for that is in the main loop code + /// as it involved an unnamable type :C) + #[instrument(skip(self))] + fn request_stop_batch(&mut self, batch_id: CacheBatchId) { + tracing::trace!("Stopping batch {}", batch_id.0); + if let Some(blocks) = self.batches.get(&batch_id.0) { + for block in blocks { + let mut remove = false; + + // We remove early the block cache if this batch is the last + // pooling this block. + if let Some(block_cache) = self.cached_blocks.get_mut(block) { + if block_cache.active_batch_count == 1 + && matches!( + block_cache.state, + CacheBlockState::Pooled { started: false, .. } + ) { + remove = true; + } + } + + if remove { + tracing::trace!("Pooled block {} is no longer requested.", block); + // Remove block from the cache. Drops the value, + // closing all the channels contained in it. + let _ = self.cached_blocks.remove(&block); + } + } + } + } + + /// A tracing blocking task notifies it got a permit and is starting the tracing. + /// This started status is stored to avoid removing this block entry. + #[instrument(skip(self))] + fn blocking_started(&mut self, block_hash: H256) { + if let Some(block_cache) = self.cached_blocks.get_mut(&block_hash) { + if let CacheBlockState::Pooled { + ref mut started, .. + } = block_cache.state + { + *started = true; + } + } + } + + /// A tracing blocking task notifies it has finished the tracing and provide the result. + #[instrument(skip(self, result))] + fn blocking_finished(&mut self, block_hash: H256, result: Result>) { + // In some cases it might be possible to receive traces of a block + // that has no entry in the cache because it was removed of the pool + // and received a permit concurrently. We just ignore it. + // + // TODO : Should we add it back ? Should it have an active_batch_count + // of 1 then ? + if let Some(block_cache) = self.cached_blocks.get_mut(&block_hash) { + if let CacheBlockState::Pooled { + ref mut waiting_requests, + .. + } = block_cache.state + { + tracing::trace!( + "A new block ({}) has been traced, adding it to the cache and responding to \ + {} waiting requests.", + block_hash, + waiting_requests.len() + ); + // Send result in waiting channels + while let Some(channel) = waiting_requests.pop() { + let _ = channel.send(result.clone()); + } + + // Update cache entry + block_cache.state = CacheBlockState::Cached { traces: result }; + } + } + } + + /// A batch expiration delay timer has completed. It performs the cache cleaning for blocks + /// not longer used by other batches. + #[instrument(skip(self))] + fn expired_batch(&mut self, batch_id: CacheBatchId) { + if let Some(batch) = self.batches.remove(&batch_id.0) { + for block in batch { + // For each block of the batch, we remove it if it was the + // last batch containing it. + let mut remove = false; + if let Some(block_cache) = self.cached_blocks.get_mut(&block) { + block_cache.active_batch_count -= 1; + + if block_cache.active_batch_count == 0 { + remove = true; + } + } + + if remove { + let _ = self.cached_blocks.remove(&block); + } + } + } + } + + /// (In blocking task) Use the Runtime API to trace the block. + #[instrument(skip(client, backend))] + fn cache_block( + client: Arc, + backend: Arc, + substrate_hash: H256, + ) -> Result> { + let substrate_block_id = BlockId::Hash(substrate_hash); + + // Get Subtrate block data. + let api = client.runtime_api(); + let block_header = client + .header(substrate_block_id) + .map_err(|e| { + internal_err(format!( + "Error when fetching substrate block {} header : {:?}", + substrate_hash, e + )) + })? + .ok_or_else(|| { + internal_err(format!("Subtrate block {} don't exist", substrate_block_id)) + })?; + + let height = *block_header.number(); + let substrate_parent_id = BlockId::::Hash(*block_header.parent_hash()); + + // Get Ethereum block data. + let (eth_block, _, eth_transactions) = api + .current_all(&BlockId::Hash(substrate_hash)) + .map_err(|e| { + internal_err(format!( + "Failed to get Ethereum block data for Substrate block {} : {:?}", + substrate_hash, e + )) + })?; + + let (eth_block, eth_transactions) = match (eth_block, eth_transactions) { + (Some(a), Some(b)) => (a, b), + _ => { + return Err(internal_err(format!( + "Failed to get Ethereum block data for Substrate block {}", + substrate_hash + ))) + } + }; + + let eth_block_hash = eth_block.header.hash(); + + // Get extrinsics (containing Ethereum ones) + let extrinsics = backend + .blockchain() + .body(substrate_block_id) + .map_err(|e| { + internal_err(format!( + "Blockchain error when fetching extrinsics of block {} : {:?}", + height, e + )) + })? + .ok_or_else(|| { + internal_err(format!( + "Could not find block {} when fetching extrinsics.", + height + )) + })?; + + // Trace the block. + let mut traces: Vec<_> = api + .trace_block(&substrate_parent_id, extrinsics) + .map_err(|e| { + internal_err(format!( + "Blockchain error when replaying block {} : {:?}", + height, e + )) + })? + .map_err(|e| { + internal_err(format!( + "Internal runtime error when replaying block {} : {:?}", + height, e + )) + })?; + + // Fill missing data. + for trace in traces.iter_mut() { + trace.block_hash = eth_block_hash; + trace.block_number = height; + trace.transaction_hash = eth_transactions + .get(trace.transaction_position as usize) + .ok_or_else(|| { + tracing::warn!( + "Bug: A transaction has been replayed while it shouldn't (in block {}).", + height + ); + + internal_err(format!( + "Bug: A transaction has been replayed while it shouldn't (in block {}).", + height + )) + })? + .transaction_hash; + + // Reformat error messages. + if let block::TransactionTraceOutput::Error(ref mut error) = trace.output { + if error.as_slice() == b"execution reverted" { + *error = b"Reverted".to_vec(); + } + } + } + + Ok(traces) + } +} diff --git a/client/rpc/txpool/Cargo.toml b/client/rpc/txpool/Cargo.toml new file mode 100644 index 00000000..3dc0b8f8 --- /dev/null +++ b/client/rpc/txpool/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "edgeware-rpc-txpool" +version = '0.6.0' +authors = ['PureStake'] +edition = '2018' +homepage = 'https://edgewa.re' +license = 'GPL-3.0-only' +repository = 'https://github.com/PureStake/moonbeam/' + +[dependencies] +sha3 = "0.8" +jsonrpc-core = "15.0.0" +ethereum-types = "0.11.0" +ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] } +edgeware-rpc-core-txpool = { path = "../../rpc-core/txpool" } +sp-runtime = { version = "3.0" } +sp-api = { version = "3.0" } +sp-io = { version = "3.0" } +sp-std = { version = "3.0" } +sp-blockchain = { version = "3.0" } +sp-transaction-pool = { version = "3.0" } +sc-transaction-graph = { version = "3.0" } +frame-system = { version = "3.0" } +serde = { version = "1.0", features = ["derive"] } + +edgeware-rpc-primitives-txpool = { path = "../../../node/txpool" } +fc-rpc = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } \ No newline at end of file diff --git a/client/rpc/txpool/src/lib.rs b/client/rpc/txpool/src/lib.rs new file mode 100644 index 00000000..68ef481d --- /dev/null +++ b/client/rpc/txpool/src/lib.rs @@ -0,0 +1,148 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +use ethereum::TransactionMessage; +use ethereum_types::{H160, H256, U256}; +use fc_rpc::{internal_err, public_key}; +use jsonrpc_core::Result as RpcResult; +pub use edgeware_rpc_core_txpool::{ + GetT, Summary, Transaction, TransactionMap, TxPool as TxPoolT, TxPoolResult, TxPoolServer, +}; +use sc_transaction_graph::{ChainApi, Pool}; +use serde::Serialize; +use sha3::{Digest, Keccak256}; +use sp_api::{BlockId, ProvideRuntimeApi}; +use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use sp_runtime::traits::Block as BlockT; +use sp_transaction_pool::InPoolTransaction; +use std::collections::HashMap; +use std::{marker::PhantomData, sync::Arc}; + +use edgeware_rpc_primitives_txpool::{TxPoolResponse, TxPoolRuntimeApi}; + +pub struct TxPool { + client: Arc, + graph: Arc>, + _marker: PhantomData, +} + +impl TxPool +where + C: ProvideRuntimeApi, + C: HeaderMetadata + HeaderBackend + 'static, + C: Send + Sync + 'static, + B: BlockT + Send + Sync + 'static, + A: ChainApi + 'static, + C::Api: TxPoolRuntimeApi, +{ + /// Use the transaction graph interface to get the extrinsics currently in the ready and future + /// queues. + fn map_build(&self) -> RpcResult>> + where + T: GetT + Serialize, + { + // Collect transactions in the ready validated pool. + let txs_ready = self + .graph + .validated_pool() + .ready() + .map(|in_pool_tx| in_pool_tx.data().clone()) + .collect(); + + // Collect transactions in the future validated pool. + let txs_future = self + .graph + .validated_pool() + .futures() + .iter() + .map(|(_hash, extrinsic)| extrinsic.clone()) + .collect(); + + // Use the runtime to match the (here) opaque extrinsics against ethereum transactions. + let best_block: BlockId = BlockId::Hash(self.client.info().best_hash); + let ethereum_txns: TxPoolResponse = self + .client + .runtime_api() + .extrinsic_filter(&best_block, txs_ready, txs_future) + .map_err(|err| { + internal_err(format!("fetch runtime extrinsic filter failed: {:?}", err)) + })?; + // Build the T response. + let mut pending = TransactionMap::::new(); + for txn in ethereum_txns.ready.iter() { + let transaction_message = TransactionMessage::from(txn.clone()); + let hash = transaction_message.hash(); + let from_address = match public_key(txn) { + Ok(pk) => H160::from(H256::from_slice(Keccak256::digest(&pk).as_slice())), + Err(_e) => H160::default(), + }; + pending + .entry(from_address) + .or_insert_with(HashMap::new) + .insert(txn.nonce, T::get(hash, from_address, txn)); + } + let mut queued = TransactionMap::::new(); + for txn in ethereum_txns.future.iter() { + let transaction_message = TransactionMessage::from(txn.clone()); + let hash = transaction_message.hash(); + let from_address = match public_key(txn) { + Ok(pk) => H160::from(H256::from_slice(Keccak256::digest(&pk).as_slice())), + Err(_e) => H160::default(), + }; + queued + .entry(from_address) + .or_insert_with(HashMap::new) + .insert(txn.nonce, T::get(hash, from_address, txn)); + } + Ok(TxPoolResult { pending, queued }) + } +} + +impl TxPool { + pub fn new(client: Arc, graph: Arc>) -> Self { + Self { + client, + graph, + _marker: PhantomData, + } + } +} + +impl TxPoolT for TxPool +where + C: ProvideRuntimeApi, + C: HeaderMetadata + HeaderBackend, + C: Send + Sync + 'static, + B: BlockT + Send + Sync + 'static, + A: ChainApi + 'static, + C::Api: TxPoolRuntimeApi, +{ + fn content(&self) -> RpcResult>> { + self.map_build::() + } + + fn inspect(&self) -> RpcResult>> { + self.map_build::() + } + + fn status(&self) -> RpcResult> { + let status = self.graph.validated_pool().status(); + Ok(TxPoolResult { + pending: U256::from(status.ready), + queued: U256::from(status.future), + }) + } +} diff --git a/modules/chainbridge/Cargo.toml b/modules/chainbridge/Cargo.toml deleted file mode 100644 index 7ba7c261..00000000 --- a/modules/chainbridge/Cargo.toml +++ /dev/null @@ -1,41 +0,0 @@ -[package] -name = 'chainbridge' -version = '1.0.0' -authors = ['david@chainsafe.io'] -edition = '2018' - -[dependencies] -# third-party dependencies -codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] } -serde = { version = "1.0.101", optional = true } - -# primitives -sp-std = { version = "2.0", default-features = false } -sp-runtime = { version = "2.0", default-features = false } -sp-io = { version = "2.0", default-features = false } -sp-core = { version = "2.0", default-features = false } - -# frame dependencies -frame-support = { version = "2.0", default-features = false } -frame-system = { version = "2.0", default-features = false } - -pallet-balances = { version = "2.0", default-features = false } - -[features] -default = ["std"] -std = [ - "codec/std", - "serde", - "sp-std/std", - "sp-runtime/std", - "sp-io/std", - "sp-core/std", - "frame-support/std", - "frame-system/std", - "pallet-balances/std", -] - -runtime-benchmarks = [ - "sp-runtime/runtime-benchmarks", - "frame-system/runtime-benchmarks", -] \ No newline at end of file diff --git a/modules/chainbridge/src/lib.rs b/modules/chainbridge/src/lib.rs deleted file mode 100644 index bb190bba..00000000 --- a/modules/chainbridge/src/lib.rs +++ /dev/null @@ -1,619 +0,0 @@ -// Ensure we're `no_std` when compiling for Wasm. -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_support::{ - decl_error, decl_event, decl_module, decl_storage, - dispatch::DispatchResult, - ensure, - traits::{EnsureOrigin, Get}, - weights::{GetDispatchInfo, Pays}, - Parameter, -}; - -use frame_system::{self as system, ensure_root, ensure_signed}; -use sp_core::U256; -use sp_runtime::traits::{AccountIdConversion, Dispatchable}; -use sp_runtime::{ModuleId, RuntimeDebug}; -use sp_std::prelude::*; - -use codec::{Decode, Encode, EncodeLike}; - -const DEFAULT_RELAYER_THRESHOLD: u32 = 1; -const MODULE_ID: ModuleId = ModuleId(*b"cb/bridg"); - -pub type ChainId = u8; -pub type DepositNonce = u64; -pub type ResourceId = [u8; 32]; - -/// Helper function to concatenate a chain ID and some bytes to produce a resource ID. -/// The common format is (31 bytes unique ID + 1 byte chain ID). -pub fn derive_resource_id(chain: u8, id: &[u8]) -> ResourceId { - let mut r_id: ResourceId = [0; 32]; - r_id[31] = chain; // last byte is chain id - let range = if id.len() > 31 { 31 } else { id.len() }; // Use at most 31 bytes - for i in 0..range { - r_id[30 - i] = id[range - 1 - i]; // Ensure left padding for eth compatibility - } - return r_id; -} - -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)] -pub enum ProposalStatus { - Initiated, - Approved, - Rejected, -} - -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)] -pub struct ProposalVotes { - pub votes_for: Vec, - pub votes_against: Vec, - pub status: ProposalStatus, - pub expiry: BlockNumber, -} - -impl ProposalVotes { - /// Attempts to mark the proposal as approve or rejected. - /// Returns true if the status changes from active. - fn try_to_complete(&mut self, threshold: u32, total: u32) -> ProposalStatus { - if self.votes_for.len() >= threshold as usize { - self.status = ProposalStatus::Approved; - ProposalStatus::Approved - } else if total >= threshold && self.votes_against.len() as u32 + threshold > total { - self.status = ProposalStatus::Rejected; - ProposalStatus::Rejected - } else { - ProposalStatus::Initiated - } - } - - /// Returns true if the proposal has been rejected or approved, otherwise false. - fn is_complete(&self) -> bool { - self.status != ProposalStatus::Initiated - } - - /// Returns true if `who` has voted for or against the proposal - fn has_voted(&self, who: &A) -> bool { - self.votes_for.contains(&who) || self.votes_against.contains(&who) - } - - /// Return true if the expiry time has been reached - fn is_expired(&self, now: B) -> bool { - self.expiry <= now - } -} - -impl Default for ProposalVotes { - fn default() -> Self { - Self { - votes_for: vec![], - votes_against: vec![], - status: ProposalStatus::Initiated, - expiry: BlockNumber::default(), - } - } -} - -pub trait Config: system::Config { - type Event: From> + Into<::Event>; - /// Origin used to administer the pallet - type AdminOrigin: EnsureOrigin; - /// Proposed dispatchable call - type Proposal: Parameter + Dispatchable + EncodeLike + GetDispatchInfo; - /// The identifier for this chain. - /// This must be unique and must not collide with existing IDs within a set of bridged chains. - type ChainId: Get; - - type ProposalLifetime: Get; -} - -decl_event! { - pub enum Event where ::AccountId { - /// Vote threshold has changed (new_threshold) - RelayerThresholdChanged(u32), - /// Chain now available for transfers (chain_id) - ChainWhitelisted(ChainId), - /// Relayer added to set - RelayerAdded(AccountId), - /// Relayer removed from set - RelayerRemoved(AccountId), - /// FunglibleTransfer is for relaying fungibles (dest_id, nonce, resource_id, amount, recipient, metadata) - FungibleTransfer(ChainId, DepositNonce, ResourceId, U256, Vec), - /// NonFungibleTransfer is for relaying NFTS (dest_id, nonce, resource_id, token_id, recipient, metadata) - NonFungibleTransfer(ChainId, DepositNonce, ResourceId, Vec, Vec, Vec), - /// GenericTransfer is for a generic data payload (dest_id, nonce, resource_id, metadata) - GenericTransfer(ChainId, DepositNonce, ResourceId, Vec), - /// Vote submitted in favour of proposal - VoteFor(ChainId, DepositNonce, AccountId), - /// Vot submitted against proposal - VoteAgainst(ChainId, DepositNonce, AccountId), - /// Voting successful for a proposal - ProposalApproved(ChainId, DepositNonce), - /// Voting rejected a proposal - ProposalRejected(ChainId, DepositNonce), - /// Execution of call succeeded - ProposalSucceeded(ChainId, DepositNonce), - /// Execution of call failed - ProposalFailed(ChainId, DepositNonce), - } -} - -decl_error! { - pub enum Error for Module { - /// Relayer threshold not set - ThresholdNotSet, - /// Provided chain Id is not valid - InvalidChainId, - /// Relayer threshold cannot be 0 - InvalidThreshold, - /// Interactions with this chain is not permitted - ChainNotWhitelisted, - /// Chain has already been enabled - ChainAlreadyWhitelisted, - /// Resource ID provided isn't mapped to anything - ResourceDoesNotExist, - /// Relayer already in set - RelayerAlreadyExists, - /// Provided accountId is not a relayer - RelayerInvalid, - /// Protected operation, must be performed by relayer - MustBeRelayer, - /// Relayer has already submitted some vote for this proposal - RelayerAlreadyVoted, - /// A proposal with these parameters has already been submitted - ProposalAlreadyExists, - /// No proposal with the ID was found - ProposalDoesNotExist, - /// Cannot complete proposal, needs more votes - ProposalNotComplete, - /// Proposal has either failed or succeeded - ProposalAlreadyComplete, - /// Lifetime of proposal has been exceeded - ProposalExpired, - } -} - -decl_storage! { - trait Store for Module as ChainBridge { - /// All whitelisted chains and their respective transaction counts - ChainNonces get(fn chains): map hasher(opaque_blake2_256) ChainId => Option; - - /// Number of votes required for a proposal to execute - RelayerThreshold get(fn relayer_threshold): u32 = DEFAULT_RELAYER_THRESHOLD; - - /// Tracks current relayer set - pub Relayers get(fn relayers): map hasher(opaque_blake2_256) T::AccountId => bool; - - /// Number of relayers in set - pub RelayerCount get(fn relayer_count): u32; - - /// All known proposals. - /// The key is the hash of the call and the deposit ID, to ensure it's unique. - pub Votes get(fn votes): - double_map hasher(opaque_blake2_256) ChainId, hasher(opaque_blake2_256) (DepositNonce, T::Proposal) - => Option>; - - /// Utilized by the bridge software to map resource IDs to actual methods - pub Resources get(fn resources): - map hasher(opaque_blake2_256) ResourceId => Option> - } -} - -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - type Error = Error; - - const ChainIdentity: ChainId = T::ChainId::get(); - const ProposalLifetime: T::BlockNumber = T::ProposalLifetime::get(); - const BridgeAccountId: T::AccountId = MODULE_ID.into_account(); - - fn deposit_event() = default; - - /// Sets the vote threshold for proposals. - /// - /// This threshold is used to determine how many votes are required - /// before a proposal is executed. - /// - /// # - /// - O(1) lookup and insert - /// # - #[weight = 195_000_000] - pub fn set_threshold(origin, threshold: u32) -> DispatchResult { - Self::ensure_admin(origin)?; - Self::set_relayer_threshold(threshold) - } - - /// Stores a method name on chain under an associated resource ID. - /// - /// # - /// - O(1) write - /// # - #[weight = 195_000_000] - pub fn set_resource(origin, id: ResourceId, method: Vec) -> DispatchResult { - Self::ensure_admin(origin)?; - Self::register_resource(id, method) - } - - /// Removes a resource ID from the resource mapping. - /// - /// After this call, bridge transfers with the associated resource ID will - /// be rejected. - /// - /// # - /// - O(1) removal - /// # - #[weight = 195_000_000] - pub fn remove_resource(origin, id: ResourceId) -> DispatchResult { - Self::ensure_admin(origin)?; - Self::unregister_resource(id) - } - - /// Enables a chain ID as a source or destination for a bridge transfer. - /// - /// # - /// - O(1) lookup and insert - /// # - #[weight = 195_000_000] - pub fn whitelist_chain(origin, id: ChainId) -> DispatchResult { - Self::ensure_admin(origin)?; - Self::whitelist(id) - } - - /// Adds a new relayer to the relayer set. - /// - /// # - /// - O(1) lookup and insert - /// # - #[weight = 195_000_000] - pub fn add_relayer(origin, v: T::AccountId) -> DispatchResult { - Self::ensure_admin(origin)?; - Self::register_relayer(v) - } - - /// Removes an existing relayer from the set. - /// - /// # - /// - O(1) lookup and removal - /// # - #[weight = 195_000_000] - pub fn remove_relayer(origin, v: T::AccountId) -> DispatchResult { - Self::ensure_admin(origin)?; - Self::unregister_relayer(v) - } - - /// Commits a vote in favour of the provided proposal. - /// - /// If a proposal with the given nonce and source chain ID does not already exist, it will - /// be created with an initial vote in favour from the caller. - /// - /// # - /// - weight of proposed call, regardless of whether execution is performed - /// # - #[weight = (call.get_dispatch_info().weight + 195_000_000, call.get_dispatch_info().class, Pays::Yes)] - pub fn acknowledge_proposal(origin, nonce: DepositNonce, src_id: ChainId, r_id: ResourceId, call: Box<::Proposal>) -> DispatchResult { - let who = ensure_signed(origin)?; - ensure!(Self::is_relayer(&who), Error::::MustBeRelayer); - ensure!(Self::chain_whitelisted(src_id), Error::::ChainNotWhitelisted); - ensure!(Self::resource_exists(r_id), Error::::ResourceDoesNotExist); - - Self::vote_for(who, nonce, src_id, call) - } - - /// Commits a vote against a provided proposal. - /// - /// # - /// - Fixed, since execution of proposal should not be included - /// # - #[weight = 195_000_000] - pub fn reject_proposal(origin, nonce: DepositNonce, src_id: ChainId, r_id: ResourceId, call: Box<::Proposal>) -> DispatchResult { - let who = ensure_signed(origin)?; - ensure!(Self::is_relayer(&who), Error::::MustBeRelayer); - ensure!(Self::chain_whitelisted(src_id), Error::::ChainNotWhitelisted); - ensure!(Self::resource_exists(r_id), Error::::ResourceDoesNotExist); - - Self::vote_against(who, nonce, src_id, call) - } - - /// Evaluate the state of a proposal given the current vote threshold. - /// - /// A proposal with enough votes will be either executed or cancelled, and the status - /// will be updated accordingly. - /// - /// # - /// - weight of proposed call, regardless of whether execution is performed - /// # - #[weight = (prop.get_dispatch_info().weight + 195_000_000, prop.get_dispatch_info().class, Pays::Yes)] - pub fn eval_vote_state(origin, nonce: DepositNonce, src_id: ChainId, prop: Box<::Proposal>) -> DispatchResult { - ensure_signed(origin)?; - - Self::try_resolve_proposal(nonce, src_id, prop) - } - } -} - -impl Module { - // *** Utility methods *** - - pub fn ensure_admin(o: T::Origin) -> DispatchResult { - T::AdminOrigin::try_origin(o) - .map(|_| ()) - .or_else(ensure_root)?; - Ok(()) - } - - /// Checks if who is a relayer - pub fn is_relayer(who: &T::AccountId) -> bool { - Self::relayers(who) - } - - /// Provides an AccountId for the pallet. - /// This is used both as an origin check and deposit/withdrawal account. - pub fn account_id() -> T::AccountId { - MODULE_ID.into_account() - } - - /// Asserts if a resource is registered - pub fn resource_exists(id: ResourceId) -> bool { - return Self::resources(id) != None; - } - - /// Checks if a chain exists as a whitelisted destination - pub fn chain_whitelisted(id: ChainId) -> bool { - return Self::chains(id) != None; - } - - /// Increments the deposit nonce for the specified chain ID - fn bump_nonce(id: ChainId) -> DepositNonce { - let nonce = Self::chains(id).unwrap_or_default() + 1; - ::insert(id, nonce); - nonce - } - - // *** Admin methods *** - - /// Set a new voting threshold - pub fn set_relayer_threshold(threshold: u32) -> DispatchResult { - ensure!(threshold > 0, Error::::InvalidThreshold); - ::put(threshold); - Self::deposit_event(RawEvent::RelayerThresholdChanged(threshold)); - Ok(()) - } - - /// Register a method for a resource Id, enabling associated transfers - pub fn register_resource(id: ResourceId, method: Vec) -> DispatchResult { - ::insert(id, method); - Ok(()) - } - - /// Removes a resource ID, disabling associated transfer - pub fn unregister_resource(id: ResourceId) -> DispatchResult { - ::remove(id); - Ok(()) - } - - /// Whitelist a chain ID for transfer - pub fn whitelist(id: ChainId) -> DispatchResult { - // Cannot whitelist this chain - ensure!(id != T::ChainId::get(), Error::::InvalidChainId); - // Cannot whitelist with an existing entry - ensure!( - !Self::chain_whitelisted(id), - Error::::ChainAlreadyWhitelisted - ); - ::insert(&id, 0); - Self::deposit_event(RawEvent::ChainWhitelisted(id)); - Ok(()) - } - - /// Adds a new relayer to the set - pub fn register_relayer(relayer: T::AccountId) -> DispatchResult { - ensure!( - !Self::is_relayer(&relayer), - Error::::RelayerAlreadyExists - ); - >::insert(&relayer, true); - ::mutate(|i| *i += 1); - - Self::deposit_event(RawEvent::RelayerAdded(relayer)); - Ok(()) - } - - /// Removes a relayer from the set - pub fn unregister_relayer(relayer: T::AccountId) -> DispatchResult { - ensure!(Self::is_relayer(&relayer), Error::::RelayerInvalid); - >::remove(&relayer); - ::mutate(|i| *i -= 1); - Self::deposit_event(RawEvent::RelayerRemoved(relayer)); - Ok(()) - } - - // *** Proposal voting and execution methods *** - - /// Commits a vote for a proposal. If the proposal doesn't exist it will be created. - fn commit_vote( - who: T::AccountId, - nonce: DepositNonce, - src_id: ChainId, - prop: Box, - in_favour: bool, - ) -> DispatchResult { - let now = >::block_number(); - let mut votes = match >::get(src_id, (nonce, prop.clone())) { - Some(v) => v, - None => { - let mut v = ProposalVotes::default(); - v.expiry = now + T::ProposalLifetime::get(); - v - } - }; - - // Ensure the proposal isn't complete and relayer hasn't already voted - ensure!(!votes.is_complete(), Error::::ProposalAlreadyComplete); - ensure!(!votes.is_expired(now), Error::::ProposalExpired); - ensure!(!votes.has_voted(&who), Error::::RelayerAlreadyVoted); - - if in_favour { - votes.votes_for.push(who.clone()); - Self::deposit_event(RawEvent::VoteFor(src_id, nonce, who.clone())); - } else { - votes.votes_against.push(who.clone()); - Self::deposit_event(RawEvent::VoteAgainst(src_id, nonce, who.clone())); - } - - >::insert(src_id, (nonce, prop.clone()), votes.clone()); - - Ok(()) - } - - /// Attempts to finalize or cancel the proposal if the vote count allows. - fn try_resolve_proposal( - nonce: DepositNonce, - src_id: ChainId, - prop: Box, - ) -> DispatchResult { - if let Some(mut votes) = >::get(src_id, (nonce, prop.clone())) { - let now = >::block_number(); - ensure!(!votes.is_complete(), Error::::ProposalAlreadyComplete); - ensure!(!votes.is_expired(now), Error::::ProposalExpired); - - let status = votes.try_to_complete(::get(), ::get()); - >::insert(src_id, (nonce, prop.clone()), votes.clone()); - - match status { - ProposalStatus::Approved => Self::finalize_execution(src_id, nonce, prop), - ProposalStatus::Rejected => Self::cancel_execution(src_id, nonce), - _ => Ok(()), - } - } else { - Err(Error::::ProposalDoesNotExist)? - } - } - - /// Commits a vote in favour of the proposal and executes it if the vote threshold is met. - fn vote_for( - who: T::AccountId, - nonce: DepositNonce, - src_id: ChainId, - prop: Box, - ) -> DispatchResult { - Self::commit_vote(who, nonce, src_id, prop.clone(), true)?; - Self::try_resolve_proposal(nonce, src_id, prop) - } - - /// Commits a vote against the proposal and cancels it if more than (relayers.len() - threshold) - /// votes against exist. - fn vote_against( - who: T::AccountId, - nonce: DepositNonce, - src_id: ChainId, - prop: Box, - ) -> DispatchResult { - Self::commit_vote(who, nonce, src_id, prop.clone(), false)?; - Self::try_resolve_proposal(nonce, src_id, prop) - } - - /// Execute the proposal and signals the result as an event - fn finalize_execution( - src_id: ChainId, - nonce: DepositNonce, - call: Box, - ) -> DispatchResult { - Self::deposit_event(RawEvent::ProposalApproved(src_id, nonce)); - call.dispatch(frame_system::RawOrigin::Signed(Self::account_id()).into()) - .map(|_| ()) - .map_err(|e| e.error)?; - Self::deposit_event(RawEvent::ProposalSucceeded(src_id, nonce)); - Ok(()) - } - - /// Cancels a proposal. - fn cancel_execution(src_id: ChainId, nonce: DepositNonce) -> DispatchResult { - Self::deposit_event(RawEvent::ProposalRejected(src_id, nonce)); - Ok(()) - } - - /// Initiates a transfer of a fungible asset out of the chain. This should be called by another pallet. - pub fn transfer_fungible( - dest_id: ChainId, - resource_id: ResourceId, - to: Vec, - amount: U256, - ) -> DispatchResult { - ensure!( - Self::chain_whitelisted(dest_id), - Error::::ChainNotWhitelisted - ); - let nonce = Self::bump_nonce(dest_id); - Self::deposit_event(RawEvent::FungibleTransfer( - dest_id, - nonce, - resource_id, - amount, - to, - )); - Ok(()) - } - - /// Initiates a transfer of a nonfungible asset out of the chain. This should be called by another pallet. - pub fn transfer_nonfungible( - dest_id: ChainId, - resource_id: ResourceId, - token_id: Vec, - to: Vec, - metadata: Vec, - ) -> DispatchResult { - ensure!( - Self::chain_whitelisted(dest_id), - Error::::ChainNotWhitelisted - ); - let nonce = Self::bump_nonce(dest_id); - Self::deposit_event(RawEvent::NonFungibleTransfer( - dest_id, - nonce, - resource_id, - token_id, - to, - metadata, - )); - Ok(()) - } - - /// Initiates a transfer of generic data out of the chain. This should be called by another pallet. - pub fn transfer_generic( - dest_id: ChainId, - resource_id: ResourceId, - metadata: Vec, - ) -> DispatchResult { - ensure!( - Self::chain_whitelisted(dest_id), - Error::::ChainNotWhitelisted - ); - let nonce = Self::bump_nonce(dest_id); - Self::deposit_event(RawEvent::GenericTransfer( - dest_id, - nonce, - resource_id, - metadata, - )); - Ok(()) - } -} - - -/// Simple ensure origin for the bridge account -pub struct EnsureBridge(sp_std::marker::PhantomData); -impl EnsureOrigin for EnsureBridge { - type Success = T::AccountId; - fn try_origin(o: T::Origin) -> Result { - let bridge_id = MODULE_ID.into_account(); - o.into().and_then(|o| match o { - system::RawOrigin::Signed(who) if who == bridge_id => Ok(bridge_id), - r => Err(T::Origin::from(r)), - }) - } - - #[cfg(feature = "runtime-benchmarks")] - fn successful_origin() -> T::Origin { - T::Origin::from(frame_system::RawOrigin::Root) - } -} diff --git a/modules/chainbridge/src/mock.rs b/modules/chainbridge/src/mock.rs deleted file mode 100644 index 4dedb0f7..00000000 --- a/modules/chainbridge/src/mock.rs +++ /dev/null @@ -1,154 +0,0 @@ -#![cfg(test)] - -use super::*; - -use frame_support::{assert_ok, ord_parameter_types, parameter_types, weights::Weight}; -use frame_system::{self as system}; -use sp_core::H256; -use sp_runtime::{ - testing::Header, - traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, IdentityLookup}, - Perbill, -}; - -use crate::{self as bridge, Config}; -pub use pallet_balances as balances; - -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const MaximumBlockWeight: Weight = 1024; - pub const MaximumBlockLength: u32 = 2 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::one(); - pub const MaxLocks: u32 = 100; -} - -impl frame_system::Config for Test { - type BaseCallFilter = (); - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type Origin = Origin; - type Index = u64; - type Call = (); - type BlockNumber = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type Header = Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = (); - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); -} - -parameter_types! { - pub const ExistentialDeposit: u64 = 1; -} - -ord_parameter_types! { - pub const One: u64 = 1; -} - -impl pallet_balances::Config for Test { - type Balance = u64; - type DustRemoval = (); - type Event = Event; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type MaxLocks = MaxLocks; - type WeightInfo = (); -} - -parameter_types! { - pub const TestChainId: u8 = 5; - pub const ProposalLifetime: u64 = 50; -} - -impl Config for Test { - type Event = Event; - type AdminOrigin = frame_system::EnsureRoot; - type Proposal = Call; - type ChainId = TestChainId; - type ProposalLifetime = ProposalLifetime; -} - -pub type Block = sp_runtime::generic::Block; -pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; - -frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - System: system::{Module, Call, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - Bridge: bridge::{Module, Call, Storage, Event}, - } -); - -// pub const BRIDGE_ID: u64 = -pub const RELAYER_A: u64 = 0x2; -pub const RELAYER_B: u64 = 0x3; -pub const RELAYER_C: u64 = 0x4; -pub const ENDOWED_BALANCE: u64 = 100_000_000; -pub const TEST_THRESHOLD: u32 = 2; - -pub fn new_test_ext() -> sp_io::TestExternalities { - let bridge_id = ModuleId(*b"cb/bridg").into_account(); - let mut t = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap(); - pallet_balances::GenesisConfig:: { - balances: vec![(bridge_id, ENDOWED_BALANCE)], - } - .assimilate_storage(&mut t) - .unwrap(); - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(1)); - ext -} - -pub fn new_test_ext_initialized( - src_id: ChainId, - r_id: ResourceId, - resource: Vec, -) -> sp_io::TestExternalities { - let mut t = new_test_ext(); - t.execute_with(|| { - // Set and check threshold - assert_ok!(Bridge::set_threshold(Origin::root(), TEST_THRESHOLD)); - assert_eq!(Bridge::relayer_threshold(), TEST_THRESHOLD); - // Add relayers - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_A)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_B)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_C)); - // Whitelist chain - assert_ok!(Bridge::whitelist_chain(Origin::root(), src_id)); - // Set and check resource ID mapped to some junk data - assert_ok!(Bridge::set_resource(Origin::root(), r_id, resource)); - assert_eq!(Bridge::resource_exists(r_id), true); - }); - t -} - -// Checks events against the latest. A contiguous set of events must be provided. They must -// include the most recent event, but do not have to include every past event. -pub fn assert_events(mut expected: Vec) { - let mut actual: Vec = system::Module::::events() - .iter() - .map(|e| e.event.clone()) - .collect(); - - expected.reverse(); - - for evt in expected { - let next = actual.pop().expect("event expected"); - assert_eq!(next, evt.into(), "Events don't match (actual,expected)"); - } -} diff --git a/modules/chainbridge/src/test.rs b/modules/chainbridge/src/test.rs deleted file mode 100644 index 3a8bec20..00000000 --- a/modules/chainbridge/src/test.rs +++ /dev/null @@ -1,534 +0,0 @@ -#![cfg(test)] - -use super::mock::{ - assert_events, new_test_ext, Balances, Bridge, Call, Event, Origin, ProposalLifetime, System, - Test, TestChainId, ENDOWED_BALANCE, RELAYER_A, RELAYER_B, RELAYER_C, TEST_THRESHOLD, -}; -use super::*; -use crate::mock::new_test_ext_initialized; -use frame_support::{assert_noop, assert_ok}; - -#[test] -fn derive_ids() { - let chain = 1; - let id = [ - 0x21, 0x60, 0x5f, 0x71, 0x84, 0x5f, 0x37, 0x2a, 0x9e, 0xd8, 0x42, 0x53, 0xd2, 0xd0, 0x24, - 0xb7, 0xb1, 0x09, 0x99, 0xf4, - ]; - let r_id = derive_resource_id(chain, &id); - let expected = [ - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x21, 0x60, 0x5f, 0x71, 0x84, 0x5f, - 0x37, 0x2a, 0x9e, 0xd8, 0x42, 0x53, 0xd2, 0xd0, 0x24, 0xb7, 0xb1, 0x09, 0x99, 0xf4, chain, - ]; - assert_eq!(r_id, expected); -} - -#[test] -fn complete_proposal_approved() { - let mut prop = ProposalVotes { - votes_for: vec![1, 2], - votes_against: vec![3], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get(), - }; - - prop.try_to_complete(2, 3); - assert_eq!(prop.status, ProposalStatus::Approved); -} - -#[test] -fn complete_proposal_rejected() { - let mut prop = ProposalVotes { - votes_for: vec![1], - votes_against: vec![2, 3], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get(), - }; - - prop.try_to_complete(2, 3); - assert_eq!(prop.status, ProposalStatus::Rejected); -} - -#[test] -fn complete_proposal_bad_threshold() { - let mut prop = ProposalVotes { - votes_for: vec![1, 2], - votes_against: vec![], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get(), - }; - - prop.try_to_complete(3, 2); - assert_eq!(prop.status, ProposalStatus::Initiated); - - let mut prop = ProposalVotes { - votes_for: vec![], - votes_against: vec![1, 2], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get(), - }; - - prop.try_to_complete(3, 2); - assert_eq!(prop.status, ProposalStatus::Initiated); -} - -#[test] -fn setup_resources() { - new_test_ext().execute_with(|| { - let id: ResourceId = [1; 32]; - let method = "Pallet.do_something".as_bytes().to_vec(); - let method2 = "Pallet.do_somethingElse".as_bytes().to_vec(); - - assert_ok!(Bridge::set_resource(Origin::root(), id, method.clone())); - assert_eq!(Bridge::resources(id), Some(method)); - - assert_ok!(Bridge::set_resource(Origin::root(), id, method2.clone())); - assert_eq!(Bridge::resources(id), Some(method2)); - - assert_ok!(Bridge::remove_resource(Origin::root(), id)); - assert_eq!(Bridge::resources(id), None); - }) -} - -#[test] -fn whitelist_chain() { - new_test_ext().execute_with(|| { - assert!(!Bridge::chain_whitelisted(0)); - - assert_ok!(Bridge::whitelist_chain(Origin::root(), 0)); - assert_noop!( - Bridge::whitelist_chain(Origin::root(), TestChainId::get()), - Error::::InvalidChainId - ); - - assert_events(vec![Event::bridge(RawEvent::ChainWhitelisted(0))]); - }) -} - -#[test] -fn set_get_threshold() { - new_test_ext().execute_with(|| { - assert_eq!(::get(), 1); - - assert_ok!(Bridge::set_threshold(Origin::root(), TEST_THRESHOLD)); - assert_eq!(::get(), TEST_THRESHOLD); - - assert_ok!(Bridge::set_threshold(Origin::root(), 5)); - assert_eq!(::get(), 5); - - assert_events(vec![ - Event::bridge(RawEvent::RelayerThresholdChanged(TEST_THRESHOLD)), - Event::bridge(RawEvent::RelayerThresholdChanged(5)), - ]); - }) -} - -#[test] -fn asset_transfer_success() { - new_test_ext().execute_with(|| { - let dest_id = 2; - let to = vec![2]; - let resource_id = [1; 32]; - let metadata = vec![]; - let amount = 100; - let token_id = vec![1, 2, 3, 4]; - - assert_ok!(Bridge::set_threshold(Origin::root(), TEST_THRESHOLD,)); - - assert_ok!(Bridge::whitelist_chain(Origin::root(), dest_id.clone())); - assert_ok!(Bridge::transfer_fungible( - dest_id.clone(), - resource_id.clone(), - to.clone(), - amount.into() - )); - assert_events(vec![ - Event::bridge(RawEvent::ChainWhitelisted(dest_id.clone())), - Event::bridge(RawEvent::FungibleTransfer( - dest_id.clone(), - 1, - resource_id.clone(), - amount.into(), - to.clone(), - )), - ]); - - assert_ok!(Bridge::transfer_nonfungible( - dest_id.clone(), - resource_id.clone(), - token_id.clone(), - to.clone(), - metadata.clone() - )); - assert_events(vec![Event::bridge(RawEvent::NonFungibleTransfer( - dest_id.clone(), - 2, - resource_id.clone(), - token_id, - to.clone(), - metadata.clone(), - ))]); - - assert_ok!(Bridge::transfer_generic( - dest_id.clone(), - resource_id.clone(), - metadata.clone() - )); - assert_events(vec![Event::bridge(RawEvent::GenericTransfer( - dest_id.clone(), - 3, - resource_id, - metadata, - ))]); - }) -} - -#[test] -fn asset_transfer_invalid_chain() { - new_test_ext().execute_with(|| { - let chain_id = 2; - let bad_dest_id = 3; - let resource_id = [4; 32]; - - assert_ok!(Bridge::whitelist_chain(Origin::root(), chain_id.clone())); - assert_events(vec![Event::bridge(RawEvent::ChainWhitelisted( - chain_id.clone(), - ))]); - - assert_noop!( - Bridge::transfer_fungible(bad_dest_id, resource_id.clone(), vec![], U256::zero()), - Error::::ChainNotWhitelisted - ); - - assert_noop!( - Bridge::transfer_nonfungible(bad_dest_id, resource_id.clone(), vec![], vec![], vec![]), - Error::::ChainNotWhitelisted - ); - - assert_noop!( - Bridge::transfer_generic(bad_dest_id, resource_id.clone(), vec![]), - Error::::ChainNotWhitelisted - ); - }) -} - -#[test] -fn add_remove_relayer() { - new_test_ext().execute_with(|| { - assert_ok!(Bridge::set_threshold(Origin::root(), TEST_THRESHOLD,)); - assert_eq!(Bridge::relayer_count(), 0); - - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_A)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_B)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_C)); - assert_eq!(Bridge::relayer_count(), 3); - - // Already exists - assert_noop!( - Bridge::add_relayer(Origin::root(), RELAYER_A), - Error::::RelayerAlreadyExists - ); - - // Confirm removal - assert_ok!(Bridge::remove_relayer(Origin::root(), RELAYER_B)); - assert_eq!(Bridge::relayer_count(), 2); - assert_noop!( - Bridge::remove_relayer(Origin::root(), RELAYER_B), - Error::::RelayerInvalid - ); - assert_eq!(Bridge::relayer_count(), 2); - - assert_events(vec![ - Event::bridge(RawEvent::RelayerAdded(RELAYER_A)), - Event::bridge(RawEvent::RelayerAdded(RELAYER_B)), - Event::bridge(RawEvent::RelayerAdded(RELAYER_C)), - Event::bridge(RawEvent::RelayerRemoved(RELAYER_B)), - ]); - }) -} - -fn make_proposal(r: Vec) -> mock::Call { - Call::System(system::Call::remark(r)) -} - -#[test] -fn create_sucessful_proposal() { - let src_id = 1; - let r_id = derive_resource_id(src_id, b"remark"); - - new_test_ext_initialized(src_id, r_id, b"System.remark".to_vec()).execute_with(|| { - let prop_id = 1; - let proposal = make_proposal(vec![10]); - - // Create proposal (& vote) - assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - // Second relayer votes against - assert_ok!(Bridge::reject_proposal( - Origin::signed(RELAYER_B), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![RELAYER_B], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - // Third relayer votes in favour - assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_C), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A, RELAYER_C], - votes_against: vec![RELAYER_B], - status: ProposalStatus::Approved, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - assert_events(vec![ - Event::bridge(RawEvent::VoteFor(src_id, prop_id, RELAYER_A)), - Event::bridge(RawEvent::VoteAgainst(src_id, prop_id, RELAYER_B)), - Event::bridge(RawEvent::VoteFor(src_id, prop_id, RELAYER_C)), - Event::bridge(RawEvent::ProposalApproved(src_id, prop_id)), - Event::bridge(RawEvent::ProposalSucceeded(src_id, prop_id)), - ]); - }) -} - -#[test] -fn create_unsucessful_proposal() { - let src_id = 1; - let r_id = derive_resource_id(src_id, b"transfer"); - - new_test_ext_initialized(src_id, r_id, b"System.remark".to_vec()).execute_with(|| { - let prop_id = 1; - let proposal = make_proposal(vec![11]); - - // Create proposal (& vote) - assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - // Second relayer votes against - assert_ok!(Bridge::reject_proposal( - Origin::signed(RELAYER_B), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![RELAYER_B], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - // Third relayer votes against - assert_ok!(Bridge::reject_proposal( - Origin::signed(RELAYER_C), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![RELAYER_B, RELAYER_C], - status: ProposalStatus::Rejected, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - assert_eq!(Balances::free_balance(RELAYER_B), 0); - assert_eq!( - Balances::free_balance(Bridge::account_id()), - ENDOWED_BALANCE - ); - - assert_events(vec![ - Event::bridge(RawEvent::VoteFor(src_id, prop_id, RELAYER_A)), - Event::bridge(RawEvent::VoteAgainst(src_id, prop_id, RELAYER_B)), - Event::bridge(RawEvent::VoteAgainst(src_id, prop_id, RELAYER_C)), - Event::bridge(RawEvent::ProposalRejected(src_id, prop_id)), - ]); - }) -} - -#[test] -fn execute_after_threshold_change() { - let src_id = 1; - let r_id = derive_resource_id(src_id, b"transfer"); - - new_test_ext_initialized(src_id, r_id, b"System.remark".to_vec()).execute_with(|| { - let prop_id = 1; - let proposal = make_proposal(vec![11]); - - // Create proposal (& vote) - assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - // Change threshold - assert_ok!(Bridge::set_threshold(Origin::root(), 1)); - - // Attempt to execute - assert_ok!(Bridge::eval_vote_state( - Origin::signed(RELAYER_A), - prop_id, - src_id, - Box::new(proposal.clone()) - )); - - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![], - status: ProposalStatus::Approved, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - assert_eq!(Balances::free_balance(RELAYER_B), 0); - assert_eq!( - Balances::free_balance(Bridge::account_id()), - ENDOWED_BALANCE - ); - - assert_events(vec![ - Event::bridge(RawEvent::VoteFor(src_id, prop_id, RELAYER_A)), - Event::bridge(RawEvent::RelayerThresholdChanged(1)), - Event::bridge(RawEvent::ProposalApproved(src_id, prop_id)), - Event::bridge(RawEvent::ProposalSucceeded(src_id, prop_id)), - ]); - }) -} - -#[test] -fn proposal_expires() { - let src_id = 1; - let r_id = derive_resource_id(src_id, b"remark"); - - new_test_ext_initialized(src_id, r_id, b"System.remark".to_vec()).execute_with(|| { - let prop_id = 1; - let proposal = make_proposal(vec![10]); - - // Create proposal (& vote) - assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - // Increment enough blocks such that now == expiry - System::set_block_number(ProposalLifetime::get() + 1); - - // Attempt to submit a vote should fail - assert_noop!( - Bridge::reject_proposal( - Origin::signed(RELAYER_B), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - ), - Error::::ProposalExpired - ); - - // Proposal state should remain unchanged - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - // eval_vote_state should have no effect - assert_noop!( - Bridge::eval_vote_state( - Origin::signed(RELAYER_C), - prop_id, - src_id, - Box::new(proposal.clone()) - ), - Error::::ProposalExpired - ); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![], - status: ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - assert_events(vec![Event::bridge(RawEvent::VoteFor( - src_id, prop_id, RELAYER_A, - ))]); - }) -} diff --git a/modules/edge-assets/Cargo.toml b/modules/edge-assets/Cargo.toml deleted file mode 100644 index 3c6d3682..00000000 --- a/modules/edge-assets/Cargo.toml +++ /dev/null @@ -1,45 +0,0 @@ -[package] -name = "edge-assets" -version = "3.2.0" -authors = ["Commonwealth Labs "] -edition = "2018" -license = "Apache-2.0" -homepage = "https://substrate.dev" -repository = "https://github.com/paritytech/substrate/" -description = "FRAME asset management pallet" -readme = "README.md" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0.101", optional = true } -codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } -sp-std = { version = "2.0", default-features = false } -sp-runtime = { version = "2.0", default-features = false } -frame-support = { version = "2.0", default-features = false } -frame-system = { version = "2.0", default-features = false } -frame-benchmarking = { version = "2.0", default-features = false, optional = true } - -[dev-dependencies] -sp-core = { version = "2.0" } -sp-std = { version = "2.0" } -sp-io = { version = "2.0" } -pallet-balances = { version = "2.0", default-features = false } - -[features] -default = ["std"] -std = [ - "serde", - "codec/std", - "sp-std/std", - "sp-runtime/std", - "frame-support/std", - "frame-system/std", - "frame-benchmarking/std", -] -runtime-benchmarks = [ - "frame-benchmarking", - "sp-runtime/runtime-benchmarks", - "frame-system/runtime-benchmarks", -] \ No newline at end of file diff --git a/modules/edge-assets/src/benchmarking.rs b/modules/edge-assets/src/benchmarking.rs deleted file mode 100644 index a0b73498..00000000 --- a/modules/edge-assets/src/benchmarking.rs +++ /dev/null @@ -1,298 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2020 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Assets pallet benchmarking. - -use super::*; -use sp_std::prelude::*; -use sp_runtime::traits::Bounded; -use frame_system::RawOrigin as SystemOrigin; -use frame_benchmarking::{benchmarks, account, whitelisted_caller}; - -use crate::Module as Assets; - -const SEED: u32 = 0; - -fn create_default_asset(max_zombies: u32) - -> (T::AccountId, ::Source) -{ - let caller: T::AccountId = whitelisted_caller(); - let caller_lookup = T::Lookup::unlookup(caller.clone()); - let root = SystemOrigin::Root.into(); - assert!(Assets::::force_create( - root, - Default::default(), - caller_lookup.clone(), - max_zombies, - 1u32.into(), - ).is_ok()); - (caller, caller_lookup) -} - -fn create_default_minted_asset(max_zombies: u32, amount: T::Balance) - -> (T::AccountId, ::Source) -{ - let (caller, caller_lookup) = create_default_asset::(max_zombies); - assert!(Assets::::mint( - SystemOrigin::Signed(caller.clone()).into(), - Default::default(), - caller_lookup.clone(), - amount, - ).is_ok()); - (caller, caller_lookup) -} - -fn add_zombies(minter: T::AccountId, n: u32) { - let origin = SystemOrigin::Signed(minter); - for i in 0..n { - let target = account("zombie", i, SEED); - let target_lookup = T::Lookup::unlookup(target); - assert!(Assets::::mint(origin.clone().into(), Default::default(), target_lookup, 100u32.into()).is_ok()); - } -} - -fn assert_last_event(generic_event: ::Event) { - let events = frame_system::Module::::events(); - let system_event: ::Event = generic_event.into(); - // compare to the last event record - let frame_system::EventRecord { event, .. } = &events[events.len() - 1]; - assert_eq!(event, &system_event); -} - -benchmarks! { - _ { } - - create { - let caller: T::AccountId = whitelisted_caller(); - let caller_lookup = T::Lookup::unlookup(caller.clone()); - T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); - }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup, 1, 1u32.into()) - verify { - assert_last_event::(RawEvent::Created(Default::default(), caller.clone(), caller).into()); - } - - force_create { - let caller: T::AccountId = whitelisted_caller(); - let caller_lookup = T::Lookup::unlookup(caller.clone()); - }: _(SystemOrigin::Root, Default::default(), caller_lookup, 1, 1u32.into()) - verify { - assert_last_event::(RawEvent::ForceCreated(Default::default(), caller).into()); - } - - destroy { - let z in 0 .. 10_000; - let (caller, _) = create_default_asset::(10_000); - add_zombies::(caller.clone(), z); - }: _(SystemOrigin::Signed(caller), Default::default(), 10_000) - verify { - assert_last_event::(RawEvent::Destroyed(Default::default()).into()); - } - - force_destroy { - let z in 0 .. 10_000; - let (caller, _) = create_default_asset::(10_000); - add_zombies::(caller.clone(), z); - }: _(SystemOrigin::Root, Default::default(), 10_000) - verify { - assert_last_event::(RawEvent::Destroyed(Default::default()).into()); - } - - mint { - let (caller, caller_lookup) = create_default_asset::(10); - let amount = T::Balance::from(100u32); - }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup, amount) - verify { - assert_last_event::(RawEvent::Issued(Default::default(), caller, amount).into()); - } - - burn { - let amount = T::Balance::from(100u32); - let (caller, caller_lookup) = create_default_minted_asset::(10, amount); - }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup, amount) - verify { - assert_last_event::(RawEvent::Burned(Default::default(), caller, amount).into()); - } - - transfer { - let amount = T::Balance::from(100u32); - let (caller, caller_lookup) = create_default_minted_asset::(10, amount); - let target: T::AccountId = account("target", 0, SEED); - let target_lookup = T::Lookup::unlookup(target.clone()); - }: _(SystemOrigin::Signed(caller.clone()), Default::default(), target_lookup, amount) - verify { - assert_last_event::(RawEvent::Transferred(Default::default(), caller, target, amount).into()); - } - - force_transfer { - let amount = T::Balance::from(100u32); - let (caller, caller_lookup) = create_default_minted_asset::(10, amount); - let target: T::AccountId = account("target", 0, SEED); - let target_lookup = T::Lookup::unlookup(target.clone()); - }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup, target_lookup, amount) - verify { - assert_last_event::(RawEvent::ForceTransferred(Default::default(), caller, target, amount).into()); - } - - freeze { - let (caller, caller_lookup) = create_default_minted_asset::(10, 100u32.into()); - }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup) - verify { - assert_last_event::(RawEvent::Frozen(Default::default(), caller).into()); - } - - thaw { - let (caller, caller_lookup) = create_default_minted_asset::(10, 100u32.into()); - assert!(Assets::::freeze( - SystemOrigin::Signed(caller.clone()).into(), - Default::default(), - caller_lookup.clone() - ).is_ok()); - }: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup) - verify { - assert_last_event::(RawEvent::Thawed(Default::default(), caller).into()); - } - - transfer_ownership { - let (caller, _) = create_default_asset::(10); - let target: T::AccountId = account("target", 0, SEED); - let target_lookup = T::Lookup::unlookup(target.clone()); - }: _(SystemOrigin::Signed(caller), Default::default(), target_lookup) - verify { - assert_last_event::(RawEvent::OwnerChanged(Default::default(), target).into()); - } - - set_team { - let (caller, _) = create_default_asset::(10); - let target0 = T::Lookup::unlookup(account("target", 0, SEED)); - let target1 = T::Lookup::unlookup(account("target", 1, SEED)); - let target2 = T::Lookup::unlookup(account("target", 2, SEED)); - }: _(SystemOrigin::Signed(caller), Default::default(), target0.clone(), target1.clone(), target2.clone()) - verify { - assert_last_event::(RawEvent::TeamChanged( - Default::default(), - account("target", 0, SEED), - account("target", 1, SEED), - account("target", 2, SEED), - ).into()); - } - - set_max_zombies { - let (caller, _) = create_default_asset::(10); - let max_zombies: u32 = 100; - T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); - }: _(SystemOrigin::Signed(caller), Default::default(), max_zombies) - verify { - assert_last_event::(RawEvent::MaxZombiesChanged(Default::default(), max_zombies).into()); - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::tests::{new_test_ext, Test}; - - #[test] - fn create() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_create::().is_ok()); - }); - } - - #[test] - fn force_create() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_force_create::().is_ok()); - }); - } - - #[test] - fn destroy() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_destroy::().is_ok()); - }); - } - - #[test] - fn force_destroy() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_force_destroy::().is_ok()); - }); - } - - #[test] - fn mint() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_mint::().is_ok()); - }); - } - - #[test] - fn burn() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_burn::().is_ok()); - }); - } - - #[test] - fn transfer() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_transfer::().is_ok()); - }); - } - - #[test] - fn force_transfer() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_force_transfer::().is_ok()); - }); - } - - #[test] - fn freeze() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_freeze::().is_ok()); - }); - } - - #[test] - fn thaw() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_thaw::().is_ok()); - }); - } - - #[test] - fn transfer_ownership() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_transfer_ownership::().is_ok()); - }); - } - - #[test] - fn set_team() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_set_team::().is_ok()); - }); - } - - #[test] - fn set_max_zombies() { - new_test_ext().execute_with(|| { - assert!(test_benchmark_set_max_zombies::().is_ok()); - }); - } -} \ No newline at end of file diff --git a/modules/edge-assets/src/lib.rs b/modules/edge-assets/src/lib.rs deleted file mode 100644 index de92c089..00000000 --- a/modules/edge-assets/src/lib.rs +++ /dev/null @@ -1,1398 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! # Assets Module -//! -//! A simple, secure module for dealing with fungible assets. -//! -//! ## Overview -//! -//! The Assets module provides functionality for asset management of fungible asset classes -//! with a fixed supply, including: -//! -//! * Asset Issuance (Minting) -//! * Asset Transferal -//! * Asset Freezing -//! * Asset Destruction (Burning) -//! -//! To use it in your runtime, you need to implement the assets [`Config`](./trait.Config.html). -//! -//! The supported dispatchable functions are documented in the [`Call`](./enum.Call.html) enum. -//! -//! ### Terminology -//! -//! * **Admin**: An account ID uniquely privileged to be able to unfreeze (thaw) an account and it's -//! assets, as well as forcibly transfer a particular class of assets between arbitrary accounts -//! and reduce the balance of a particular class of assets of arbitrary accounts. -//! * **Asset issuance/minting**: The creation of a new asset, whose total supply will belong to the -//! account that issues the asset. This is a privileged operation. -//! * **Asset transfer**: The reduction of the balance of an asset of one account with the -//! corresponding increase in the balance of another. -//! * **Asset destruction**: The process of reduce the balance of an asset of one account. This is -//! a privileged operation. -//! * **Fungible asset**: An asset whose units are interchangeable. -//! * **Issuer**: An account ID uniquely privileged to be able to mint a particular class of assets. -//! * **Freezer**: An account ID uniquely privileged to be able to freeze an account from -//! transferring a particular class of assets. -//! * **Freezing**: Removing the possibility of an unpermissioned transfer of an asset from a -//! particular account. -//! * **Non-fungible asset**: An asset for which each unit has unique characteristics. -//! * **Owner**: An account ID uniquely privileged to be able to destroy a particular asset class, -//! or to set the Issuer, Freezer or Admin of that asset class. -//! * **Zombie**: An account which has a balance of some assets in this pallet, but no other -//! footprint on-chain, in particular no account managed in the `frame_system` pallet. -//! -//! ### Goals -//! -//! The assets system in Substrate is designed to make the following possible: -//! -//! * Issue a new assets in a permissioned or permissionless way, if permissionless, then with a -//! deposit required. -//! * Allow accounts to hold these assets without otherwise existing on-chain (*zombies*). -//! * Move assets between accounts. -//! * Update the asset's total supply. -//! * Allow administrative activities by specially privileged accounts including freezing account -//! balances and minting/burning assets. -//! -//! ## Interface -//! -//! ### Permissionless Functions -//! -//! * `create`: Creates a new asset class, taking the required deposit. -//! * `transfer`: Transfer sender's assets to another account. -//! -//! ### Permissioned Functions -//! -//! * `force_create`: Creates a new asset class without taking any deposit. -//! * `force_destroy`: Destroys an asset class. -//! -//! ### Privileged Functions -//! * `destroy`: Destroys an entire asset class; called by the asset class's Owner. -//! * `mint`: Increases the asset balance of an account; called by the asset class's Issuer. -//! * `burn`: Decreases the asset balance of an account; called by the asset class's Admin. -//! * `force_transfer`: Transfers between arbitrary accounts; called by the asset class's Admin. -//! * `freeze`: Disallows further `transfer`s from an account; called by the asset class's Freezer. -//! * `thaw`: Allows further `transfer`s from an account; called by the asset class's Admin. -//! * `transfer_ownership`: Changes an asset class's Owner; called by the asset class's Owner. -//! * `set_team`: Changes an asset class's Admin, Freezer and Issuer; called by the asset class's -//! Owner. -//! -//! Please refer to the [`Call`](./enum.Call.html) enum and its associated variants for documentation on each function. -//! -//! ### Public Functions -//! -//! -//! * `balance` - Get the asset `id` balance of `who`. -//! * `total_supply` - Get the total supply of an asset `id`. -//! -//! Please refer to the [`Module`](./struct.Module.html) struct for details on publicly available functions. -//! -//! ## Related Modules -//! -//! * [`System`](../frame_system/index.html) -//! * [`Support`](../frame_support/index.html) - -// Ensure we're `no_std` when compiling for Wasm. -#![cfg_attr(not(feature = "std"), no_std)] - -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; -pub mod weights; - -use sp_std::{fmt::Debug}; -use sp_runtime::{RuntimeDebug, traits::{ - Member, AtLeast32BitUnsigned, Zero, StaticLookup, Saturating, CheckedSub, CheckedAdd, - MaybeSerializeDeserialize, -}}; -use codec::{Encode, Decode, HasCompact}; -use frame_support::{Parameter, decl_module, decl_event, decl_storage, decl_error, ensure, - traits::{ - Currency, ReservableCurrency, EnsureOrigin, Get, BalanceStatus::Reserved - }, - dispatch::{DispatchResult, DispatchError}, -}; -use frame_system::ensure_signed; -pub use weights::WeightInfo; - -pub mod token_traits; -pub use token_traits::{FungibleAsset, MintableAsset, BurnableAsset, FreezableAsset, ManageableAsset}; - -type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; - -/// The module configuration trait. -pub trait Config: frame_system::Config { - /// The overarching event type. - type Event: From> + Into<::Event>; - - /// The units in which we record balances. - type Balance: Member + Parameter + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize + Debug; - - /// The arithmetic type of asset identifier. - type AssetId: Member + Parameter + Default + Copy + HasCompact; - - /// The currency mechanism. - type Currency: ReservableCurrency; - - /// The origin which may forcibly create or destroy an asset. - type ForceOrigin: EnsureOrigin; - - /// The basic amount of funds that must be reserved when creating a new asset class. - type AssetDepositBase: Get>; - - /// The additional funds that must be reserved for every zombie account that an asset class - /// supports. - type AssetDepositPerZombie: Get>; - - /// Weight information for extrinsics in this pallet. - type WeightInfo: WeightInfo; - - /// The flag for determining asset freezing and thawing support. - type AllowFreezing: Get; - - /// The flag for determing asset burning support. - type AllowBurning: Get; - - /// The flag for determining asset minting support. - type AllowMinting: Get; -} - -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] -pub struct AssetDetails< - Balance: Encode + Decode + Clone + Debug + Eq + PartialEq, - AccountId: Encode + Decode + Clone + Debug + Eq + PartialEq, - DepositBalance: Encode + Decode + Clone + Debug + Eq + PartialEq, -> { - /// Can change `owner`, `issuer`, `freezer` and `admin` accounts. - owner: AccountId, - /// Can mint tokens. - issuer: AccountId, - /// Can thaw tokens, force transfers and burn tokens from any account. - admin: AccountId, - /// Can freeze tokens. - freezer: AccountId, - /// The total supply across all accounts. - supply: Balance, - /// The balance deposited for this asset. - /// - /// This pays for the data stored here together with any virtual accounts. - deposit: DepositBalance, - /// The number of balance-holding accounts that this asset may have, excluding those that were - /// created when they had a system-level ED. - max_zombies: u32, - /// The ED for virtual accounts. - min_balance: Balance, - /// The current number of zombie accounts. - zombies: u32, - /// The total number of accounts. - accounts: u32, -} - -#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default)] -pub struct AssetBalance< - Balance: Encode + Decode + Clone + Debug + Eq + PartialEq, -> { - /// The balance. - balance: Balance, - /// Whether the account is frozen. - is_frozen: bool, - /// Whether the account is a zombie. If not, then it has a reference. - is_zombie: bool, -} - -decl_storage! { - trait Store for Module as Assets { - /// Details of an asset. - pub Asset: map hasher(blake2_128_concat) T::AssetId => Option, - >>; - - /// The number of units of assets held by any given account. - pub Account: double_map - hasher(blake2_128_concat) T::AssetId, - hasher(blake2_128_concat) T::AccountId - => AssetBalance; - } -} - -decl_event! { - pub enum Event where - ::AccountId, - ::Balance, - ::AssetId, - { - /// Some asset class was created. \[asset_id, creator, owner\] - Created(AssetId, AccountId, AccountId), - /// Some assets were issued. \[asset_id, owner, total_supply\] - Issued(AssetId, AccountId, Balance), - /// Some assets were transferred. \[asset_id, from, to, amount\] - Transferred(AssetId, AccountId, AccountId, Balance), - /// Some assets were destroyed. \[asset_id, owner, balance\] - Burned(AssetId, AccountId, Balance), - /// The management team changed \[asset_id, issuer, admin, freezer\] - TeamChanged(AssetId, AccountId, AccountId, AccountId), - /// The owner changed \[asset_id, owner\] - OwnerChanged(AssetId, AccountId), - /// Some account `who` was frozen. \[asset_id, who\] - Frozen(AssetId, AccountId), - /// Some account `who` was thawed. \[asset_id, who\] - Thawed(AssetId, AccountId), - /// An asset class was destroyed. - Destroyed(AssetId), - /// Some asset class was force-created. \[asset_id, owner\] - ForceCreated(AssetId, AccountId), - /// The maximum amount of zombies allowed has changed. \[asset_id, max_zombies\] - MaxZombiesChanged(AssetId, u32), - } -} - -decl_error! { - pub enum Error for Module { - /// Transfer amount should be non-zero. - AmountZero, - /// Account balance must be greater than or equal to the transfer amount. - BalanceLow, - /// Balance should be non-zero. - BalanceZero, - /// The signing account has no permission to do the operation. - NoPermission, - /// The given asset ID is unknown. - Unknown, - /// The origin account is frozen. - Frozen, - /// The asset ID is already taken. - InUse, - /// Too many zombie accounts in use. - TooManyZombies, - /// Attempt to destroy an asset class when non-zombie, reference-bearing accounts exist. - RefsLeft, - /// Invalid witness data given. - BadWitness, - /// Minimum balance should be non-zero. - MinBalanceZero, - /// A mint operation lead to an overflow. - Overflow, - /// The asset does not allow freezing or thawing functionality - NoFreezingAllowed, - /// The asset does not allow burning functionality. - NoBurningAllowed, - /// The asset does not allow minting functionality - NoMintingAllowed, - } -} - -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - type Error = Error; - - fn deposit_event() = default; - - /// Issue a new class of fungible assets from a public origin. - /// - /// This new asset class has no assets initially. - /// - /// The origin must be Signed and the sender must have sufficient funds free. - /// - /// Funds of sender are reserved according to the formula: - /// `AssetDepositBase + AssetDepositPerZombie * max_zombies`. - /// - /// Parameters: - /// - `id`: The identifier of the new asset. This must not be currently in use to identify - /// an existing asset. - /// - `owner`: The owner of this class of assets. The owner has full superuser permissions - /// over this asset, but may later change and configure the permissions using `transfer_ownership` - /// and `set_team`. - /// - `max_zombies`: The total number of accounts which may hold assets in this class yet - /// have no existential deposit. - /// - `min_balance`: The minimum balance of this new asset that any single account must - /// have. If an account's balance is reduced below this, then it collapses to zero. - /// - /// Emits `Created` event when successful. - /// - /// Weight: `O(1)` - #[weight = T::WeightInfo::create()] - fn create(origin, - #[compact] id: T::AssetId, - admin: ::Source, - max_zombies: u32, - min_balance: T::Balance, - ) { - let owner = ensure_signed(origin)?; - let admin = T::Lookup::lookup(admin)?; - - ensure!(!Asset::::contains_key(id), Error::::InUse); - ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); - - let deposit = T::AssetDepositPerZombie::get() - .saturating_mul(max_zombies.into()) - .saturating_add(T::AssetDepositBase::get()); - T::Currency::reserve(&owner, deposit)?; - - Asset::::insert(id, AssetDetails { - owner: owner.clone(), - issuer: admin.clone(), - admin: admin.clone(), - freezer: admin.clone(), - supply: Zero::zero(), - deposit, - max_zombies, - min_balance, - zombies: Zero::zero(), - accounts: Zero::zero(), - }); - Self::deposit_event(RawEvent::Created(id, owner, admin)); - } - - /// Issue a new class of fungible assets from a privileged origin. - /// - /// This new asset class has no assets initially. - /// - /// The origin must conform to `ForceOrigin`. - /// - /// Unlike `create`, no funds are reserved. - /// - /// - `id`: The identifier of the new asset. This must not be currently in use to identify - /// an existing asset. - /// - `owner`: The owner of this class of assets. The owner has full superuser permissions - /// over this asset, but may later change and configure the permissions using `transfer_ownership` - /// and `set_team`. - /// - `max_zombies`: The total number of accounts which may hold assets in this class yet - /// have no existential deposit. - /// - `min_balance`: The minimum balance of this new asset that any single account must - /// have. If an account's balance is reduced below this, then it collapses to zero. - /// - /// Emits `ForceCreated` event when successful. - /// - /// Weight: `O(1)` - #[weight = T::WeightInfo::force_create()] - fn force_create(origin, - #[compact] id: T::AssetId, - owner: ::Source, - #[compact] max_zombies: u32, - #[compact] min_balance: T::Balance, - ) { - T::ForceOrigin::ensure_origin(origin)?; - let owner = T::Lookup::lookup(owner)?; - - ensure!(!Asset::::contains_key(id), Error::::InUse); - ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); - - Asset::::insert(id, AssetDetails { - owner: owner.clone(), - issuer: owner.clone(), - admin: owner.clone(), - freezer: owner.clone(), - supply: Zero::zero(), - deposit: Zero::zero(), - max_zombies, - min_balance, - zombies: Zero::zero(), - accounts: Zero::zero(), - }); - Self::deposit_event(RawEvent::ForceCreated(id, owner)); - } - - /// Destroy a class of fungible assets owned by the sender. - /// - /// The origin must be Signed and the sender must be the owner of the asset `id`. - /// - /// - `id`: The identifier of the asset to be destroyed. This must identify an existing - /// asset. - /// - /// Emits `Destroyed` event when successful. - /// - /// Weight: `O(z)` where `z` is the number of zombie accounts. - #[weight = T::WeightInfo::destroy(*zombies_witness)] - fn destroy(origin, - #[compact] id: T::AssetId, - #[compact] zombies_witness: u32, - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - - Asset::::try_mutate_exists(id, |maybe_details| { - let details = maybe_details.take().ok_or(Error::::Unknown)?; - ensure!(details.owner == origin, Error::::NoPermission); - ensure!(details.accounts == details.zombies, Error::::RefsLeft); - ensure!(details.zombies <= zombies_witness, Error::::BadWitness); - T::Currency::unreserve(&details.owner, details.deposit); - - *maybe_details = None; - Account::::remove_prefix(&id); - - Self::deposit_event(RawEvent::Destroyed(id)); - Ok(()) - }) - } - - /// Destroy a class of fungible assets. - /// - /// The origin must conform to `ForceOrigin`. - /// - /// - `id`: The identifier of the asset to be destroyed. This must identify an existing - /// asset. - /// - /// Emits `Destroyed` event when successful. - /// - /// Weight: `O(1)` - #[weight = T::WeightInfo::force_destroy(*zombies_witness)] - fn force_destroy(origin, - #[compact] id: T::AssetId, - #[compact] zombies_witness: u32, - ) -> DispatchResult { - T::ForceOrigin::ensure_origin(origin)?; - - Asset::::try_mutate_exists(id, |maybe_details| { - let details = maybe_details.take().ok_or(Error::::Unknown)?; - ensure!(details.accounts == details.zombies, Error::::RefsLeft); - ensure!(details.zombies <= zombies_witness, Error::::BadWitness); - T::Currency::unreserve(&details.owner, details.deposit); - - *maybe_details = None; - Account::::remove_prefix(&id); - - Self::deposit_event(RawEvent::Destroyed(id)); - Ok(()) - }) - } - - /// Mint assets of a particular class. - /// - /// The origin must be Signed and the sender must be the Issuer of the asset `id`. - /// - /// - `id`: The identifier of the asset to have some amount minted. - /// - `beneficiary`: The account to be credited with the minted assets. - /// - `amount`: The amount of the asset to be minted. - /// - /// Emits `Destroyed` event when successful. - /// - /// Weight: `O(1)` - /// Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`. - #[weight = T::WeightInfo::mint()] - fn mint(origin, - #[compact] id: T::AssetId, - beneficiary: ::Source, - #[compact] amount: T::Balance - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - - ensure!(T::AllowMinting::get(), Error::::NoMintingAllowed); - - let details = Asset::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &details.issuer, Error::::NoPermission); - - let beneficiary = T::Lookup::lookup(beneficiary)?; - >::mint(id, beneficiary, amount) - } - - /// Reduce the balance of `who` by as much as possible up to `amount` assets of `id`. - /// - /// Origin must be Signed and the sender should be the Manager of the asset `id`. - /// - /// Bails with `BalanceZero` if the `who` is already dead. - /// - /// - `id`: The identifier of the asset to have some amount burned. - /// - `who`: The account to be debited from. - /// - `amount`: The maximum amount by which `who`'s balance should be reduced. - /// - /// Emits `Burned` with the actual amount burned. If this takes the balance to below the - /// minimum for the asset, then the amount burned is increased to take it to zero. - /// - /// Weight: `O(1)` - /// Modes: Post-existence of `who`; Pre & post Zombie-status of `who`. - #[weight = T::WeightInfo::burn()] - fn burn(origin, - #[compact] id: T::AssetId, - who: ::Source, - #[compact] amount: T::Balance - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - ensure!(T::AllowBurning::get(), Error::::NoBurningAllowed); - - let details = Asset::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &details.admin, Error::::NoPermission); - - let who = T::Lookup::lookup(who)?; - >::burn(id, who, amount) - } - - /// Move some assets from the sender account to another. - /// - /// Origin must be Signed. - /// - /// - `id`: The identifier of the asset to have some amount transferred. - /// - `target`: The account to be credited. - /// - `amount`: The amount by which the sender's balance of assets should be reduced and - /// `target`'s balance increased. The amount actually transferred may be slightly greater in - /// the case that the transfer would otherwise take the sender balance above zero but below - /// the minimum balance. Must be greater than zero. - /// - /// Emits `Transferred` with the actual amount transferred. If this takes the source balance - /// to below the minimum for the asset, then the amount transferred is increased to take it - /// to zero. - /// - /// Weight: `O(1)` - /// Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status - /// of sender; Account pre-existence of `target`. - #[weight = T::WeightInfo::transfer()] - fn transfer(origin, - #[compact] id: T::AssetId, - target: ::Source, - #[compact] amount: T::Balance - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - ensure!(!amount.is_zero(), Error::::AmountZero); - - let mut origin_account = Account::::get(id, &origin); - ensure!(!origin_account.is_frozen, Error::::Frozen); - origin_account.balance = origin_account.balance.checked_sub(&amount) - .ok_or(Error::::BalanceLow)?; - - let target = T::Lookup::lookup(target)?; - >::transfer(id, origin.clone(), target.clone(), amount)?; - Ok(()) - } - - /// Move some assets from one account to another. - /// - /// Origin must be Signed and the sender should be the Admin of the asset `id`. - /// - /// - `id`: The identifier of the asset to have some amount transferred. - /// - `source`: The account to be debited. - /// - `dest`: The account to be credited. - /// - `amount`: The amount by which the `source`'s balance of assets should be reduced and - /// `dest`'s balance increased. The amount actually transferred may be slightly greater in - /// the case that the transfer would otherwise take the `source` balance above zero but - /// below the minimum balance. Must be greater than zero. - /// - /// Emits `Transferred` with the actual amount transferred. If this takes the source balance - /// to below the minimum for the asset, then the amount transferred is increased to take it - /// to zero. - /// - /// Weight: `O(1)` - /// Modes: Pre-existence of `dest`; Post-existence of `source`; Prior & post zombie-status - /// of `source`; Account pre-existence of `dest`. - #[weight = T::WeightInfo::force_transfer()] - fn force_transfer(origin, - #[compact] id: T::AssetId, - source: ::Source, - dest: ::Source, - #[compact] amount: T::Balance, - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - - let details = Asset::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &details.admin, Error::::NoPermission); - - let source = T::Lookup::lookup(source)?; - let source_account = Account::::get(id, &source); - let amount = amount.min(source_account.balance); - ensure!(!amount.is_zero(), Error::::AmountZero); - - let dest = T::Lookup::lookup(dest)?; - >::transfer(id, source.clone(), dest.clone(), amount)?; - Ok(()) - } - - /// Disallow further unprivileged transfers from an account. - /// - /// Origin must be Signed and the sender should be the Freezer of the asset `id`. - /// - /// - `id`: The identifier of the asset to be frozen. - /// - `who`: The account to be frozen. - /// - /// Emits `Frozen`. - /// - /// Weight: `O(1)` - #[weight = T::WeightInfo::freeze()] - fn freeze(origin, #[compact] id: T::AssetId, who: ::Source) { - let origin = ensure_signed(origin)?; - - ensure!(T::AllowFreezing::get(), Error::::NoFreezingAllowed); - - let d = Asset::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &d.freezer, Error::::NoPermission); - - let who = T::Lookup::lookup(who)?; - let _ = >::freeze(id, who)?; - } - - /// Allow unprivileged transfers from an account again. - /// - /// Origin must be Signed and the sender should be the Admin of the asset `id`. - /// - /// - `id`: The identifier of the asset to be frozen. - /// - `who`: The account to be unfrozen. - /// - /// Emits `Thawed`. - /// - /// Weight: `O(1)` - #[weight = T::WeightInfo::thaw()] - fn thaw(origin, #[compact] id: T::AssetId, who: ::Source) { - let origin = ensure_signed(origin)?; - - ensure!(T::AllowFreezing::get(), Error::::NoFreezingAllowed); - - let details = Asset::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &details.admin, Error::::NoPermission); - - let who = T::Lookup::lookup(who)?; - let _ = >::thaw(id, who)?; - } - - /// Change the Owner of an asset. - /// - /// Origin must be Signed and the sender should be the Owner of the asset `id`. - /// - /// - `id`: The identifier of the asset to be frozen. - /// - `owner`: The new Owner of this asset. - /// - /// Emits `OwnerChanged`. - /// - /// Weight: `O(1)` - #[weight = T::WeightInfo::transfer_ownership()] - fn transfer_ownership(origin, - #[compact] id: T::AssetId, - new_owner: ::Source, - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - let details = Asset::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &details.owner, Error::::NoPermission); - - let new_owner = T::Lookup::lookup(new_owner)?; - Self::set_owner(id, new_owner) - } - - /// Change the Issuer, Admin and Freezer of an asset. - /// - /// Origin must be Signed and the sender should be the Owner of the asset `id`. - /// - /// - `id`: The identifier of the asset to be frozen. - /// - `issuer`: The new Issuer of this asset. - /// - `admin`: The new Admin of this asset. - /// - `freezer`: The new Freezer of this asset. - /// - /// Emits `TeamChanged`. - /// - /// Weight: `O(1)` - #[weight = T::WeightInfo::set_team()] - fn set_team(origin, - #[compact] id: T::AssetId, - issuer: ::Source, - admin: ::Source, - freezer: ::Source, - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - - let details = Asset::::get(id).ok_or(Error::::Unknown)?; - ensure!(&origin == &details.admin, Error::::NoPermission); - - let issuer = T::Lookup::lookup(issuer)?; - let admin = T::Lookup::lookup(admin)?; - let freezer = T::Lookup::lookup(freezer)?; - - >::set_team(id, issuer, admin, freezer) - } - - #[weight = T::WeightInfo::set_max_zombies()] - fn set_max_zombies(origin, - #[compact] id: T::AssetId, - #[compact] max_zombies: u32, - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - - Asset::::try_mutate(id, |maybe_details| { - let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; - ensure!(&origin == &details.owner, Error::::NoPermission); - ensure!(max_zombies >= details.zombies, Error::::TooManyZombies); - - let new_deposit = T::AssetDepositPerZombie::get() - .saturating_mul(max_zombies.into()) - .saturating_add(T::AssetDepositBase::get()); - - if new_deposit > details.deposit { - T::Currency::reserve(&origin, new_deposit - details.deposit)?; - } else { - T::Currency::unreserve(&origin, details.deposit - new_deposit); - } - - details.max_zombies = max_zombies; - - Self::deposit_event(RawEvent::MaxZombiesChanged(id, max_zombies)); - Ok(()) - }) - } - } -} - -// The main implementation block for the module. -impl Module { - // Public immutables - - /// Get the asset `id` balance of `who`. - pub fn balance(id: T::AssetId, who: T::AccountId) -> T::Balance { - Account::::get(id, who).balance - } - - /// Get the total supply of an asset `id`. - pub fn total_supply(id: T::AssetId) -> T::Balance { - Asset::::get(id).map(|x| x.supply).unwrap_or_else(Zero::zero) - } - - /// Check the number of zombies allow yet for an asset. - pub fn zombie_allowance(id: T::AssetId) -> u32 { - Asset::::get(id).map(|x| x.max_zombies - x.zombies).unwrap_or_else(Zero::zero) - } - - fn new_account( - who: &T::AccountId, - d: &mut AssetDetails>, - ) -> Result { - let accounts = d.accounts.checked_add(1).ok_or(Error::::Overflow)?; - let r = Ok(if frame_system::Module::::account_exists(who) { - frame_system::Module::::inc_ref(who); - false - } else { - ensure!(d.zombies < d.max_zombies, Error::::TooManyZombies); - d.zombies += 1; - true - }); - d.accounts = accounts; - r - } - - /// If `who`` exists in system and it's a zombie, dezombify it. - fn dezombify( - who: &T::AccountId, - d: &mut AssetDetails>, - is_zombie: &mut bool, - ) { - if *is_zombie && frame_system::Module::::account_exists(who) { - frame_system::Module::::inc_ref(who); - *is_zombie = false; - d.zombies = d.zombies.saturating_sub(1); - } - } - - fn dead_account( - who: &T::AccountId, - d: &mut AssetDetails>, - is_zombie: bool, - ) { - if is_zombie { - d.zombies = d.zombies.saturating_sub(1); - } else { - frame_system::Module::::dec_ref(who); - } - d.accounts = d.accounts.saturating_sub(1); - } -} - -impl FungibleAsset for Module where - T::Balance: MaybeSerializeDeserialize + Debug -{ - type Balance = T::Balance; - type AssetId = T::AssetId; - - // PUBLIC IMMUTABLES - - /// The total amount of issuance in the system for a specific asset. - fn total_issuance(id: Self::AssetId) -> Self::Balance { - Self::total_supply(id) - } - - fn balance_of(id: Self::AssetId, who: T::AccountId) -> Self::Balance { - Self::balance(id, who) - } - - // PUBLIC MUTABLES (DANGEROUS) - - fn transfer( - id: Self::AssetId, - from: T::AccountId, - dest: T::AccountId, - amount: Self::Balance - ) -> DispatchResult { - if dest == from { - return Ok(()) - } - - let mut from_account = Account::::get(id, &from); - from_account.balance = from_account.balance.checked_sub(&amount) - .ok_or(Error::::BalanceLow)?; - - Asset::::try_mutate(id, |maybe_details| { - let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; - - let mut amount = amount; - if from_account.balance < details.min_balance { - amount += from_account.balance; - from_account.balance = Zero::zero(); - } - - Account::::try_mutate(id, &dest, |a| -> DispatchResult { - let new_balance = a.balance.saturating_add(amount); - ensure!(new_balance >= details.min_balance, Error::::BalanceLow); - if a.balance.is_zero() { - a.is_zombie = Self::new_account(&dest, details)?; - } - a.balance = new_balance; - Ok(()) - })?; - - match from_account.balance.is_zero() { - false => { - Self::dezombify(&from, details, &mut from_account.is_zombie); - Account::::insert(id, &from, &from_account) - } - true => { - Self::dead_account(&from, details, from_account.is_zombie); - Account::::remove(id, &from); - } - } - - Self::deposit_event(RawEvent::Transferred(id, from, dest, amount)); - - Ok(()) - }) - } -} - -impl BurnableAsset for Module { - fn burn( - id: Self::AssetId, - who: T::AccountId, - amount: Self::Balance - ) -> DispatchResult { - Asset::::try_mutate(id, |maybe_details| { - let d = maybe_details.as_mut().ok_or(Error::::Unknown)?; - - let burned = Account::::try_mutate_exists( - id, - &who, - |maybe_account| -> Result { - let mut account = maybe_account.take().ok_or(Error::::BalanceZero)?; - let mut burned = amount.min(account.balance); - account.balance -= burned; - *maybe_account = if account.balance < d.min_balance { - burned += account.balance; - Self::dead_account(&who, d, account.is_zombie); - None - } else { - Some(account) - }; - Ok(burned) - } - )?; - - d.supply = d.supply.saturating_sub(burned); - - Self::deposit_event(RawEvent::Burned(id, who, burned)); - Ok(()) - }) - } -} - -impl MintableAsset for Module { - fn mint( - id: Self::AssetId, - beneficiary: T::AccountId, - amount: Self::Balance - ) -> DispatchResult { - Asset::::try_mutate(id, |maybe_details| { - let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; - details.supply = details.supply.checked_add(&amount).ok_or(Error::::Overflow)?; - - Account::::try_mutate(id, &beneficiary, |t| -> DispatchResult { - let new_balance = t.balance.saturating_add(amount); - ensure!(new_balance >= details.min_balance, Error::::BalanceLow); - if t.balance.is_zero() { - t.is_zombie = Self::new_account(&beneficiary, details)?; - } - t.balance = new_balance; - Ok(()) - })?; - Self::deposit_event(RawEvent::Issued(id, beneficiary, amount)); - Ok(()) - }) - } -} - -impl FreezableAsset for Module { - fn freeze(id: Self::AssetId, who: T::AccountId) -> DispatchResult { - ensure!(Account::::contains_key(id, &who), Error::::BalanceZero); - - Account::::mutate(id, &who, |a| a.is_frozen = true); - - Self::deposit_event(Event::::Frozen(id, who)); - Ok(()) - } - - fn thaw(id: Self::AssetId, who: T::AccountId) -> DispatchResult { - ensure!(Account::::contains_key(id, &who), Error::::BalanceZero); - - Account::::mutate(id, &who, |a| a.is_frozen = false); - - Self::deposit_event(Event::::Thawed(id, who)); - Ok(()) - } -} - -impl ManageableAsset for Module { - fn set_owner(id: Self::AssetId, owner: T::AccountId) -> DispatchResult { - Asset::::try_mutate(id, |maybe_details| { - let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; - if details.owner == owner { return Ok(()) } - - // Move the deposit to the new owner. - T::Currency::repatriate_reserved(&details.owner, &owner, details.deposit, Reserved)?; - - details.owner = owner.clone(); - - Self::deposit_event(RawEvent::OwnerChanged(id, owner)); - Ok(()) - }) - } - - fn set_team( - id: Self::AssetId, - issuer: T::AccountId, - admin: T::AccountId, - freezer: T::AccountId - ) -> DispatchResult { - Asset::::try_mutate(id, |maybe_details| { - let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; - - details.issuer = issuer.clone(); - details.admin = admin.clone(); - details.freezer = freezer.clone(); - - Self::deposit_event(RawEvent::TeamChanged(id, issuer, admin, freezer)); - Ok(()) - }) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - use frame_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types, impl_outer_event}; - use sp_core::H256; - use sp_runtime::{traits::{BlakeTwo256, IdentityLookup}, testing::Header}; - - mod pallet_assets { - pub use crate::Event; - } - - impl_outer_event! { - pub enum Event for Test { - frame_system, - pallet_balances, - pallet_assets, - } - } - - impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} - } - - #[derive(Clone, Eq, PartialEq)] - pub struct Test; - parameter_types! { - pub const BlockHashCount: u64 = 250; - } - impl frame_system::Config for Test { - type BaseCallFilter = (); - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type Origin = Origin; - type Index = u64; - type Call = (); - type BlockNumber = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type Header = Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = (); - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - } - - parameter_types! { - pub const ExistentialDeposit: u64 = 1; - } - - impl pallet_balances::Config for Test { - type MaxLocks = (); - type Balance = u64; - type DustRemoval = (); - type Event = Event; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); - } - - parameter_types! { - pub const AssetDepositBase: u64 = 1; - pub const AssetDepositPerZombie: u64 = 1; - pub const AllowFreezing: bool = true; - pub const AllowBurning: bool = true; - pub const AllowMinting: bool = true; - } - - impl Config for Test { - type Currency = Balances; - type Event = Event; - type Balance = u64; - type AssetId = u32; - type ForceOrigin = frame_system::EnsureRoot; - type AssetDepositBase = AssetDepositBase; - type AssetDepositPerZombie = AssetDepositPerZombie; - type AllowFreezing = AllowFreezing; - type AllowBurning = AllowBurning; - type AllowMinting = AllowMinting; - type WeightInfo = (); - } - - type System = frame_system::Module; - type Balances = pallet_balances::Module; - type Assets = Module; - - pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - frame_system::GenesisConfig::default().build_storage::().unwrap().into() - } - - #[test] - fn basic_minting_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::balance(0, 1), 100); - assert_ok!(Assets::mint(Origin::signed(1), 0, 2, 100)); - assert_eq!(Assets::balance(0, 2), 100); - }); - } - - #[test] - fn lifecycle_should_work() { - new_test_ext().execute_with(|| { - Balances::make_free_balance_be(&1, 100); - assert_ok!(Assets::create(Origin::signed(1), 0, 1, 10, 1)); - assert_eq!(Balances::reserved_balance(&1), 11); - - assert_ok!(Assets::destroy(Origin::signed(1), 0, 100)); - assert_eq!(Balances::reserved_balance(&1), 0); - - assert_ok!(Assets::create(Origin::signed(1), 0, 1, 10, 1)); - assert_eq!(Balances::reserved_balance(&1), 11); - - assert_ok!(Assets::force_destroy(Origin::root(), 0, 100)); - assert_eq!(Balances::reserved_balance(&1), 0); - }); - } - - #[test] - fn destroy_with_non_zombies_should_not_work() { - new_test_ext().execute_with(|| { - Balances::make_free_balance_be(&1, 100); - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_noop!(Assets::destroy(Origin::signed(1), 0, 100), Error::::RefsLeft); - assert_noop!(Assets::force_destroy(Origin::root(), 0, 100), Error::::RefsLeft); - assert_ok!(Assets::burn(Origin::signed(1), 0, 1, 100)); - assert_ok!(Assets::destroy(Origin::signed(1), 0, 100)); - }); - } - - #[test] - fn destroy_with_bad_witness_should_not_work() { - new_test_ext().execute_with(|| { - Balances::make_free_balance_be(&1, 100); - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 10, 100)); - assert_noop!(Assets::destroy(Origin::signed(1), 0, 0), Error::::BadWitness); - assert_noop!(Assets::force_destroy(Origin::root(), 0, 0), Error::::BadWitness); - }); - } - - #[test] - fn max_zombies_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 2, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 0, 100)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - - assert_eq!(Assets::zombie_allowance(0), 0); - assert_noop!(Assets::mint(Origin::signed(1), 0, 2, 100), Error::::TooManyZombies); - assert_noop!(Assets::transfer(Origin::signed(1), 0, 2, 50), Error::::TooManyZombies); - assert_noop!(Assets::force_transfer(Origin::signed(1), 0, 1, 2, 50), Error::::TooManyZombies); - - Balances::make_free_balance_be(&3, 100); - assert_ok!(Assets::mint(Origin::signed(1), 0, 3, 100)); - - assert_ok!(Assets::transfer(Origin::signed(0), 0, 1, 100)); - assert_eq!(Assets::zombie_allowance(0), 1); - assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 50)); - }); - } - - #[test] - fn resetting_max_zombies_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 2, 1)); - Balances::make_free_balance_be(&1, 100); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 2, 100)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 3, 100)); - - assert_eq!(Assets::zombie_allowance(0), 0); - - assert_noop!(Assets::set_max_zombies(Origin::signed(1), 0, 1), Error::::TooManyZombies); - - assert_ok!(Assets::set_max_zombies(Origin::signed(1), 0, 3)); - assert_eq!(Assets::zombie_allowance(0), 1); - }); - } - - #[test] - fn dezombifying_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 10)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::zombie_allowance(0), 9); - - // introduce a bit of balance for account 2. - Balances::make_free_balance_be(&2, 100); - - // transfer 25 units, nothing changes. - assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 25)); - assert_eq!(Assets::zombie_allowance(0), 9); - - // introduce a bit of balance; this will create the account. - Balances::make_free_balance_be(&1, 100); - - // now transferring 25 units will create it. - assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 25)); - assert_eq!(Assets::zombie_allowance(0), 10); - }); - } - - #[test] - fn min_balance_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 10)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Asset::::get(0).unwrap().accounts, 1); - - // Cannot create a new account with a balance that is below minimum... - assert_noop!(Assets::mint(Origin::signed(1), 0, 2, 9), Error::::BalanceLow); - assert_noop!(Assets::transfer(Origin::signed(1), 0, 2, 9), Error::::BalanceLow); - assert_noop!(Assets::force_transfer(Origin::signed(1), 0, 1, 2, 9), Error::::BalanceLow); - - // When deducting from an account to below minimum, it should be reaped. - - assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 91)); - assert!(Assets::balance(0, 1).is_zero()); - assert_eq!(Assets::balance(0, 2), 100); - assert_eq!(Asset::::get(0).unwrap().accounts, 1); - - assert_ok!(Assets::force_transfer(Origin::signed(1), 0, 2, 1, 91)); - assert!(Assets::balance(0, 2).is_zero()); - assert_eq!(Assets::balance(0, 1), 100); - assert_eq!(Asset::::get(0).unwrap().accounts, 1); - - assert_ok!(Assets::burn(Origin::signed(1), 0, 1, 91)); - assert!(Assets::balance(0, 1).is_zero()); - assert_eq!(Asset::::get(0).unwrap().accounts, 0); - }); - } - - #[test] - fn querying_total_supply_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::balance(0, 1), 100); - assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Assets::balance(0, 1), 50); - assert_eq!(Assets::balance(0, 2), 50); - assert_ok!(Assets::transfer(Origin::signed(2), 0, 3, 31)); - assert_eq!(Assets::balance(0, 1), 50); - assert_eq!(Assets::balance(0, 2), 19); - assert_eq!(Assets::balance(0, 3), 31); - assert_ok!(Assets::burn(Origin::signed(1), 0, 3, u64::max_value())); - assert_eq!(Assets::total_supply(0), 69); - }); - } - - #[test] - fn transferring_amount_below_available_balance_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::balance(0, 1), 100); - assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Assets::balance(0, 1), 50); - assert_eq!(Assets::balance(0, 2), 50); - }); - } - - #[test] - fn transferring_frozen_balance_should_not_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::balance(0, 1), 100); - assert_ok!(Assets::freeze(Origin::signed(1), 0, 1)); - assert_noop!(Assets::transfer(Origin::signed(1), 0, 2, 50), Error::::Frozen); - assert_ok!(Assets::thaw(Origin::signed(1), 0, 1)); - assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 50)); - }); - } - - #[test] - fn origin_guards_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_noop!(Assets::transfer_ownership(Origin::signed(2), 0, 2), Error::::NoPermission); - assert_noop!(Assets::set_team(Origin::signed(2), 0, 2, 2, 2), Error::::NoPermission); - assert_noop!(Assets::freeze(Origin::signed(2), 0, 1), Error::::NoPermission); - assert_noop!(Assets::thaw(Origin::signed(2), 0, 2), Error::::NoPermission); - assert_noop!(Assets::mint(Origin::signed(2), 0, 2, 100), Error::::NoPermission); - assert_noop!(Assets::burn(Origin::signed(2), 0, 1, 100), Error::::NoPermission); - assert_noop!(Assets::force_transfer(Origin::signed(2), 0, 1, 2, 100), Error::::NoPermission); - assert_noop!(Assets::set_max_zombies(Origin::signed(2), 0, 11), Error::::NoPermission); - assert_noop!(Assets::destroy(Origin::signed(2), 0, 100), Error::::NoPermission); - }); - } - - #[test] - fn transfer_owner_should_work() { - new_test_ext().execute_with(|| { - Balances::make_free_balance_be(&1, 100); - Balances::make_free_balance_be(&2, 1); - assert_ok!(Assets::create(Origin::signed(1), 0, 1, 10, 1)); - - assert_eq!(Balances::reserved_balance(&1), 11); - - assert_ok!(Assets::transfer_ownership(Origin::signed(1), 0, 2)); - assert_eq!(Balances::reserved_balance(&2), 11); - assert_eq!(Balances::reserved_balance(&1), 0); - - assert_noop!(Assets::transfer_ownership(Origin::signed(1), 0, 1), Error::::NoPermission); - - assert_ok!(Assets::transfer_ownership(Origin::signed(2), 0, 1)); - assert_eq!(Balances::reserved_balance(&1), 11); - assert_eq!(Balances::reserved_balance(&2), 0); - }); - } - - #[test] - fn set_team_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::set_team(Origin::signed(1), 0, 2, 3, 4)); - - assert_ok!(Assets::mint(Origin::signed(2), 0, 2, 100)); - assert_ok!(Assets::freeze(Origin::signed(4), 0, 2)); - assert_ok!(Assets::thaw(Origin::signed(3), 0, 2)); - assert_ok!(Assets::force_transfer(Origin::signed(3), 0, 2, 3, 100)); - assert_ok!(Assets::burn(Origin::signed(3), 0, 3, 100)); - }); - } - - #[test] - fn transferring_to_frozen_account_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 2, 100)); - assert_eq!(Assets::balance(0, 1), 100); - assert_eq!(Assets::balance(0, 2), 100); - assert_ok!(Assets::freeze(Origin::signed(1), 0, 2)); - assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Assets::balance(0, 2), 150); - }); - } - - #[test] - fn transferring_amount_more_than_available_balance_should_not_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::balance(0, 1), 100); - assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 50)); - assert_eq!(Assets::balance(0, 1), 50); - assert_eq!(Assets::balance(0, 2), 50); - assert_ok!(Assets::burn(Origin::signed(1), 0, 1, u64::max_value())); - assert_eq!(Assets::balance(0, 1), 0); - assert_noop!(Assets::transfer(Origin::signed(1), 0, 1, 50), Error::::BalanceLow); - assert_noop!(Assets::transfer(Origin::signed(2), 0, 1, 51), Error::::BalanceLow); - }); - } - - #[test] - fn transferring_less_than_one_unit_should_not_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::balance(0, 1), 100); - assert_noop!(Assets::transfer(Origin::signed(1), 0, 2, 0), Error::::AmountZero); - }); - } - - #[test] - fn transferring_more_units_than_total_supply_should_not_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::balance(0, 1), 100); - assert_noop!(Assets::transfer(Origin::signed(1), 0, 2, 101), Error::::BalanceLow); - }); - } - - #[test] - fn burning_asset_balance_with_positive_balance_should_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::balance(0, 1), 100); - assert_ok!(Assets::burn(Origin::signed(1), 0, 1, u64::max_value())); - assert_eq!(Assets::balance(0, 1), 0); - }); - } - - #[test] - fn burning_asset_balance_with_zero_balance_should_not_work() { - new_test_ext().execute_with(|| { - assert_ok!(Assets::force_create(Origin::root(), 0, 1, 10, 1)); - assert_ok!(Assets::mint(Origin::signed(1), 0, 1, 100)); - assert_eq!(Assets::balance(0, 2), 0); - assert_noop!(Assets::burn(Origin::signed(1), 0, 2, u64::max_value()), Error::::BalanceZero); - }); - } -} diff --git a/modules/edge-assets/src/token_traits.rs b/modules/edge-assets/src/token_traits.rs deleted file mode 100644 index dc7cc5aa..00000000 --- a/modules/edge-assets/src/token_traits.rs +++ /dev/null @@ -1,76 +0,0 @@ -use super::*; -use codec::FullCodec; -use frame_support::dispatch::DispatchResult; - -/// Abstraction over a fungible asset system. -pub trait FungibleAsset { - /// The balance of an account. - type Balance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + - Default + HasCompact; - - type AssetId: Member + Parameter + Default + Copy + HasCompact; - - // PUBLIC IMMUTABLES - /// The total amount of issuance in the system for a specific asset. - fn total_issuance(id: Self::AssetId) -> Self::Balance; - - /// The balance of a given account. - /// - /// This is the only balance that matters in terms of most operations on tokens. It alone - /// is used to determine the balance when in the contract execution environment. When this - /// balance falls below the value of `ExistentialDeposit`, then the 'current account' is - /// deleted: specifically `FreeBalance`. - /// - /// `system::AccountNonce` is also deleted if `ReservedBalance` is also zero (it also gets - /// collapsed to zero if it ever becomes less than `ExistentialDeposit`. - fn balance_of(id: Self::AssetId, who: AccountId) -> Self::Balance; - - // PUBLIC MUTABLES (DANGEROUS) - - /// Transfer some liquid free balance of an asset to another account. - fn transfer(id: Self::AssetId, from: AccountId, to: AccountId, amount: Self::Balance) -> DispatchResult; -} - -pub trait MintableAsset: FungibleAsset { - /// Increase the total issuance of of a specific asset by `amount` for a specific account. - /// - /// Returns `Ok` iff the mint was successful. - /// `Err` with the reason why otherwise. - fn mint(id: Self::AssetId, beneficiary: AccountId, amount: Self::Balance) -> DispatchResult; -} - -pub trait BurnableAsset: FungibleAsset { - /// Reduce the total number of assets a specific account owns for a specific asset. - /// - /// Returns `Ok` iff the burn was successful. - /// `Err` with the reason why otherwise. - fn burn(id: Self::AssetId, who: AccountId, amount: Self::Balance) -> DispatchResult; -} - -pub trait FreezableAsset: FungibleAsset { - /// Freeze an amount of tokens for a specific account. - /// - /// Returns `Ok` iff the mint was successful. - /// `Err` with the reason why otherwise. - fn freeze(id: Self::AssetId, who: AccountId) -> DispatchResult; - - /// Unfreeze an amount of tokens for a specific account. - /// - /// Returns `Ok` iff the mint was successful. - /// `Err` with the reason why otherwise. - fn thaw(id: Self::AssetId, who: AccountId) -> DispatchResult; -} - -pub trait ManageableAsset: FungibleAsset { - /// Set ownership of administrative functions for a specific token. - /// - /// Returns `Ok` iff the ownership transfer was successful. - /// `Err` with the reason why otherwise. - fn set_team(id: Self::AssetId, issuer: AccountId, admin: AccountId, freezer: AccountId) -> DispatchResult; - - /// Set ownership of administrative functions for a specific token. - /// - /// Returns `Ok` iff the ownership transfer was successful. - /// `Err` with the reason why otherwise. - fn set_owner(id: Self::AssetId, owner: AccountId) -> DispatchResult; -} diff --git a/modules/edge-assets/src/weights.rs b/modules/edge-assets/src/weights.rs deleted file mode 100644 index 8a7be663..00000000 --- a/modules/edge-assets/src/weights.rs +++ /dev/null @@ -1,211 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2020 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for pallet_assets -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 -//! DATE: 2020-12-19, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 - -// Executed Command: -// target/release/substrate -// benchmark -// --chain=dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_assets -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./frame/assets/src/weights.rs -// --template=./.maintain/frame-weight-template.hbs - - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for pallet_assets. -pub trait WeightInfo { - fn create() -> Weight; - fn force_create() -> Weight; - fn destroy(z: u32, ) -> Weight; - fn force_destroy(z: u32, ) -> Weight; - fn mint() -> Weight; - fn burn() -> Weight; - fn transfer() -> Weight; - fn force_transfer() -> Weight; - fn freeze() -> Weight; - fn thaw() -> Weight; - fn transfer_ownership() -> Weight; - fn set_team() -> Weight; - fn set_max_zombies() -> Weight; -} - -/// Weights for pallet_assets using the Substrate node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl WeightInfo for SubstrateWeight { - fn create() -> Weight { - (62_897_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn force_create() -> Weight { - (32_783_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn destroy(z: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 2_000 - .saturating_add((1_181_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(z as Weight))) - } - fn force_destroy(z: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 2_000 - .saturating_add((1_181_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(z as Weight))) - } - fn mint() -> Weight { - (53_822_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn burn() -> Weight { - (48_151_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn transfer() -> Weight { - (68_208_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn force_transfer() -> Weight { - (73_521_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - } - fn freeze() -> Weight { - (45_803_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn thaw() -> Weight { - (45_669_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn transfer_ownership() -> Weight { - (38_957_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_team() -> Weight { - (39_605_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn set_max_zombies() -> Weight { - (61_609_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - fn create() -> Weight { - (62_897_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn force_create() -> Weight { - (32_783_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn destroy(z: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 2_000 - .saturating_add((1_181_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(z as Weight))) - } - fn force_destroy(z: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 2_000 - .saturating_add((1_181_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(z as Weight))) - } - fn mint() -> Weight { - (53_822_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } - fn burn() -> Weight { - (48_151_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } - fn transfer() -> Weight { - (68_208_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) - } - fn force_transfer() -> Weight { - (73_521_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().writes(3 as Weight)) - } - fn freeze() -> Weight { - (45_803_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn thaw() -> Weight { - (45_669_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn transfer_ownership() -> Weight { - (38_957_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn set_team() -> Weight { - (39_605_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn set_max_zombies() -> Weight { - (61_609_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } -} diff --git a/modules/edge-chainbridge/Cargo.toml b/modules/edge-chainbridge/Cargo.toml deleted file mode 100644 index a9cb752c..00000000 --- a/modules/edge-chainbridge/Cargo.toml +++ /dev/null @@ -1,44 +0,0 @@ -[package] -name = 'edge-chainbridge' -version = '1.0.0' -authors = ['drew@commonwealth.im'] -edition = '2018' - -[dependencies] -# third-party dependencies -codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.101", optional = true } - -# primitives -sp-std = { version = "2.0", default-features = false } -sp-runtime = { version = "2.0", default-features = false } -sp-io = { version = "2.0", default-features = false } -sp-core = { version = "2.0", default-features = false } -sp-arithmetic = { version = "2.0", default-features = false } - -# frame dependencies -frame-support = { version = "2.0", default-features = false } -frame-system = { version = "2.0", default-features = false } -pallet-balances = { version = "2.0", default-features = false } - -chainbridge = { path = "../chainbridge", default-features = false, features = ["runtime-benchmarks"] } - -[features] -default = ["std"] -std = [ - "codec/std", - "serde", - "sp-std/std", - "sp-runtime/std", - "sp-io/std", - "sp-core/std", - "sp-arithmetic/std", - "frame-support/std", - "frame-system/std", - "pallet-balances/std", - "chainbridge/std", -] - -runtime-benchmarks = [ - "chainbridge/runtime-benchmarks", -] \ No newline at end of file diff --git a/modules/edge-chainbridge/src/lib.rs b/modules/edge-chainbridge/src/lib.rs deleted file mode 100644 index 4d670e88..00000000 --- a/modules/edge-chainbridge/src/lib.rs +++ /dev/null @@ -1,82 +0,0 @@ -// Ensure we're `no_std` when compiling for Wasm. -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_support::traits::{Currency, EnsureOrigin, ExistenceRequirement::AllowDeath, Get}; -use frame_support::{decl_error, decl_event, decl_module, dispatch::DispatchResult, ensure}; -use frame_system::{ensure_signed}; -use sp_arithmetic::traits::SaturatedConversion; -use sp_core::U256; -use sp_std::prelude::*; - -mod mock; -mod tests; - -type ResourceId = chainbridge::ResourceId; - -type BalanceOf = - <::Currency as Currency<::AccountId>>::Balance; - -pub trait Config: pallet_balances::Config + chainbridge::Config { - type Event: From> + Into<::Event>; - /// Specifies the origin check provided by the bridge for calls that can only be called by the bridge pallet - type BridgeOrigin: EnsureOrigin; - /// The currency mechanism. - type Currency: Currency; - /// Ids can be defined by the runtime and passed in, perhaps from blake2b_128 hashes. - type NativeTokenId: Get; - - type NativeTransferFee: Get; -} - -decl_event! { - pub enum Event where - ::AccountId, - Balance = BalanceOf, - { - /// A bridge transfer event from an Edgeware account to a destination account - TransferOverBridge(AccountId, Vec, chainbridge::ChainId, Balance), - } -} - -decl_error! { - pub enum Error for Module{ - InvalidTransfer, - } -} - -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - const NativeTokenId: ResourceId = T::NativeTokenId::get(); - - fn deposit_event() = default; - - // - // Initiation calls. These start a bridge transfer. - // - - /// Transfers some amount of the native token to some recipient on a (whitelisted) destination chain. - #[weight = 195_000_000] - pub fn transfer_native(origin, amount: BalanceOf, recipient: Vec, dest_id: chainbridge::ChainId) -> DispatchResult { - let source = ensure_signed(origin)?; - ensure!(>::chain_whitelisted(dest_id), Error::::InvalidTransfer); - let bridge_id = >::account_id(); - ::Currency::transfer(&source, &bridge_id, amount.into(), AllowDeath)?; - - let resource_id = T::NativeTokenId::get(); - Self::deposit_event(RawEvent::TransferOverBridge(source, recipient.clone(), dest_id, amount.clone())); - >::transfer_fungible(dest_id, resource_id, recipient, U256::from(amount.saturated_into::())) - } - - // - // Executable calls. These can be triggered by a bridge transfer initiated on another chain - // - - /// Executes a simple currency transfer using the bridge account as the source - #[weight = 195_000_000] - pub fn transfer(origin, to: T::AccountId, amount: BalanceOf) -> DispatchResult { - let source = T::BridgeOrigin::ensure_origin(origin)?; - ::Currency::transfer(&source, &to, amount.into(), AllowDeath)?; - Ok(()) - } - } -} diff --git a/modules/edge-chainbridge/src/mock.rs b/modules/edge-chainbridge/src/mock.rs deleted file mode 100644 index 3627c9e0..00000000 --- a/modules/edge-chainbridge/src/mock.rs +++ /dev/null @@ -1,159 +0,0 @@ -#![cfg(test)] - -use super::*; - -use frame_support::{ord_parameter_types, parameter_types, weights::Weight}; -use frame_system::{self as system}; -use sp_core::hashing::blake2_128; -use sp_core::H256; -use sp_runtime::{ - testing::Header, - traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, IdentityLookup}, - ModuleId, Perbill, -}; - -use crate::{self as example, Config}; -pub use pallet_balances as balances; - -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const MaximumBlockWeight: Weight = 1024; - pub const MaximumBlockLength: u32 = 2 * 1024; - pub const AvailableBlockRatio: Perbill = Perbill::one(); - pub const MaxLocks: u32 = 100; -} - -impl frame_system::Config for Test { - type BaseCallFilter = (); - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type Origin = Origin; - type Index = u64; - type Call = Call; - type BlockNumber = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type Header = Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = (); - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); -} - -parameter_types! { - pub const ExistentialDeposit: u64 = 1; -} - -ord_parameter_types! { - pub const One: u64 = 1; -} - -impl pallet_balances::Config for Test { - type Balance = u64; - type DustRemoval = (); - type Event = Event; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type MaxLocks = MaxLocks; - type WeightInfo = (); -} - -parameter_types! { - pub const TestChainId: u8 = 5; - pub const ProposalLifetime: u64 = 100; -} - -impl chainbridge::Config for Test { - type Event = Event; - type AdminOrigin = frame_system::EnsureRoot; - type Proposal = Call; - type ChainId = TestChainId; - type ProposalLifetime = ProposalLifetime; -} - -parameter_types! { - pub NativeTokenId: chainbridge::ResourceId = chainbridge::derive_resource_id(1, &blake2_128(b"EDG")); -} - -parameter_types! { - pub const NativeTransferFee: u64 = 1; -} - -impl Config for Test { - type Event = Event; - type BridgeOrigin = chainbridge::EnsureBridge; - type Currency = Balances; - type NativeTokenId = NativeTokenId; - type NativeTransferFee = NativeTransferFee; -} - -pub type Block = sp_runtime::generic::Block; -pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; - -frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - System: frame_system::{Module, Call, Config, Storage, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - Bridge: chainbridge::{Module, Call, Storage, Event}, - Example: example::{Module, Call, Event} - } -); - -pub const RELAYER_A: u64 = 0x2; -pub const RELAYER_B: u64 = 0x3; -pub const RELAYER_C: u64 = 0x4; -pub const ENDOWED_BALANCE: u64 = 100_000_000; - -pub fn new_test_ext() -> sp_io::TestExternalities { - let bridge_id = ModuleId(*b"cb/bridg").into_account(); - let mut t = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap(); - balances::GenesisConfig:: { - balances: vec![(bridge_id, ENDOWED_BALANCE), (RELAYER_A, ENDOWED_BALANCE)], - } - .assimilate_storage(&mut t) - .unwrap(); - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(1)); - ext -} - -fn last_event() -> Event { - system::Module::::events() - .pop() - .map(|e| e.event) - .expect("Event expected") -} - -pub fn expect_event>(e: E) { - assert_eq!(last_event(), e.into()); -} - -// Checks events against the latest. A contiguous set of events must be provided. They must -// include the most recent event, but do not have to include every past event. -pub fn assert_events(mut expected: Vec) { - let mut actual: Vec = system::Module::::events() - .iter() - .map(|e| e.event.clone()) - .collect(); - - expected.reverse(); - - for evt in expected { - let next = actual.pop().expect("event expected"); - assert_eq!(next, evt.into(), "Events don't match"); - } -} diff --git a/modules/edge-chainbridge/src/tests.rs b/modules/edge-chainbridge/src/tests.rs deleted file mode 100644 index e7a60cd6..00000000 --- a/modules/edge-chainbridge/src/tests.rs +++ /dev/null @@ -1,157 +0,0 @@ -#![cfg(test)] - -use super::mock::{ - assert_events, balances, expect_event, new_test_ext, Balances, Bridge, Call, - Event, Example, NativeTokenId, Origin, ProposalLifetime, - ENDOWED_BALANCE, RELAYER_A, RELAYER_B, RELAYER_C, -}; -use super::*; - -use frame_support::{assert_ok}; - - - - -const TEST_THRESHOLD: u32 = 2; - - -fn make_transfer_proposal(to: u64, amount: u64) -> Call { - Call::Example(crate::Call::transfer(to, amount.into())) -} - -#[test] -fn transfer_native() { - new_test_ext().execute_with(|| { - let dest_chain = 0; - let resource_id = NativeTokenId::get(); - let amount: u64 = 100; - let recipient = vec![99]; - - assert_ok!(Bridge::whitelist_chain(Origin::root(), dest_chain.clone())); - assert_ok!(Example::transfer_native( - Origin::signed(RELAYER_A), - amount.clone(), - recipient.clone(), - dest_chain, - )); - - expect_event(chainbridge::RawEvent::FungibleTransfer( - dest_chain, - 1, - resource_id, - amount.into(), - recipient, - )); - }) -} - -#[test] -fn transfer() { - new_test_ext().execute_with(|| { - // Check inital state - let bridge_id: u64 = Bridge::account_id(); - assert_eq!(Balances::free_balance(&bridge_id), ENDOWED_BALANCE); - // Transfer and check result - assert_ok!(Example::transfer( - Origin::signed(Bridge::account_id()), - RELAYER_A, - 10 - )); - assert_eq!(Balances::free_balance(&bridge_id), ENDOWED_BALANCE - 10); - assert_eq!(Balances::free_balance(RELAYER_A), ENDOWED_BALANCE + 10); - - assert_events(vec![Event::balances(balances::RawEvent::Transfer( - Bridge::account_id(), - RELAYER_A, - 10, - ))]); - }) -} - -#[test] -fn create_sucessful_transfer_proposal() { - new_test_ext().execute_with(|| { - let prop_id = 1; - let src_id = 1; - let r_id = chainbridge::derive_resource_id(src_id, b"transfer"); - let resource = b"Example.transfer".to_vec(); - let proposal = make_transfer_proposal(RELAYER_A, 10); - - assert_ok!(Bridge::set_threshold(Origin::root(), TEST_THRESHOLD,)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_A)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_B)); - assert_ok!(Bridge::add_relayer(Origin::root(), RELAYER_C)); - assert_ok!(Bridge::whitelist_chain(Origin::root(), src_id)); - assert_ok!(Bridge::set_resource(Origin::root(), r_id, resource)); - - // Create proposal (& vote) - assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_A), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = chainbridge::ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![], - status: chainbridge::ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - // Second relayer votes against - assert_ok!(Bridge::reject_proposal( - Origin::signed(RELAYER_B), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = chainbridge::ProposalVotes { - votes_for: vec![RELAYER_A], - votes_against: vec![RELAYER_B], - status: chainbridge::ProposalStatus::Initiated, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - // Third relayer votes in favour - assert_ok!(Bridge::acknowledge_proposal( - Origin::signed(RELAYER_C), - prop_id, - src_id, - r_id, - Box::new(proposal.clone()) - )); - let prop = Bridge::votes(src_id, (prop_id.clone(), proposal.clone())).unwrap(); - let expected = chainbridge::ProposalVotes { - votes_for: vec![RELAYER_A, RELAYER_C], - votes_against: vec![RELAYER_B], - status: chainbridge::ProposalStatus::Approved, - expiry: ProposalLifetime::get() + 1, - }; - assert_eq!(prop, expected); - - assert_eq!(Balances::free_balance(RELAYER_A), ENDOWED_BALANCE + 10); - assert_eq!( - Balances::free_balance(Bridge::account_id()), - ENDOWED_BALANCE - 10 - ); - - assert_events(vec![ - Event::chainbridge(chainbridge::RawEvent::VoteFor(src_id, prop_id, RELAYER_A)), - Event::chainbridge(chainbridge::RawEvent::VoteAgainst(src_id, prop_id, RELAYER_B)), - Event::chainbridge(chainbridge::RawEvent::VoteFor(src_id, prop_id, RELAYER_C)), - Event::chainbridge(chainbridge::RawEvent::ProposalApproved(src_id, prop_id)), - Event::balances(balances::RawEvent::Transfer( - Bridge::account_id(), - RELAYER_A, - 10, - )), - Event::chainbridge(chainbridge::RawEvent::ProposalSucceeded(src_id, prop_id)), - ]); - }) -} diff --git a/modules/edge-treasury-reward/Cargo.toml b/modules/edge-treasury-reward/Cargo.toml deleted file mode 100644 index 4c5c301e..00000000 --- a/modules/edge-treasury-reward/Cargo.toml +++ /dev/null @@ -1,47 +0,0 @@ -[package] -name = "edge-treasury-reward" -version = "1.0.0" -authors = ["drewstone "] -edition = "2018" -license = "GPL-3.0-or-later WITH Classpath-exception-2.0" -description = "Edgeware treasury reward module" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -serde = { version = "1.0", default-features = false, optional = true } -safe-mix = { version = "1.0", default-features = false } -codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] } -sp-std = { version = "2.0", default-features = false } -sp-runtime = { version = "2.0", default-features = false } -frame-support = { version = "2.0", default-features = false } -frame-system = { version = "2.0", default-features = false } -pallet-authorship = { version = "2.0", default-features = false } -pallet-staking = { version = "2.0", default-features = false } -pallet-balances = { version = "2.0", default-features = false } -pallet-treasury = { version = "2.0", default-features = false } - -[dev-dependencies] -sp-io = { version = "2.0", default-features = false } -sp-staking = { version = "2.0", default-features = false } -sp-core = { version = "2.0", default-features = false } -pallet-staking-reward-curve = { version = "2.0", default-features = false } -pallet-session = { version = "2.0", default-features = false } -pallet-timestamp = { version = "2.0", default-features = false } - -[features] -default = ["std"] -std = [ - "serde", - "safe-mix/std", - "codec/std", - "sp-std/std", - "sp-runtime/std", - "pallet-authorship/std", - "pallet-balances/std", - "frame-support/std", - "frame-system/std", - "pallet-staking/std", - "pallet-treasury/std", -] diff --git a/modules/edge-treasury-reward/src/lib.rs b/modules/edge-treasury-reward/src/lib.rs deleted file mode 100644 index 04d2c72d..00000000 --- a/modules/edge-treasury-reward/src/lib.rs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2018-2020 Commonwealth Labs, Inc. -// This file is part of Edgeware. - -// Edgeware 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. - -// Edgeware 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 Edgeware. If not, see . - -#![recursion_limit="128"] -#![cfg_attr(not(feature = "std"), no_std)] - -#[cfg(test)] -mod tests; - -use frame_support::traits::Currency; -use sp_std::prelude::*; -use sp_runtime::traits::{Zero}; - -use frame_support::{decl_event, decl_module, decl_storage}; -use frame_system::{ensure_root}; -pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; - -pub trait Config: pallet_treasury::Config + pallet_balances::Config { - /// The overarching event type. - type Event: From> + Into<::Event>; - /// The account balance - type Currency: Currency; -} - -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - fn deposit_event() = default; - /// Mint money for the treasury! - fn on_finalize(_n: T::BlockNumber) { - if >::block_number() % Self::minting_interval() == Zero::zero() { - let reward = Self::current_payout(); - ::Currency::deposit_creating(&>::account_id(), reward); - Self::deposit_event(RawEvent::TreasuryMinting( - >::free_balance(>::account_id()), - >::block_number(), - >::account_id()) - ); - } - } - - /// Sets the fixed treasury payout per minting interval. - #[weight = 5_000_000] - fn set_current_payout(origin, payout: BalanceOf) { - ensure_root(origin)?; - >::put(payout); - } - - /// Sets the treasury minting interval. - #[weight = 5_000_000] - fn set_minting_interval(origin, interval: T::BlockNumber) { - ensure_root(origin)?; - >::put(interval); - } - } -} - -decl_event!( - pub enum Event where ::BlockNumber, - ::AccountId, - Balance = ::Balance { - TreasuryMinting(Balance, BlockNumber, AccountId), - } -); - -decl_storage! { - trait Store for Module as TreasuryReward { - /// Interval in number of blocks to reward treasury - pub MintingInterval get(fn minting_interval) config(): T::BlockNumber; - /// Current payout of module - pub CurrentPayout get(fn current_payout) config(): BalanceOf; - } -} diff --git a/modules/edge-treasury-reward/src/tests.rs b/modules/edge-treasury-reward/src/tests.rs deleted file mode 100644 index 9a1b3fcf..00000000 --- a/modules/edge-treasury-reward/src/tests.rs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2018-2020 Commonwealth Labs, Inc. -// This file is part of Edgeware. - -// Edgeware 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. - -// Edgeware 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 Edgeware. If not, see . - -use sp_runtime::traits::BlakeTwo256; -use super::*; -use frame_support::{ - impl_outer_origin, parameter_types, - traits::{OnFinalize}, -}; - -use sp_core::{H256}; - -use sp_runtime::{ - Permill, ModuleId, - testing::{Header}, Percent, - traits::{IdentityLookup, One}, -}; - -use crate::GenesisConfig; - -impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} -} - -// Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. -#[derive(Clone, Eq, PartialEq, Debug)] -pub struct Test; - -parameter_types! { - pub const BlockHashCount: u64 = 250; -} -impl frame_system::Config for Test { - type BaseCallFilter = (); - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type Origin = Origin; - type Index = u64; - type Call = (); - type BlockNumber = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type Header = Header; - type Event = (); - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = (); - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); -} - -parameter_types! { - pub const ExistentialDeposit: u64 = 1; -} - -impl pallet_balances::Config for Test { - type MaxLocks = (); - type Balance = u64; - type Event = (); - type DustRemoval = (); - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); -} - -parameter_types! { - pub const ProposalBond: Permill = Permill::from_percent(5); - pub const ProposalBondMinimum: u64 = 1; - pub const SpendPeriod: u64 = 2; - pub const Burn: Permill = Permill::from_percent(50); - pub const TipCountdown: u64 = 1; - pub const TipFindersFee: Percent = Percent::from_percent(20); - pub const TipReportDepositBase: u64 = 1; - pub const TipReportDepositPerByte: u64 = 1; - pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry"); -} -impl pallet_treasury::Config for Test { - type ModuleId = TreasuryModuleId; - type Currency = Balances; - type ApproveOrigin = frame_system::EnsureRoot; - type RejectOrigin = frame_system::EnsureRoot; - type Event = (); - type OnSlash = (); - type ProposalBond = ProposalBond; - type ProposalBondMinimum = ProposalBondMinimum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; - type BurnDestination = (); - type SpendFunds = (); - type WeightInfo = (); -} - -impl Config for Test { - type Event = (); - type Currency = Balances; -} - -pub type Balances = pallet_balances::Module; -pub type System = frame_system::Module; -pub type Treasury = pallet_treasury::Module; -pub type TreasuryReward = Module; - -pub struct ExtBuilder { - existential_deposit: u64, -} - -impl Default for ExtBuilder { - fn default() -> Self { - Self { - existential_deposit: 0, - } - } -} - -impl ExtBuilder { - fn build(self) -> sp_io::TestExternalities { - let balance_factor = if self.existential_deposit > 0 { - 256 - } else { - 1 - }; - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - pallet_balances::GenesisConfig:: { - balances: vec![ - (1, 10000000000 * balance_factor), - (2, 10000000000 * balance_factor), - (3, 10000000000 * balance_factor), - (4, 10000000000 * balance_factor), - (10, 10000000000 * balance_factor), - (11, 10000000000 * balance_factor), - (20, 10000000000 * balance_factor), - (21, 10000000000 * balance_factor), - (30, 10000000000 * balance_factor), - (31, 10000000000 * balance_factor), - (40, 10000000000 * balance_factor), - (41, 10000000000 * balance_factor), - (100, 10000000000 * balance_factor), - (101, 10000000000 * balance_factor), - // This allow us to have a total_payout different from 0. - (999, 1_000_000_000_000), - ], - }.assimilate_storage(&mut t).unwrap(); - - GenesisConfig:: { - current_payout: 9500000, - minting_interval: One::one(), - }.assimilate_storage(&mut t).unwrap(); - t.into() - } -} - -#[test] -fn basic_setup_works() { - // Verifies initial conditions of mock - ExtBuilder::default().build().execute_with(|| { - // Initial Era and session - let treasury_address = Treasury::account_id(); - System::set_block_number(1); - >::on_finalize(1); - System::set_block_number(2); - >::on_finalize(2); - System::set_block_number(100); - >::on_finalize(101); - System::set_block_number(101); - >::on_finalize(102); - System::set_block_number(102); - >::on_finalize(103); - System::set_block_number(103); - >::on_finalize(104); - assert_eq!(Balances::free_balance(treasury_address) > 0, true); - }); -} - -#[test] -fn setting_treasury_block_reward () { - // Verifies initial conditions of mock - ExtBuilder::default().build().execute_with(|| { - // Initial Era and session - let treasury_address = Treasury::account_id(); - System::set_block_number(1); - >::on_finalize(1); - assert_eq!(Balances::free_balance(treasury_address)==9500000, true); - System::set_block_number(2); - >::on_finalize(2); - assert_eq!(Balances::free_balance(treasury_address)==19000000, true); - - ::set_current_payout(frame_system::RawOrigin::Root.into(),95).unwrap(); - ::set_minting_interval(frame_system::RawOrigin::Root.into(),2).unwrap(); - - System::set_block_number(3); - >::on_finalize(3); - assert_eq!(Balances::free_balance(treasury_address)==19000000, true); - System::set_block_number(4); - >::on_finalize(4); - assert_eq!(Balances::free_balance(treasury_address)==19000095, true); - - ::set_current_payout(frame_system::RawOrigin::Root.into(),0).unwrap(); - - System::set_block_number(5); - >::on_finalize(5); - assert_eq!(Balances::free_balance(treasury_address)==19000095, true); - System::set_block_number(6); - >::on_finalize(6); - assert_eq!(Balances::free_balance(treasury_address)==19000095, true); - - ::set_current_payout(frame_system::RawOrigin::Root.into(),105).unwrap(); - - System::set_block_number(7); - >::on_finalize(7); - assert_eq!(Balances::free_balance(treasury_address)==19000095, true); - System::set_block_number(8); - >::on_finalize(8); - assert_eq!(Balances::free_balance(treasury_address)==19000200, true); - - ::set_minting_interval(frame_system::RawOrigin::Root.into(),1).unwrap(); - ::set_current_payout(frame_system::RawOrigin::Root.into(),10).unwrap(); - - System::set_block_number(9); - >::on_finalize(9); - assert_eq!(Balances::free_balance(treasury_address)==19000210, true); - System::set_block_number(10); - >::on_finalize(10); - assert_eq!(Balances::free_balance(treasury_address)==19000220, true); - }); -} diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index e5f23d50..822a2a40 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "edgeware-cli" -version = "3.2.0" +version = "3.3.0" authors = ["Commonwealth Labs "] description = "Edgeware implementation using a substrate node." build = "build.rs" @@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"] wasm-opt = false [badges] -travis-ci = { repository = "hicommonwealth/edgeware-node", branch = "master" } +travis-ci = { repository = "hicommonwealth/edgeware-node", branch = "erup-4" } maintenance = { status = "actively-developed" } is-it-maintained-issue-resolution = { repository = "hicommonwealth/edgeware-node" } is-it-maintained-open-issues = { repository = "hicommonwealth/edgeware-node" } @@ -25,14 +25,14 @@ is-it-maintained-open-issues = { repository = "hicommonwealth/edgeware-node" } [[bin]] name = "edgeware" path = "bin/main.rs" -required-features = ["cli"] +required-features = [] [lib] crate-type = ["cdylib", "rlib"] [dependencies] # third-party dependencies -codec = { package = "parity-scale-codec", version = "1.3.4" } +codec = { package = "parity-scale-codec", version = "2.0.0" } serde = { version = "1.0.102", features = ["derive"] } futures = { version = "0.3.1", features = ["compat"] } hex-literal = "0.3.1" @@ -40,86 +40,102 @@ jsonrpc-core = "15.0.0" jsonrpc-pubsub = "15.0.0" log = "0.4.8" rand = "0.7.2" -structopt = { version = "0.3.8", optional = true } +structopt = { version = "0.3", optional = true } tracing = "0.1.19" parking_lot = "0.10.0" hex = "0.3.2" serde_json = "1.0" # primitives -sp-authority-discovery = { version = "2.0" } -sp-blockchain = { version = "2.0" } -sp-consensus-aura = { version = "0.8" } -sp-finality-grandpa = { version = "2.0" } -sp-core = { version = "2.0" } -sp-runtime = { version = "2.0" } -sp-timestamp = { version = "2.0", default-features = false } -sp-inherents = { version = "2.0" } -sp-keyring = { version = "2.0" } -sp-io = { version = "2.0" } -sp-consensus = { version = "0.8" } -sp-transaction-pool = { version = "2.0" } +sp-authority-discovery = { version = "3.0" } +sp-blockchain = { version = "3.0" } +sp-consensus-aura = { version = "0.9" } +sp-finality-grandpa = { version = "3.0" } +sp-core = { version = "3.0" } +sp-runtime = { version = "3.0" } +sp-timestamp = { version = "3.0", default-features = false } +sp-inherents = { version = "3.0" } +sp-keyring = { version = "3.0" } +sp-io = { version = "3.0" } +sp-consensus = { version = "0.9" } +sp-transaction-pool = { version = "3.0" } # client dependencies -sc-client-api = { version = "2.0" } -sc-chain-spec = { version = "2.0" } -sc-consensus = { version = "0.8" } -sc-transaction-pool = { version = "2.0" } -sc-network = { version = "0.8" } -sc-consensus-aura = { version = "0.8" } -sc-finality-grandpa = { version = "0.8" } -sc-client-db = { version = "0.8", default-features = false } -sc-offchain = { version = "2.0" } -sc-rpc = { version = "2.0" } -sc-basic-authorship = { version = "0.8" } -sc-service = { version = "0.8", default-features = false } -sc-tracing = { version = "2.0" } -sc-telemetry = { version = "2.0" } -sc-authority-discovery = { version = "0.8" } +sc-client-api = { version = "3.0" } +sc-chain-spec = { version = "3.0" } +sc-consensus = { version = "0.9" } +sc-transaction-pool = { version = "3.0" } +sc-network = { version = "0.9" } +sc-consensus-aura = { version = "0.9" } +sc-finality-grandpa = { version = "0.9" } +sc-client-db = { version = "0.9", default-features = false } +sc-offchain = { version = "3.0" } +sc-rpc = { version = "3.0" } +sc-basic-authorship = { version = "0.9" } +sc-service = { version = "0.9", default-features = false } +sc-tracing = { version = "3.0" } +sc-telemetry = { version = "3.0" } +sc-authority-discovery = { version = "0.9" } +sc-finality-grandpa-warp-sync = { version = "0.9.0", optional = true } # frame dependencies -pallet-indices = { version = "2.0" } -pallet-timestamp = { version = "2.0", default-features = false } -pallet-contracts = { version = "2.0" } -frame-system = { version = "2.0" } -pallet-balances = { version = "2.0" } -pallet-transaction-payment = { version = "2.0" } -frame-support = { version = "2.0", default-features = false } -pallet-im-online = { version = "2.0", default-features = false } -pallet-authority-discovery = { version = "2.0" } -pallet-staking = { version = "2.0" } -pallet-grandpa = { version = "2.0" } -pallet-evm = { version = "2.0" } +pallet-indices = { version = "3.0" } +pallet-timestamp = { version = "3.0", default-features = false } +pallet-contracts = { version = "3.0" } +frame-system = { version = "3.0" } +pallet-balances = { version = "3.0" } +pallet-transaction-payment = { version = "3.0" } +frame-support = { version = "3.0", default-features = false } +pallet-im-online = { version = "3.0", default-features = false } +pallet-authority-discovery = { version = "3.0" } +pallet-staking = { version = "3.0" } +pallet-grandpa = { version = "3.0" } +pallet-dynamic-fee = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +pallet-evm = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } # node-specific dependencies -edgeware-runtime = { version = "3.2.0", path = "../runtime" } -edgeware-rpc = { version = "3.2.0", path = "../rpc" } -edgeware-primitives = { version = "3.2.0", path = "../primitives" } -edgeware-executor = { version = "3.2.0", path = "../executor" } +edgeware-runtime = { version = "3.3.0", path = "../runtime", default-features = false } +edgeware-rpc = { version = "3.3.0", path = "../rpc" } +edgeware-primitives = { version = "3.3.0", path = "../primitives", default-features = false } +edgeware-executor = { version = "3.3.0", path = "../executor", default-features = false } +edgeware-rpc-txpool = { path = "../../client/rpc/txpool", default-features = false } +edgeware-rpc-primitives-txpool = { path = "../txpool", default-features = false } +edgeware-rpc-debug = { path = "../../client/rpc/debug", default-features = false } +edgeware-rpc-primitives-debug = { path = "../debug", default-features = false } +edgeware-rpc-trace = { path = "../../client/rpc/trace", default-features = false } # CLI-specific dependencies -sc-cli = { version = "0.8", optional = true } -frame-benchmarking-cli = { version = "2.0", optional = true } -fc-consensus = { version = "0.1" } -fp-consensus = { version = "0.1" } -fc-rpc-core = { version = "0.1" } +sc-cli = { version = "0.9", optional = true } +frame-benchmarking-cli = { version = "3.0", optional = true } +edgeware-opts = { path = "../opts", version = "0.1.0", optional = true } + +fc-consensus = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fp-consensus = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-rpc = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", features = ["rpc_binary_search_estimate"] } +fp-rpc = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-rpc-core = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-db = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-mapping-sync = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } # WASM-specific dependencies wasm-bindgen = { version = "0.2.57", optional = true } wasm-bindgen-futures = { version = "0.4.7", optional = true } -browser-utils = { version = "0.8", package = "substrate-browser-utils", optional = true } +browser-utils = { version = "0.9", package = "substrate-browser-utils", optional = true } +libp2p-wasm-ext = { version = "0.28", features = ["websocket"], optional = true } + +tokio = "0.2" [target.'cfg(target_arch="x86_64")'.dependencies] edgeware-executor = { path = "../executor", features = [ "wasmtime" ] } -sc-cli = { version = "0.8", optional = true, features = [ "wasmtime" ] } -sc-service = { version = "0.8", default-features = false, features = [ "wasmtime" ] } -sp-trie = { version = "2.0", default-features = false, features = ["memory-tracker"] } +sc-cli = { version = "0.9", features = [ "wasmtime" ] } +sc-service = { version = "0.9", default-features = false, features = [ "wasmtime" ] } +sp-trie = { version = "3.0", default-features = false, features = ["memory-tracker"] } [dev-dependencies] -sc-keystore = { version = "2.0" } -sc-consensus = { version = "0.8" } -sc-consensus-epochs = { version = "0.8" } +sc-keystore = { version = "3.0" } +sc-consensus = { version = "0.9" } +sc-consensus-epochs = { version = "0.9" } futures = "0.3.4" tempfile = "3.1.0" @@ -130,30 +146,28 @@ regex = "1" platforms = "0.2.1" [build-dependencies] -structopt = { version = "0.3.8", optional = true } -frame-benchmarking-cli = { version = "2.0", optional = true } -substrate-build-script-utils = { version = "2.0", optional = true } -substrate-frame-cli = { version = "2.0", optional = true } -sc-cli = { version = "0.8", optional = true } +structopt = { version = "0.3", optional = true } +frame-benchmarking-cli = { version = "3.0", optional = true } +substrate-build-script-utils = { version = "3.0", optional = true } +substrate-frame-cli = { version = "3.0", optional = true } +sc-cli = { version = "0.9", optional = true } [features] default = [ "cli" ] -browser = [ - "browser-utils", - "wasm-bindgen", - "wasm-bindgen-futures", -] cli = [ "edgeware-executor/wasmi-errno", "sc-cli", "frame-benchmarking-cli", "substrate-frame-cli", "sc-service/db", + "sc-finality-grandpa-warp-sync", "structopt", "substrate-build-script-utils", + "edgeware-opts" ] - +frontier-block-import = [] +cli-completion = [] runtime-benchmarks = [ "edgeware-runtime/runtime-benchmarks", "frame-benchmarking-cli", -] \ No newline at end of file +] diff --git a/node/cli/browser-demo/.gitignore b/node/cli/browser-demo/.gitignore deleted file mode 100644 index 0c6117d9..00000000 --- a/node/cli/browser-demo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -pkg \ No newline at end of file diff --git a/node/cli/browser-demo/README.md b/node/cli/browser-demo/README.md deleted file mode 100644 index 4faebcbc..00000000 --- a/node/cli/browser-demo/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# How to run this demo - -```sh -cargo install wasm-pack # If necessary - -# From the `node/cli` directory (parent from this README) -wasm-pack build --target web --out-dir ./demo/pkg --no-typescript --release -- --no-default-features --features "browser" - -xdg-open index.html -``` diff --git a/node/cli/browser-demo/build.sh b/node/cli/browser-demo/build.sh deleted file mode 100755 index be52b7a5..00000000 --- a/node/cli/browser-demo/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -cargo +nightly build --release -p node-cli --target wasm32-unknown-unknown --no-default-features --features browser -Z features=itarget -wasm-bindgen ../../../../target/wasm32-unknown-unknown/release/node_cli.wasm --out-dir pkg --target web -python -m http.server 8000 diff --git a/node/cli/browser-demo/favicon.png b/node/cli/browser-demo/favicon.png deleted file mode 100644 index 8a4548ce34dfa220f612080820cfde778a39cb8f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10338 zcmYLP1yoaS+(wZQfk{a_5mcmyv>+u2qR5bj(d7VXk&w|jQbIxLPKhB5DS^?QA~Be> zGziGpzKj3wJKu9I=j@F4zQ5;ve)Zn>E>cVL2@Mq+6$uFmjk?-nZ4#18f){_3q`)_D zIm|2x$>n3MXF4jp|8W2QeLg-uetv!d0RcflK_MX_VPRnr5fKOg(F;6y@IXvVOdNoO zxP*j+q@<*jl$1088EF|AnTHP_$^wwPz@tZxgej~>gnm} z128Z!Ff=eUG&BNWY;0^|YyvZZ!CuI668y0eJoTwX?Ici?fT1iz@&(H#c`TcMo?D0G^(nZ{ED| zdgJxh>n#9pZ*LzTA739|KVLrp@7}%h_xDHmBLWbJfPjF&z`&rOpx~h3kl^5ukdV;O z(6G?3@UZZR@bHL;h{(vusK}`3sAyz#G!lu7iHV7giH(bmjf;zmkB?7CNJvabe4m*3 z{{8!;q@?8JF(<4>F)0B z>FMq5?d$FB@9P`r?;ji(7#tiN8XO!R8X6fM9vvAO9UU1P9UUJVn;0LToR|QvsmaOd zsi_~+(=$JQ0N2l%nc1H|=VoW;=jMQGVSXOFu&{{5E-qr178h|#OTTcqVf>&8^?Rx3{)-wzqe8cJ_96_xJV=_64TdJb+BN zWTYh5ft@eU`+KYNcD5M{XM?7``7t`@lo-?TqSWw8gC-HkVTpdIuznK{@L`HO%;X5( z5npN=E#+pjd4(c{(Js@-utc}8IBqBXov{8J_{6U^N!lLFkfj7X+1Fy7)$nv6ImVJx z?szijH$G>mSslenblh}AbvmYNFFMuu+U?xF-Dm5u5_I5ROAA7tIsQ2E6d|K5sIz3o$M{LPA|;*R$&mtt|s+o)K?&I~!SYvz&J zUjGn_sjC7^uk`#E;;Xr=-rLo|&?ll9?E9Uu(VJyPzH$BsT7&NGlLW6TR_SA&1=Hth zH8Lf7gWmae?sYz$?uc)d5dX5%++|DERP^5_&yI&);?}a0md`rJgIP==`wy$!v|#5c z&PU@1@^-S5*fhaDO>_Vkv{5(3*Cv`tK>c25fgh(yJ8=3!h%%D1ycF^bWcTT#@|8 z-)Tz2MKd0Ldz^G$1?7bGt;T#B60MjA<6Zc1=3kZ>m@KuSu(?x?<82xa9Q;AErED;w zyTu~iV6?Jgn<3iNnpJ<%N#3t@5v+M?f_LV56HWV`prv&-4)+-PDS%@`+qRQYcl{Ps zPLiMDcrs09FDO6)BPG!!%ryYCh&LY+fCHHupIijy~r}< zAD8;VY8TXy>PTNoj$4g2;qB1WLnb|kqx|;CVqKSEP2Q)G$ko3>H-0*IEU1)c(kVTY z`r_lC4}Zx|4D&L?cz&-I%w?enme1tvsMmYz?s-7Vb%XOItVPGO*z@VS+Mq;X`?wn| zad@{v6gqQF-fJdR$r1nVXvA$IS1)yn1(RRqAOx(Jm4L$Tg60jSnj8f!zB|eOnT8bIQ!mi=P?1()@I&* zOct9!6~1Ek-iT($r;vHIVNB2YTZDzl=fddy7Au0q&WMdte>-IKOJ&DuaJ6drr^Raq zSkvRL2AGLM;l?Wf|I;lQu4W8Gd(Xsf;xFzUnPJXkc8#igt6Ue_6d$Gp(dWA7hNTcvXf2m>OAJxw3PMweYvTYuO3RHmQD4iG7xToc z3Cu-aNpHyzn;@gG&aKumM(=??$YPP&43== z-J_r-ig=)MnPL;r{pNy1Q9Xz0%e3{Y2F%xH-%oamRD5!8rnBUXO`!d_WglwA^O5T+ z&j`muuj83ASAIr z{u6YDe`V*Ue!1pL@T%W^nMvKz_j{kLU>t<(K59S_wuR%|+)Ky=w?R{W)Ke{0_7~-M zLH)me*SifGe%&^~=+JsUaXF!|fqg(|odmZ+Mzas{^dfuhaYf0#iuWD5Jm0Fbh9lx9 z#mgB8#i@?gtf?JfKm)*VLK#vb%&2K~7E`kJE+>d|Tm2#?M$vURmUX)q*MP{t&Xn&r zw1H9M5-+%EudZwJvv6;{>k8eM))9n`ZpMEExv?=zPj-?VCwczU+eS)tX4Tm(o%A$(cELHx zsEws~$`57#yey??x~Evu^$pC7+T#DIYAk{-XL57Ys6~-j<&k3Uw=;g_(T`qMe|N)q z^eYFhI2;MZnlQV^h2kD;Q!3$Uxbwg&Lv^1C0Nw0}jjDU~KqV!eMP09zyfP}3E zraWBw0p|5R>3jwRuo!{F3UK6Apt&N%?H2yU3flg)4^4zrb!o zX2L-FSnL#odt_oX3iP&5={w%q;5NosK@TTYSW_>58GZ5!G=l~T$=SQp9ejW$&WP}Y zm~WXhg3;9&>R>%yY63ExdFBU^$YrKC86_oe?cG*zxlOz)iQYm^Rn-AB%8yG z)n*Q|^sKDch)zS&1~y$!#YhPF=XO@^P8k+tZVEYMwrZEx9uTuw=KZ0C8T!@ccZ_FP z2N+1+-OY{FDoq@HNxof9m(TFz><`am223(g%ac*nnbQAsiVe&%liM*7D405LHBwm2obNuo@ zc22Mm*Y(QtZ~PORR8~AO@)28+PyZUimthUkC!LSToCY{Ib7CBHY^r{1NIJnDBgfY= zx`L-X`^0al!b|tU>+#AQsD99(EkLuXBI@3{gn#n*?Lm$tPddz1!45S(+tbCk86;| z@OONiC{M^q_!px;8SiJ%lsIjL)a!lCOdN#8)Pv!~LHUS2o`b#ATsv*MAj{F7J7t_x z&6R9MKR|sbPdZ5AW%ReI1I;fe`@PElTKSn!dr1FhP}P>3IyHo5r(P)x>hDT>5!9de z8@Obmfb3Y%1H#H5H7*`VJ&`sXCd1H?{%tLJviJS{&D%(g%P>L!BoPBPN9u?f5`F)$ zL>5klKWQ&6f=$^p42$q#W*s(;{+do^IZ_(st_x;1?tWDkLCeab!u^2 z&)mX;Mj{%M+&n+?*7Y^o6N*_D!g#}rsnu^%2eI@#Y$Jov>ujPlUHIUkS6L#snNKjf z-hxDE<`=*n%hlb_P_d?YsUEjf_jduUZQ?EM>6LfTB(d4uazpil5mKcerzO4!-Bxuo z{Iy#@^~WRqDv+(e7S@DRT#!iyf~g%^xL4@XhTF%~IPF&5ztUL;^Y>eBA^BH-SMn3X zCz%Wvw;lr95h-09=#%J79=w4kjO|*h$FD#)HlmAB2kXI%WT5M-8`84B`9*`~aV?^(keUP2oy7TRE`)8|@aMN@)Ip5pHk3p6~-V?0sQ6JAb3BjF<&S{ zjXjelPp=iD;bfff3a{wc%yzS5?=(E*Kf3&p>$T~>P)iPx?T&6XJ|BNaN zezd57S8i|oKMI_|?J4_+-x^>lG_I+A4Y6Mk;VkTajIHiow16duH<r1S+d5iSMp8kekul)g>V zo^;v@D^e{x&wm&mF}QSwa{`DT)m-@7Y*k3*pB$p66u{J=PV-@wUSU6+w#uKk25lKZ z#$p};C*kk)f!$qvW}p!nIdS)qI45(b3ppGRl;T_H3w`IBez|%PmzqjEfk3rj5j&9qU?7EoZZQVed@X zk!v1)ZBkMU9XF8wzOUVQLi!8**Dr)t@NoO6n6JmL!;K0-sfk#B%{Z?&12<`4c8nS> znf*9K?C+YmFUKf$xF1)IgryKk3=0S5-F`TDtl5ImK z7JHbwt(v{*O{P1hA!B(*-viWjorqlo1t8)juWcx%jwqpC3tRWAMD&aoXiOcH^i2Dt zwNL2TcP<+-FM-)iYREW@)?8=lcSPuuMr`Bby?Mj(ApR@+T*x zxk!mBqt68gyA-e?{%};G_u%iAXOTu1QR{t}o47o+X*5$aA^+~Xj zdE|rod<0~m$f%wn6H;2i*_wJu*|;dr7#~^GWkTS#>OWQJxQkPM%}cbYm-^OIOa>tA z2@$K`ojV#;K`ruc`3!y)*lrJ}I`h_`OGE7LQ9L4EHxmSP zlAHuDLG}M`w)U@=X^6GW&z+rE@KOm7;gpEoQ;H?c<02}H zO`rZ6p;sp1%?|hK$^H0%7SqW5O_EiI+a^b^RepGmSN2A55JV{IHmTEQ)l21==wD7= z$zjy?I$bm+tZ5S=)Tt=1}hv&o0(7>d8$J?8pX+ob=(xmYl| zMNX)}=w{TVU5a2t)?T;=s%#T7g#M1vjfDIAboiJ=B#A!i5+mN?Z)Uj2aj_Uc8A=4D zt_t17I6ij$1rf+j8VCzE`g?Pa-kY(I4;Z+dNf>=TKuQP5^FpYsz9mPb)F4 z_~1Bs62juii;}xs+|D@46N&)&Jg1!862Ea5E1pum4~BzQzdc^Lef4g?iL{54d1)ekjGW%G=kBN{{>7f(A@AESh zws(It?_Z?=@)bg_7yUbeX&01L*zh%S-usEgU#i~kP1397xT$#5yLkk$JGVZoiYX#N6wTjDe0+<= zDqK1>Vw-h4P`qMIu3F~{|F+*ng?dDY*Sl|+4=2Nu+N&-)P25E37wk$$vOe{uxO(KH{M>V*J+k@h7LVHO8S(6?VA$k-hW- z)!xT~|B=Hhvk|a}#j5n$U({yCr>@4Ae_B2x!rfL`X5@+WS%4KUXSJV)%=3e23ErjF&4oT3II(28 zilyjGnL7?~tI|W>`%W&u4I{!zIouE5W?GxweB~Wp(eHt*s)f!)dR}T}DKljpTx+<) z*8|b#>7>(TtDBnW0?NVg16~z$qs6BM`AHb`5s}0v?SU`!14Mf!Xv}y^Rqy3b)2aD+ z)ASYatg4RdN%$2w=Q-Ckg!ysKF29e)?L-dL``(sEIcYP0&~>as#g9eVp}>}48t_H? z1MA~(zc_?~`yQW9W$(37GApS@k4#z-SnEFe?+K}W2b);VjK{0jC28YSCln-BF22zE zgp_nH@ox_;AJpDm;)eUe)c;%tSj0!oQ{t%9vY!I8 z`CQb2pzf4kV5-;i&^uRI>yg1fqc7_o{>AFQovw&o7nyMGc)AB7r&ZVo6_!^335fw~ z)5sAnp~Q~)e9Bq1=a+4uOkN}NOE{1Y_vCfB(mrr17t~cHfchXpzM(R5?&M_hhx&e$ zOWirE+dma9VRZi7yDTljKL29#gNfiUG6=A!fB43ylW@muFEb^%Ji1Mu#rR$n0vLjj z5INmooLwK>QVHbuNqpjXZB^^0P%%h0S3~~_(vPgJvfwE zI-C$7aJ6Fkz}$mN)cCf+X4{GzHOyqWIbY9zQQD+@V%=-m_OJiw3%yCjQZ6daxDmQi@*}hl#aTA3`tqL~8eA}EQe!+`xl-GoeeW0C)fbudU=5#2R`V^2@^57+drNm*UV*Rj5*M~cACs;27*+6qTy_~E*30| zqbTPqbez?^W0S3vjf+?K?rC_%0~MfS7aPr*G8R|-P5xqrWFPNTU15d_-yakO3Xz8; z%`U|aV!Rf>f~tiz^c^46G2zH_iwVV1YNBFOYngvSL5lb?pP@x|!Qe#C_6g*+vCXup z{unxfs)<~YUoR1{%b#$9SH6q_HYv#y(cg{l{xF6*V9c?>Bw9zsLERp?6A?sNrcRlYr&fNT{! z215#S8n2At+q1AYfm4`W(Yy}$mh~d&6;son5iXBEuMsdg(eI;{p-@$g<_c4!wPeMcg|MGg+Mf+#He`bkB0JK?yOdM)^>*-wWlKS~ZY^}CxTk=m+XrO$n#1d=KGAr}9DCGkX;n~cL zDF_M`q}N)K*tu=;Ql^lX zO*^w2q1caWX{NV__76zh{g^m~!e8g0&Hz?ehw%qmeXyNd__k&6?lVBMAa0kN*EhiI zpV!hPN9g_O#4Ler5x`s`H_I5B=SR3S__#%4d>}|w-d=}`106ZJ&79qO^#Bw(aY5(@ zlYQ2IgyOv?m+6l9M;z1+ZVL4ZQ{w|W<#}}aj4w=WsRr8RIQaDVnCA9D43tHkbL3k4 z;|=i2qNv#;+V5c53oBEHLZqzPM6q$q<%%>|)YTSBwyOQpa2~k#0B^=$*6Ecsd)A@H zooc@Zf(Cih68~7LNXlQGd#rI1Y6$OK0WXyEme7s_~KB=N(@`=eq zzYzbu6%3r{x=!p*KBPpr{HM0l*ai} zIxOfWkwl%ElRH83T3A`>vmc#b!nyf{lq5%H&TrdyJUsw4Ee!D-Tup-xPcGXTedy4F z(0kWp`JG`F|4X#LfZ|&C;M-!NT73?xfx8r6*~#ugJdlTu4!Z`BzWNW6BWx$6o$~do zE|WX!1JB6Cv9LquJ(T;m`4)zM|_~#mMGJ9-mtW|6|hKTHr%Hto$LtM zWBQKu>YUsZ`Yw!&wpS-`McjX&(H-FFJ;&>Ek4jfnW5uw-w*itk2b|cF0lDaJfdw%V z%~i3H6ElH(7ksuKS7q|$zRM?_HS1w{H8Jq#?ox&4Y2=MXW{gTLqX%|^YkkjN8)Xzn zdJ^0v->S)oF7P@fISIWJ?elf+!@{~xNlvO4L%A!RV2^yrFsCmz0~(dRlIx0$vj7N; zY0L{0g(DNz(#hH{%tN{iy6R1%)mkXY;{KG{pFb-5)GEh-GQkB& zx&jfu4{V*Sq0T>=vO*@m0HP=z#acB z8oz&y6p;m_qRm}oBbdH4zY!Y$nYY$k?%Jj|%D9^)ve{6?8kS`Cp^ZCRvA%=!Vy00% zDZv3S2Rs|n7>;YC9E6oe??-Fxs!60 zScE(sGsk9_2mj%jxlN zbW2lKz;~6dD|f0L0x90?TAa@#HIO}^k+wCg*c>U3ZEgBHF)H3feO>v+(QSO2S~u^1 zYs8J~A}?>J>1gbM*!O6fstcv<%L_3U)Gj*$xuF6UEZJ{DL|iH_p%{q@D~3M2gg`)O zN3$d|mW$L20ge~zrvi)yn1~9?K(440E-ixG4nGO=1(=1%MEs=To>gTc-xklF3>>Oq zgB}t{aG>7ijI!&(v|Q)k>myRckXq5Ez!c;6s)l%{Bb1KB5EbJ1LTlEou5<0qe^zW* z2y(S2+u@mxs|;JFiHI!c8{@bn-M_YNmm4owka3EM0Vm4!z`IxFsV}<}tlY`OfmJ-}<4~#C%tg;VaDcg59pyYHfOUbyeuwzW2E zg;`@kNfyAW`lD>(0L{&@pyFn5ZaUdH?UF*U%iPiT+>#CbVtCU(5xM}8kLy>Xw5G?q+ z=hO$LJ~osa53#is%tIu3edF+91j7VN?>*qAOxmKQg(9{Ictd=sJTJjQv@%#~2@L$> za1La6{QAgPc2VKmK*MVX4t$^}Qfp59-LdlIj$clfI{(N(P}{q0G2-=R%^NkAs2Amf zl~#C*TE*=jG~6a$&lk?M9!@0UNjt#QZgC?2d+U~t#*9ADb3~CYbKzcXOM> zkA2Oy&4tvpKWYL7{IsB&eO7?QB#NClnuE^Q+rE>oM^gZnhG&}tH=n_eU>w&F5r|jN z&)S>4Rajd^21HicpWl%WGY?(S-W24olWU%oE}Le>3JaF#^CRUWn17ykjP<}#-(#X5 zZ6CjX!J9rILttow&%CTmd4RsEHE>Gemslzw7k;P;)7p)oVksZ4oj z6yqEBqrS+rd_4c)?~QA-%jKAfUd@KIRhb3jdR@(!=wy_c35+n#+jzHDU#~B@SG8(m zIqHsHlTp=pNh*J=!I4`heW_`Mf#t*|lSZje!&0PfrM^J<22=3Ub9ueM)Z0O2WjVkv PrbyIPG#^(enFsw3U`DIs diff --git a/node/cli/browser-demo/index.html b/node/cli/browser-demo/index.html deleted file mode 100644 index 60acfde3..00000000 --- a/node/cli/browser-demo/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Substrate node - - - - - diff --git a/node/cli/build.rs b/node/cli/build.rs index c2955f40..5845ccb7 100644 --- a/node/cli/build.rs +++ b/node/cli/build.rs @@ -1,18 +1,20 @@ -// Copyright 2018-2020 Commonwealth Labs, Inc. -// This file is part of Edgeware. +// This file is part of Substrate. -// Edgeware is free software: you can redistribute it and/or modify +// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. -// Edgeware is distributed in the hope that it will be useful, +// This program 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 +// 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 Edgeware. If not, see . +// along with this program. If not, see . fn main() { #[cfg(feature = "cli")] @@ -23,11 +25,14 @@ fn main() { mod cli { include!("src/cli.rs"); - use std::{fs, env, path::Path}; + #[cfg(feature = "cli-completion")] use sc_cli::structopt::clap::Shell; + #[cfg(feature = "cli-completion")] + use std::{env, fs, path::Path}; use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; pub fn main() { + #[cfg(feature = "cli-completion")] build_shell_completion(); generate_cargo_keys(); @@ -36,6 +41,7 @@ mod cli { /// Build shell completion scripts for all known shells /// Full list in https://github.com/kbknapp/clap-rs/blob/e9d0562a1dc5dfe731ed7c767e6cee0af08f0cf9/src/app/parser.rs#L123 + #[cfg(feature = "cli-completion")] fn build_shell_completion() { for shell in &[Shell::Bash, Shell::Fish, Shell::Zsh, Shell::Elvish, Shell::PowerShell] { build_completion(shell); @@ -43,19 +49,23 @@ mod cli { } /// Build the shell auto-completion for a given Shell + #[cfg(feature = "cli-completion")] fn build_completion(shell: &Shell) { let outdir = match env::var_os("OUT_DIR") { None => return, Some(dir) => dir, }; let path = Path::new(&outdir) - .parent().unwrap() - .parent().unwrap() - .parent().unwrap() + .parent() + .unwrap() + .parent() + .unwrap() + .parent() + .unwrap() .join("completion-scripts"); fs::create_dir(&path).ok(); - Cli::clap().gen_completions("edgeware-node", *shell, &path); + Cli::clap().gen_completions("substrate-node", *shell, &path); } } diff --git a/node/cli/doc/shell-completion.adoc b/node/cli/doc/shell-completion.adoc deleted file mode 100644 index 8afbd37a..00000000 --- a/node/cli/doc/shell-completion.adoc +++ /dev/null @@ -1,41 +0,0 @@ - -== Shell completion - -The Substrate cli command supports shell auto-completion. For this to work, you will need to run the completion script matching you build and system. - -Assuming you built a release version using `cargo build --release` and use `bash` run the following: - -[source, shell] -source target/release/completion-scripts/substrate.bash - -You can find completion scripts for: -- bash -- fish -- zsh -- elvish -- powershell - -To make this change persistent, you can proceed as follow: - -.First install - -[source, shell] ----- -COMPL_DIR=$HOME/.completion -mkdir -p $COMPL_DIR -cp -f target/release/completion-scripts/substrate.bash $COMPL_DIR/ -echo "source $COMPL_DIR/substrate.bash" >> $HOME/.bash_profile -source $HOME/.bash_profile ----- - -.Update - -When you build a new version of Substrate, the following will ensure you auto-completion script matches the current binary: - -[source, shell] ----- -COMPL_DIR=$HOME/.completion -mkdir -p $COMPL_DIR -cp -f target/release/completion-scripts/substrate.bash $COMPL_DIR/ -source $HOME/.bash_profile ----- diff --git a/node/cli/src/browser.rs b/node/cli/src/browser.rs deleted file mode 100644 index c1373bb9..00000000 --- a/node/cli/src/browser.rs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2018-2020 Commonwealth Labs, Inc. -// This file is part of Edgeware. - -// Edgeware 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. - -// Edgeware 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 Edgeware. If not, see . - -use crate::chain_spec::ChainSpec; -use log::info; -use wasm_bindgen::prelude::*; -use browser_utils::{ - Client, - browser_configuration, set_console_error_panic_hook, init_console_log, -}; -use std::str::FromStr; - -/// Starts the client. -#[wasm_bindgen] -pub async fn start_client(chain_spec: Option, log_level: String) -> Result { - start_inner(chain_spec, log_level) - .await - .map_err(|err| JsValue::from_str(&err.to_string())) -} - -async fn start_inner(chain_spec: Option, log_level: String) -> Result> { - set_console_error_panic_hook(); - init_console_log(log::Level::from_str(&log_level)?)?; - let chain_spec = match chain_spec { - Some(chain_spec) => ChainSpec::from_json_bytes(chain_spec.as_bytes().to_vec()) - .map_err(|e| format!("{:?}", e))?, - None => crate::chain_spec::development_config(), - }; - - let config = browser_configuration(chain_spec).await?; - - info!("Edgeware browser node"); - info!("✌️ version {}", config.impl_version); - info!("❤️ by Commonwealth Labs, 2018-2020"); - info!("📋 Chain specification: {}", config.chain_spec.name()); - info!("🏷 Node name: {}", config.network.node_name); - info!("👤 Role: {:?}", config.role); - - // Create the service. This is the most heavy initialization step. - let (task_manager, rpc_handlers) = - crate::service::new_light_base(config) - .map(|(components, rpc_handlers, _, _, _)| (components, rpc_handlers)) - .map_err(|e| format!("{:?}", e))?; - - Ok(browser_utils::start_client(task_manager, rpc_handlers)) -} \ No newline at end of file diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index ab2823c4..d3cba9d8 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -16,13 +16,10 @@ //! Substrate chain configurations. -use edgeware_runtime::constants::currency::*; -use edgeware_runtime::Block; use edgeware_runtime::{ - AuraConfig, AuthorityDiscoveryConfig, BalancesConfig, CouncilConfig, - DemocracyConfig, GrandpaConfig, ImOnlineConfig, IndicesConfig, SessionConfig, - SessionKeys, StakerStatus, StakingConfig, SudoConfig, SystemConfig, - TreasuryRewardConfig, VestingConfig, wasm_binary_unwrap, EVMConfig, + constants::currency::*, wasm_binary_unwrap, AuraConfig, AuthorityDiscoveryConfig, BalancesConfig, Block, + CouncilConfig, DemocracyConfig, EVMConfig, GrandpaConfig, ImOnlineConfig, IndicesConfig, SessionConfig, + SessionKeys, StakerStatus, StakingConfig, SudoConfig, SystemConfig, TreasuryRewardConfig, VestingConfig, }; use pallet_im_online::ed25519::AuthorityId as ImOnlineId; use sc_chain_spec::ChainSpecExtension; @@ -31,7 +28,7 @@ use sc_telemetry::TelemetryEndpoints; use serde::{Deserialize, Serialize}; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_aura::ed25519::AuthorityId as AuraId; -use sp_core::{sr25519, Pair, Public, U256, H160,}; +use sp_core::{sr25519, Pair, Public, H160, U256}; use sp_finality_grandpa::AuthorityId as GrandpaId; use sp_runtime::{ traits::{IdentifyAccount, One, Verify}, @@ -39,16 +36,11 @@ use sp_runtime::{ }; pub use edgeware_primitives::{AccountId, Balance, BlockNumber, Signature}; -pub use edgeware_runtime::constants::time::*; -pub use edgeware_runtime::GenesisConfig; +pub use edgeware_runtime::{constants::time::*, GenesisConfig}; use hex::FromHex; use serde_json::Result; -use std::fs::File; -use std::io::Read; -use std::path::Path; -use std::collections::BTreeMap; -use std::str::FromStr; +use std::{collections::BTreeMap, fs::File, io::Read, path::Path, str::FromStr}; type AccountPublic = ::Signer; @@ -90,7 +82,7 @@ pub type ChainSpec = sc_service::GenericChainSpec; pub fn edgeware_mainnet_official() -> ChainSpec { match ChainSpec::from_json_bytes(&include_bytes!("../res/mainnet.chainspec.json")[..]) { Ok(spec) => spec, - Err(e) => panic!(e), + Err(e) => panic!("{}", e), } } @@ -98,7 +90,7 @@ pub fn edgeware_mainnet_official() -> ChainSpec { pub fn edgeware_beresheet_official() -> ChainSpec { match ChainSpec::from_json_bytes(&include_bytes!("../res/beresheet.chainspec.json")[..]) { Ok(spec) => spec, - Err(e) => panic!(e), + Err(e) => panic!("{}", e), } } @@ -132,7 +124,9 @@ where } /// Helper function to generate stash, controller and session key from seed -pub fn get_authority_keys_from_seed(seed: &str) -> ( +pub fn get_authority_keys_from_seed( + seed: &str, +) -> ( AccountId, AccountId, GrandpaId, @@ -152,7 +146,14 @@ pub fn get_authority_keys_from_seed(seed: &str) -> ( /// Helper function to create GenesisConfig for testing pub fn testnet_genesis( - initial_authorities: Vec<(AccountId, AccountId, GrandpaId, AuraId, ImOnlineId, AuthorityDiscoveryId)>, + initial_authorities: Vec<( + AccountId, + AccountId, + GrandpaId, + AuraId, + ImOnlineId, + AuthorityDiscoveryId, + )>, _root_key: AccountId, endowed_accounts: Option>, _enable_println: bool, @@ -162,14 +163,23 @@ pub fn testnet_genesis( ) -> GenesisConfig { let alice_evm_account_id = H160::from_str("19e7e376e7c213b7e7e7e46cc70a5dd086daff2a").unwrap(); let mut evm_accounts = BTreeMap::new(); + evm_accounts.insert(alice_evm_account_id, pallet_evm::GenesisAccount { + nonce: 0.into(), + balance: U256::from(123456_123_000_000_000_000_000u128), + storage: BTreeMap::new(), + code: vec![], + }); + // account used in frontier evm_accounts.insert( - alice_evm_account_id, + H160::from_str("6be02d1d3665660d22ff9624b7be0551ee1ac91b") + .expect("internal H160 is valid; qed"), pallet_evm::GenesisAccount { - nonce: 0.into(), - balance: U256::from(123456_123_000_000_000_000_000u128), - storage: BTreeMap::new(), - code: vec![], - }, + balance: U256::from_str("0xffffffffffffffffffffffffffffffff") + .expect("internal U256 is valid; qed"), + code: Default::default(), + nonce: Default::default(), + storage: Default::default(), + } ); let mut endowed_accounts: Vec = endowed_accounts.unwrap_or_else(|| { @@ -199,10 +209,7 @@ pub fn testnet_genesis( }); const STASH: Balance = 100000000 * DOLLARS; - let mut endowed_balances: Vec<(AccountId, Balance)> = endowed_accounts - .iter() - .map(|k| (k.clone(), STASH)) - .collect(); + let mut endowed_balances: Vec<(AccountId, Balance)> = endowed_accounts.iter().map(|k| (k.clone(), STASH)).collect(); // add founders and balances to endowed if not already in list founder_allocation.iter().chain(balances.iter()).for_each(|x| { @@ -212,15 +219,15 @@ pub fn testnet_genesis( }); GenesisConfig { - frame_system: Some(SystemConfig { + frame_system: SystemConfig { code: wasm_binary_unwrap().to_vec(), changes_trie_config: Default::default(), - }), - pallet_balances: Some(BalancesConfig { + }, + pallet_balances: BalancesConfig { balances: endowed_balances, - }), - pallet_indices: Some(IndicesConfig { indices: vec![] }), - pallet_session: Some(SessionConfig { + }, + pallet_indices: IndicesConfig { indices: vec![] }, + pallet_session: SessionConfig { keys: initial_authorities .iter() .map(|x| { @@ -231,8 +238,8 @@ pub fn testnet_genesis( ) }) .collect::>(), - }), - pallet_staking: Some(StakingConfig { + }, + pallet_staking: StakingConfig { validator_count: 20, minimum_validator_count: initial_authorities.len() as u32, stakers: initial_authorities @@ -242,31 +249,27 @@ pub fn testnet_genesis( invulnerables: [].to_vec(), slash_reward_fraction: Perbill::from_percent(10), ..Default::default() - }), - pallet_democracy: Some(DemocracyConfig::default()), - pallet_collective_Instance1: Some(CouncilConfig { + }, + pallet_democracy: DemocracyConfig::default(), + pallet_collective_Instance1: CouncilConfig { members: crate::testnet_fixtures::get_testnet_election_members(), phantom: Default::default(), - }), - pallet_aura: Some(AuraConfig { - authorities: vec![], - }), - pallet_im_online: Some(ImOnlineConfig { keys: vec![] }), - pallet_authority_discovery: Some(AuthorityDiscoveryConfig { keys: vec![] }), - pallet_grandpa: Some(GrandpaConfig { - authorities: vec![], - }), - pallet_treasury: Some(Default::default()), - pallet_elections_phragmen: Some(Default::default()), - pallet_sudo: Some(SudoConfig { key: _root_key }), - pallet_vesting: Some(VestingConfig { vesting: vesting }), - pallet_evm: Some(EVMConfig { accounts: evm_accounts }), - pallet_contracts: Some(Default::default()), - pallet_ethereum: Some(Default::default()), - treasury_reward: Some(TreasuryRewardConfig { + }, + pallet_aura: AuraConfig { authorities: vec![] }, + pallet_im_online: ImOnlineConfig { keys: vec![] }, + pallet_authority_discovery: AuthorityDiscoveryConfig { keys: vec![] }, + pallet_grandpa: GrandpaConfig { authorities: vec![] }, + pallet_treasury: Default::default(), + pallet_elections_phragmen: Default::default(), + pallet_sudo: SudoConfig { key: _root_key }, + pallet_vesting: VestingConfig { vesting }, + pallet_ethereum: Default::default(), + pallet_evm: EVMConfig { accounts: evm_accounts }, + treasury_reward: TreasuryRewardConfig { current_payout: 95 * DOLLARS, minting_interval: One::one(), - }), + }, + orml_nft: Default::default(), } } @@ -460,19 +463,19 @@ pub fn mainnet_genesis( vesting: Vec<(AccountId, BlockNumber, BlockNumber, Balance)>, ) -> GenesisConfig { GenesisConfig { - frame_system: Some(SystemConfig { + frame_system: SystemConfig { code: wasm_binary_unwrap().to_vec(), changes_trie_config: Default::default(), - }), - pallet_balances: Some(BalancesConfig { + }, + pallet_balances: BalancesConfig { balances: founder_allocation .iter() .map(|x| (x.0.clone(), x.1.clone())) .chain(balances.clone()) .collect(), - }), - pallet_indices: Some(IndicesConfig { indices: vec![] }), - pallet_session: Some(SessionConfig { + }, + pallet_indices: IndicesConfig { indices: vec![] }, + pallet_session: SessionConfig { keys: initial_authorities .iter() .map(|x| { @@ -483,51 +486,40 @@ pub fn mainnet_genesis( ) }) .collect::>(), - }), - pallet_staking: Some(StakingConfig { + }, + pallet_staking: StakingConfig { validator_count: 60, minimum_validator_count: initial_authorities.len() as u32, stakers: initial_authorities .iter() - .map(|x| { - ( - x.0.clone(), - x.1.clone(), - x.2.clone(), - StakerStatus::Validator, - ) - }) + .map(|x| (x.0.clone(), x.1.clone(), x.2.clone(), StakerStatus::Validator)) .collect(), invulnerables: vec![], slash_reward_fraction: Perbill::from_percent(10), ..Default::default() - }), - pallet_democracy: Some(DemocracyConfig::default()), - pallet_collective_Instance1: Some(CouncilConfig { + }, + pallet_democracy: DemocracyConfig::default(), + pallet_collective_Instance1: CouncilConfig { members: crate::mainnet_fixtures::get_mainnet_election_members(), phantom: Default::default(), - }), - pallet_aura: Some(AuraConfig { - authorities: vec![], - }), - pallet_im_online: Some(ImOnlineConfig { keys: vec![] }), - pallet_authority_discovery: Some(AuthorityDiscoveryConfig { keys: vec![] }), - pallet_grandpa: Some(GrandpaConfig { - authorities: vec![], - }), - pallet_treasury: Some(Default::default()), - pallet_elections_phragmen: Some(Default::default()), - pallet_sudo: Some(SudoConfig { + }, + pallet_aura: AuraConfig { authorities: vec![] }, + pallet_im_online: ImOnlineConfig { keys: vec![] }, + pallet_authority_discovery: AuthorityDiscoveryConfig { keys: vec![] }, + pallet_grandpa: GrandpaConfig { authorities: vec![] }, + pallet_treasury: Default::default(), + pallet_elections_phragmen: Default::default(), + pallet_sudo: SudoConfig { key: crate::mainnet_fixtures::get_mainnet_root_key(), - }), - pallet_vesting: Some(VestingConfig { vesting: vesting }), - pallet_evm: Some(Default::default()), - pallet_contracts: Some(Default::default()), - pallet_ethereum: Some(Default::default()), - treasury_reward: Some(TreasuryRewardConfig { + }, + pallet_vesting: VestingConfig { vesting }, + pallet_ethereum: Default::default(), + pallet_evm: Default::default(), + treasury_reward: TreasuryRewardConfig { current_payout: 95 * DOLLARS, minting_interval: One::one(), - }), + }, + orml_nft: Default::default(), } } diff --git a/node/cli/src/cli.rs b/node/cli/src/cli.rs index 64cae8f3..8ec2e9ae 100644 --- a/node/cli/src/cli.rs +++ b/node/cli/src/cli.rs @@ -17,6 +17,42 @@ use sc_cli::{KeySubcommand, SignCmd, VanityCmd, VerifyCmd}; use structopt::StructOpt; +use std::{fmt, str::FromStr}; + +/// Ethereum API Features +#[derive(Debug, PartialEq, Clone)] +pub enum EthApi { + /// Transactions Pool + Txpool, + /// Debugging + Debug, + /// Tracing. + Trace, +} + +impl FromStr for EthApi { + type Err = String; + + fn from_str(s: &str) -> Result { + Ok(match s { + "txpool" => Self::Txpool, + "debug" => Self::Debug, + "trace" => Self::Trace, + _ => return Err(format!("`{}` is not recognized as a supported Ethereum Api", s)), + }) + } +} + +impl fmt::Display for EthApi { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + EthApi::Txpool => write!(f, "txpool"), + EthApi::Debug => write!(f, "debug"), + EthApi::Trace => write!(f, "trace"), + } + } +} + #[allow(missing_docs)] #[derive(Debug, StructOpt)] pub struct RunCmd { @@ -26,6 +62,38 @@ pub struct RunCmd { #[structopt(long = "enable-dev-signer")] pub enable_dev_signer: bool, + + /// The dynamic-fee pallet target gas price set by block author + #[structopt(long, default_value = "1")] + pub target_gas_price: u64, + + /// Enable EVM tracing module on a non-authority node. + #[structopt( + long, + conflicts_with = "collator", + conflicts_with = "validator", + require_delimiter = true + )] + pub ethapi: Vec, + + /// Number of concurrent tracing tasks. Meant to be shared by both "debug" and "trace" modules. + #[structopt(long, default_value = "10")] + pub ethapi_max_permits: u32, + + /// Maximum number of trace entries a single request of `trace_filter` is allowed to return. + /// A request asking for more or an unbounded one going over this limit will both return an + /// error. + #[structopt(long, default_value = "500")] + pub ethapi_trace_max_count: u32, + + /// Duration (in seconds) after which the cache of `trace_filter` for a given block will be + /// discarded. + #[structopt(long, default_value = "300")] + pub ethapi_trace_cache_duration: u64, + + /// Maximum number of logs in a query. + #[structopt(long, default_value = "10000")] + pub max_past_logs: u32, } /// An overarching CLI command definition. @@ -49,7 +117,8 @@ pub enum Subcommand { #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")] Benchmark(frame_benchmarking_cli::BenchmarkCmd), - /// Verify a signature for a message, provided on STDIN, with a given (public or secret) key. + /// Verify a signature for a message, provided on STDIN, with a given + /// (public or secret) key. Verify(VerifyCmd), /// Generate a seed that provides a vanity address. diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 9b7912e3..09c72b7c 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -14,12 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Edgeware. If not, see . -use crate::{chain_spec, service, Cli, Subcommand}; +use crate::{chain_spec, service, service::new_partial, Cli, Subcommand}; use edgeware_executor::Executor; use edgeware_runtime::Block; -use sc_cli::{Result, SubstrateCli, RuntimeVersion, Role, ChainSpec}; +use sc_cli::{ChainSpec, Result, Role, RuntimeVersion, SubstrateCli}; use sc_service::PartialComponents; -use crate::service::{new_partial}; impl SubstrateCli for Cli { fn impl_name() -> String { @@ -62,11 +61,10 @@ impl SubstrateCli for Cli { "mainnet-conf" => Box::new(chain_spec::edgeware_mainnet_config()), "beresheet" => Box::new(chain_spec::edgeware_beresheet_official()), "edgeware" => Box::new(chain_spec::edgeware_mainnet_official()), - path => Box::new(chain_spec::ChainSpec::from_json_file( - std::path::PathBuf::from(path), - )?), + path => Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), }) } + fn native_runtime_version(_: &Box) -> &'static RuntimeVersion { &edgeware_runtime::VERSION } @@ -77,15 +75,6 @@ pub fn run() -> Result<()> { let cli = Cli::from_args(); match &cli.subcommand { - None => { - let runner = cli.create_runner(&cli.run.base)?; - runner.run_node_until_exit(|config| async move { - match config.role { - Role::Light => service::new_light(config), - _ => service::new_full(config, cli.run.enable_dev_signer), - } - }) - } Some(Subcommand::Benchmark(cmd)) => { if cfg!(feature = "runtime-benchmarks") { let runner = cli.create_runner(cmd)?; @@ -93,7 +82,8 @@ pub fn run() -> Result<()> { runner.sync_run(|config| cmd.run::(config)) } else { Err("Benchmarking wasn't enabled when building the node. \ - You can enable it with `--features runtime-benchmarks`.".into()) + You can enable it with `--features runtime-benchmarks`." + .into()) } } Some(Subcommand::Key(cmd)) => cmd.run(&cli), @@ -103,50 +93,74 @@ pub fn run() -> Result<()> { Some(Subcommand::BuildSpec(cmd)) => { let runner = cli.create_runner(cmd)?; runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) - }, + } Some(Subcommand::CheckBlock(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { client, task_manager, import_queue, ..} - = new_partial(&config)?; + let PartialComponents { + client, + task_manager, + import_queue, + .. + } = new_partial(&config, &cli)?; Ok((cmd.run(client, import_queue), task_manager)) }) - }, + } Some(Subcommand::ExportBlocks(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { client, task_manager, ..} - = new_partial(&config)?; + let PartialComponents { + client, task_manager, .. + } = new_partial(&config, &cli)?; Ok((cmd.run(client, config.database), task_manager)) }) - }, + } Some(Subcommand::ExportState(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { client, task_manager, ..} - = new_partial(&config)?; + let PartialComponents { + client, task_manager, .. + } = new_partial(&config, &cli)?; Ok((cmd.run(client, config.chain_spec), task_manager)) }) - }, + } Some(Subcommand::ImportBlocks(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { client, task_manager, import_queue, ..} - = new_partial(&config)?; + let PartialComponents { + client, + task_manager, + import_queue, + .. + } = new_partial(&config, &cli)?; Ok((cmd.run(client, import_queue), task_manager)) }) - }, + } Some(Subcommand::PurgeChain(cmd)) => { let runner = cli.create_runner(cmd)?; runner.sync_run(|config| cmd.run(config.database)) - }, + } Some(Subcommand::Revert(cmd)) => { let runner = cli.create_runner(cmd)?; runner.async_run(|config| { - let PartialComponents { client, task_manager, backend, ..} - = new_partial(&config)?; + let PartialComponents { + client, + task_manager, + backend, + .. + } = new_partial(&config, &cli)?; Ok((cmd.run(client, backend), task_manager)) }) - }, + } + None => { + let runner = cli.create_runner(&cli.run.base)?; + runner.run_node_until_exit(|config| async move { + match config.role { + Role::Light => service::new_light(config), + _ => service::new_full(config, &cli), + } + .map_err(sc_cli::Error::Service) + }) + } } } diff --git a/node/cli/src/lib.rs b/node/cli/src/lib.rs index fe93afab..41f3b8a8 100644 --- a/node/cli/src/lib.rs +++ b/node/cli/src/lib.rs @@ -18,33 +18,35 @@ //! //! This package has two Cargo features: //! -//! - `cli` (default): exposes functions that parse command-line options, then start and run the +//! - `cli` (default): exposes functions that parse command-line options, then +//! start and run the //! node as a CLI application. //! -//! - `browser`: exposes the content of the `browser` module, which consists of exported symbols -//! that are meant to be passed through the `wasm-bindgen` utility and called from JavaScript. -//! Despite its name the produced WASM can theoretically also be used from NodeJS, although this -//! hasn't been tested. +//! - `browser`: exposes the content of the `browser` module, which consists of +//! exported symbols +//! that are meant to be passed through the `wasm-bindgen` utility and called +//! from JavaScript. Despite its name the produced WASM can theoretically also +//! be used from NodeJS, although this hasn't been tested. #![warn(missing_docs)] +pub use edgeware_opts as opts; pub mod chain_spec; #[macro_use] mod service; -#[cfg(feature = "browser")] -mod browser; #[cfg(feature = "cli")] mod cli; #[cfg(feature = "cli")] mod command; -#[cfg(feature = "browser")] -pub use browser::*; #[cfg(feature = "cli")] pub use cli::*; #[cfg(feature = "cli")] pub use command::*; +pub use cli::*; +pub use command::*; + pub mod mainnet_fixtures; pub mod testnet_fixtures; diff --git a/node/cli/src/mainnet_fixtures.rs b/node/cli/src/mainnet_fixtures.rs index 374d04c4..8c8731a9 100644 --- a/node/cli/src/mainnet_fixtures.rs +++ b/node/cli/src/mainnet_fixtures.rs @@ -16,248 +16,340 @@ //! Mainnet fixtures -use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; -use sp_consensus_aura::ed25519::AuthorityId as AuraId; use edgeware_primitives::{AccountId, Balance}; -use sp_finality_grandpa::AuthorityId as GrandpaId; -use pallet_im_online::ed25519::{AuthorityId as ImOnlineId}; -use sp_core::crypto::UncheckedInto; use hex_literal::hex; +use pallet_im_online::ed25519::AuthorityId as ImOnlineId; use sc_network::config::MultiaddrWithPeerId; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; +use sp_consensus_aura::ed25519::AuthorityId as AuraId; +use sp_core::crypto::UncheckedInto; +use sp_finality_grandpa::AuthorityId as GrandpaId; /// Bootnodes for mainnet launch pub fn get_mainnet_bootnodes() -> Vec { return vec![ - "/ip4/144.202.61.115/tcp/30333/p2p/QmXTb6R2AvA6FrvD4w2YRD2oj9WQk2f9Dg1dTqGsdxgwuD".parse().unwrap(), - "/ip4/107.191.48.39/tcp/30333/p2p/QmdFq4WXvgokUi5MAcGvzcV4PZmo6fZN2fxcEbcPQioGcK".parse().unwrap(), - "/ip4/66.42.113.164/tcp/30333/p2p/Qmawkfqh4y4vnPWiy87pBnWpgsyy8QrQmUFprDTktgatSm".parse().unwrap(), - "/ip4/144.202.58.79/tcp/30333/p2p/QmXWhRta7P3xW43WbJ6CDH9ZsHwVxFhLJNjpBa6J3jaAqj".parse().unwrap(), - "/ip4/207.148.13.203/tcp/30333/p2p/QmRgKnmZNYVCznVd4ao5UHCHGWieT3sePB5g8v7PSGofD2".parse().unwrap(), - "/ip4/207.148.11.222/tcp/30333/p2p/QmbzrqjbDcwhhX1oiKndxTjK1ULjqVw36QvrEuRKSZjgLY".parse().unwrap(), - "/ip4/149.28.120.45/tcp/30333/p2p/QmfB4F7TeUcuZZ4AMT3nvvfPVME4eWyJUUdWkXeus3AThe".parse().unwrap(), - "/ip4/149.28.115.253/tcp/30333/p2p/QmQvAPW1bBpx5N7YJLcBhHNqANw4dxVmBTiJNeuC8FoYeR".parse().unwrap(), - "/ip4/66.42.116.197/tcp/30333/p2p/QmU1g7NFj1cd46T69ZXig9c7Xc6RLGwjZm4Ur6d4JPBDh2".parse().unwrap(), - "/ip4/104.207.139.151/tcp/30333/p2p/QmPuU4VY2nckAodyWXv3VyCwavk5FF9yqVWB4G1LtNf9v9".parse().unwrap(), - "/ip4/45.77.238.189/tcp/30333/p2p/QmUQNwBa3BTYEAggMqsM2o5owtG1szKGMcy4Yi5sxPEvmh".parse().unwrap(), - "/ip4/209.250.227.147/tcp/30333/p2p/QmTDGjGu9GiyZLgTFaqMFUkguer4svD3DLHyZbEePWGK2M".parse().unwrap(), - "/ip4/202.182.103.213/tcp/30333/p2p/QmekEvkhcEvsRYw47LVoYm7v1dAjh3qbt2wZK7HNydr3kq".parse().unwrap(), - "/ip4/207.148.77.158/tcp/30333/p2p/QmWF6T36iBiXdCAsb477vHyTEKTq33RTLRAcsyTiGwrqwB".parse().unwrap(), - "/ip4/140.82.54.194/tcp/30333/p2p/QmdCUnV8hK3oiKSkoL4r9W5foEVBvMQ49ATUNpgxWcCgXc".parse().unwrap(), - "/ip4/155.138.133.37/tcp/30333/p2p/QmYrQtJXQSJkfcpKYgVXcbYMEuHP1PLgz41uy2dutipp9s".parse().unwrap(), - "/ip4/45.32.171.175/tcp/30333/p2p/QmdC8MEhaWbngY7qHpgXvYr3bVYcXy1HFUBWVWzhQFFybV".parse().unwrap(), - "/ip4/45.77.105.248/tcp/30333/p2p/QmPqNBGgeP4553TzxNd34GshUSHapsjykHhVcwnNrqpMLT".parse().unwrap(), - "/ip4/144.202.19.214/tcp/30333/p2p/QmUr8uUsd7QJQnnbHbVh6hhdHKsZUS1xrNKJmb7YZEshae".parse().unwrap(), - "/ip4/207.246.98.108/tcp/30333/p2p/QmVFxV5Ay158YiS7bkxNkAshEECDFMbqnfkizTgEfKQC7F".parse().unwrap(), + "/ip4/144.202.61.115/tcp/30333/p2p/QmXTb6R2AvA6FrvD4w2YRD2oj9WQk2f9Dg1dTqGsdxgwuD" + .parse() + .unwrap(), + "/ip4/107.191.48.39/tcp/30333/p2p/QmdFq4WXvgokUi5MAcGvzcV4PZmo6fZN2fxcEbcPQioGcK" + .parse() + .unwrap(), + "/ip4/66.42.113.164/tcp/30333/p2p/Qmawkfqh4y4vnPWiy87pBnWpgsyy8QrQmUFprDTktgatSm" + .parse() + .unwrap(), + "/ip4/144.202.58.79/tcp/30333/p2p/QmXWhRta7P3xW43WbJ6CDH9ZsHwVxFhLJNjpBa6J3jaAqj" + .parse() + .unwrap(), + "/ip4/207.148.13.203/tcp/30333/p2p/QmRgKnmZNYVCznVd4ao5UHCHGWieT3sePB5g8v7PSGofD2" + .parse() + .unwrap(), + "/ip4/207.148.11.222/tcp/30333/p2p/QmbzrqjbDcwhhX1oiKndxTjK1ULjqVw36QvrEuRKSZjgLY" + .parse() + .unwrap(), + "/ip4/149.28.120.45/tcp/30333/p2p/QmfB4F7TeUcuZZ4AMT3nvvfPVME4eWyJUUdWkXeus3AThe" + .parse() + .unwrap(), + "/ip4/149.28.115.253/tcp/30333/p2p/QmQvAPW1bBpx5N7YJLcBhHNqANw4dxVmBTiJNeuC8FoYeR" + .parse() + .unwrap(), + "/ip4/66.42.116.197/tcp/30333/p2p/QmU1g7NFj1cd46T69ZXig9c7Xc6RLGwjZm4Ur6d4JPBDh2" + .parse() + .unwrap(), + "/ip4/104.207.139.151/tcp/30333/p2p/QmPuU4VY2nckAodyWXv3VyCwavk5FF9yqVWB4G1LtNf9v9" + .parse() + .unwrap(), + "/ip4/45.77.238.189/tcp/30333/p2p/QmUQNwBa3BTYEAggMqsM2o5owtG1szKGMcy4Yi5sxPEvmh" + .parse() + .unwrap(), + "/ip4/209.250.227.147/tcp/30333/p2p/QmTDGjGu9GiyZLgTFaqMFUkguer4svD3DLHyZbEePWGK2M" + .parse() + .unwrap(), + "/ip4/202.182.103.213/tcp/30333/p2p/QmekEvkhcEvsRYw47LVoYm7v1dAjh3qbt2wZK7HNydr3kq" + .parse() + .unwrap(), + "/ip4/207.148.77.158/tcp/30333/p2p/QmWF6T36iBiXdCAsb477vHyTEKTq33RTLRAcsyTiGwrqwB" + .parse() + .unwrap(), + "/ip4/140.82.54.194/tcp/30333/p2p/QmdCUnV8hK3oiKSkoL4r9W5foEVBvMQ49ATUNpgxWcCgXc" + .parse() + .unwrap(), + "/ip4/155.138.133.37/tcp/30333/p2p/QmYrQtJXQSJkfcpKYgVXcbYMEuHP1PLgz41uy2dutipp9s" + .parse() + .unwrap(), + "/ip4/45.32.171.175/tcp/30333/p2p/QmdC8MEhaWbngY7qHpgXvYr3bVYcXy1HFUBWVWzhQFFybV" + .parse() + .unwrap(), + "/ip4/45.77.105.248/tcp/30333/p2p/QmPqNBGgeP4553TzxNd34GshUSHapsjykHhVcwnNrqpMLT" + .parse() + .unwrap(), + "/ip4/144.202.19.214/tcp/30333/p2p/QmUr8uUsd7QJQnnbHbVh6hhdHKsZUS1xrNKJmb7YZEshae" + .parse() + .unwrap(), + "/ip4/207.246.98.108/tcp/30333/p2p/QmVFxV5Ay158YiS7bkxNkAshEECDFMbqnfkizTgEfKQC7F" + .parse() + .unwrap(), ]; } - /// Split endowment amount for Commonwealth pub const COMMONWEALTH_ENDOWMENT: Balance = 75_000_000_000_000_000_000_000_000; /// Split endowment amount for stash pub const STASH_ENDOWMENT: Balance = 10_000_000_000_000_000_000; /// Split endowment amount for controllers pub const CONTROLLER_ENDOWMENT: Balance = 10_000_000_000_000_000_000; -/// Genesis allocation that will fit into the "balances" module for Commonwealth/Founders +/// Genesis allocation that will fit into the "balances" module for +/// Commonwealth/Founders pub fn get_commonwealth_allocation() -> Vec<(AccountId, Balance)> { - return vec![( - hex!["14ad3d151938d63a4e02454f034a3158c719ed9de2e233dd0843c2d81ddba53d"].into(), - 5_500_000_000_000_000_000_000_000, - ), ( - hex!["12d490251399a081935bf731184d2bf37d228bc38d3d68a8e3822933bcf23a09"].into(), - 5_500_000_000_000_000_000_000_000, - ), ( - hex!["a87d1f2e04d8e95499f8a6f18214355bcb2fd2c9370ab5c19f379dd9d3167075"].into(), - 5_500_000_000_000_000_000_000_000, - ), ( - hex!["4cb0922d0fb5217553da0da70bd4076812ad2a5cce860524ff7b5e6e3629f962"].into(), - 3_000_000_000_000_000_000_000_000, - ), ( - hex!["78040adec849fff1c66c16ab8ac1534ed27e37a8a1da8aa3239267a883369566"].into(), - 1_500_000_000_000_000_000_000_000, - ), ( - hex!["cc3d67fe87c81b5895ed89cfb1c44cc29c3798bac93368487dfc11364d6e3068"].into(), - COMMONWEALTH_ENDOWMENT, - ), ( - hex!["eeb7482b9cce124538b1aeea1a7935d313b9f01cc6192fb4cc6bdf1b0f6b4430"].into(), - COMMONWEALTH_ENDOWMENT, - ), ( - hex!["765e19400b3f7d44e5677d24d9914ae8cabb1bf3ef81ebc1ca72ad99d312af46"].into(), - COMMONWEALTH_ENDOWMENT, - ), ( - hex!["ca91588bb9258ade926d0c0631798d7e3f17c4581fae56283287d54883244a55"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["1ec5e3d9a77ac81d6da0290c04d003bbcb04af8c4902bd59dbf9be4dfa47234f"].into(), - STASH_ENDOWMENT, - ), ( - hex!["d6fb4a2f0d5dfc62c37a09e6aac5c3ea4ce2ba021f553c940e63d59dadf0cd24"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["720967cda4c9097924d705695b62dfb6dc6dbeade65b5575abf5c4ca38e50503"].into(), - STASH_ENDOWMENT, - ), ( - hex!["38a58e82baf9df6ec1f9a7064a337f872778649f3dd9002e3fe48df94b475232"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["de90c8b070c0a63fbf52655af7492dc8e7d985334a4c60c02bc2f59424ff1430"].into(), - STASH_ENDOWMENT, - ), ( - hex!["0e33e22cd22b272f388bcd41f13942d803089106ec350b8754e1d290ee6ff52b"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["9665bd715c72b686c2557fe11e6cd54924adef62dc1f52cf43a503f363cf843c"].into(), - STASH_ENDOWMENT, - ), ( - hex!["6aa8f0dd6b6221788d68bf2486126fb14bb65ea710028c11f7ca131e0df10707"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["464c96a206e310511a27acc92b2e410a14bd83cb8788b522d0cee03f0d285862"].into(), - STASH_ENDOWMENT, - ), ( - hex!["ae5bfe517affa6f7456ad6b9f7465520059e6d7b2a8928673460461abb741c18"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["34c71b1e42e910b94b8cbb2c960873bd4bf0db6e80afdf41cdc52acd91d6393f"].into(), - STASH_ENDOWMENT, - ), ( - hex!["6a782c02fd24ed538224f3d0bda56146bc6bacd34f9a784c1b5367e19cda456e"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["d02002915139ac3e4552c5006f92cccfbf8b02cb4d4ca1993a69d63368cc1f0c"].into(), - STASH_ENDOWMENT, - ), ( - hex!["4864744ab79cd62cbc1094da8e6f54aba8cba7ed6d616bdd8df10572d146c15c"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["143f9f9019fa62919ed6da39b8f147cb52501438e1e9e7a82d22d7b49df18e59"].into(), - STASH_ENDOWMENT, - ), ( - hex!["a01bef9c8591ae4155f9483eee09db092fb39bdd580e3715e927333e4aa89d6d"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["4e7de9c8f3564fe5cc5057de51c41b40a7da801d22c6ee5aa57f8bb2838ae857"].into(), - STASH_ENDOWMENT, - ), ( - hex!["00e5a14e08930f94148569274ca1e9355938fabf65fffef3b7cb3c3e3edabb23"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["ce64070e4dffe61183241dca3e922b65ecd509430a3e283fab5c143532f79d3e"].into(), - STASH_ENDOWMENT, - ), ( - hex!["b0492fa7ac84ecb20f9f69e1c328b521fce8f472af2cc13784286d2240e4924c"].into(), - CONTROLLER_ENDOWMENT, - ), ( - hex!["58e8d8750021d11f5bf1106966235ed293a4288511016af7f3b2e81a84ead342"].into(), - 92_500_000_000_000_000_000_000_000, - ), ( - hex!["688421b084a363cb394c5e3a7c79f44482bf2f15f6d86ea37ae110a3af238f07"].into(), - 10_000_000_000_000_000_000_000_000, - ), ( - hex!["765169492c492ee29f2af9af46f9e1b117aa0283b73a4361ae12ace1c41a6c72"].into(), - 150_000_000_000_000_000_000_000_000, - ), ( - hex!["6490626e3bde470c449e90b83df92ddb8514f02067a0ddd66f1080b5033dec2d"].into(), - 1474_790_000_000_000_000_002_374, - ), ( - hex!["ec80b8b78a2b283f0a48712c8446241cf5f36d2f480559cdc73253981963f402"].into(), - 25_000_000_000_000_000_000_000, - )] + return vec![ + ( + hex!["14ad3d151938d63a4e02454f034a3158c719ed9de2e233dd0843c2d81ddba53d"].into(), + 5_500_000_000_000_000_000_000_000, + ), + ( + hex!["12d490251399a081935bf731184d2bf37d228bc38d3d68a8e3822933bcf23a09"].into(), + 5_500_000_000_000_000_000_000_000, + ), + ( + hex!["a87d1f2e04d8e95499f8a6f18214355bcb2fd2c9370ab5c19f379dd9d3167075"].into(), + 5_500_000_000_000_000_000_000_000, + ), + ( + hex!["4cb0922d0fb5217553da0da70bd4076812ad2a5cce860524ff7b5e6e3629f962"].into(), + 3_000_000_000_000_000_000_000_000, + ), + ( + hex!["78040adec849fff1c66c16ab8ac1534ed27e37a8a1da8aa3239267a883369566"].into(), + 1_500_000_000_000_000_000_000_000, + ), + ( + hex!["cc3d67fe87c81b5895ed89cfb1c44cc29c3798bac93368487dfc11364d6e3068"].into(), + COMMONWEALTH_ENDOWMENT, + ), + ( + hex!["eeb7482b9cce124538b1aeea1a7935d313b9f01cc6192fb4cc6bdf1b0f6b4430"].into(), + COMMONWEALTH_ENDOWMENT, + ), + ( + hex!["765e19400b3f7d44e5677d24d9914ae8cabb1bf3ef81ebc1ca72ad99d312af46"].into(), + COMMONWEALTH_ENDOWMENT, + ), + ( + hex!["ca91588bb9258ade926d0c0631798d7e3f17c4581fae56283287d54883244a55"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["1ec5e3d9a77ac81d6da0290c04d003bbcb04af8c4902bd59dbf9be4dfa47234f"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["d6fb4a2f0d5dfc62c37a09e6aac5c3ea4ce2ba021f553c940e63d59dadf0cd24"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["720967cda4c9097924d705695b62dfb6dc6dbeade65b5575abf5c4ca38e50503"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["38a58e82baf9df6ec1f9a7064a337f872778649f3dd9002e3fe48df94b475232"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["de90c8b070c0a63fbf52655af7492dc8e7d985334a4c60c02bc2f59424ff1430"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["0e33e22cd22b272f388bcd41f13942d803089106ec350b8754e1d290ee6ff52b"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["9665bd715c72b686c2557fe11e6cd54924adef62dc1f52cf43a503f363cf843c"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["6aa8f0dd6b6221788d68bf2486126fb14bb65ea710028c11f7ca131e0df10707"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["464c96a206e310511a27acc92b2e410a14bd83cb8788b522d0cee03f0d285862"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["ae5bfe517affa6f7456ad6b9f7465520059e6d7b2a8928673460461abb741c18"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["34c71b1e42e910b94b8cbb2c960873bd4bf0db6e80afdf41cdc52acd91d6393f"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["6a782c02fd24ed538224f3d0bda56146bc6bacd34f9a784c1b5367e19cda456e"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["d02002915139ac3e4552c5006f92cccfbf8b02cb4d4ca1993a69d63368cc1f0c"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["4864744ab79cd62cbc1094da8e6f54aba8cba7ed6d616bdd8df10572d146c15c"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["143f9f9019fa62919ed6da39b8f147cb52501438e1e9e7a82d22d7b49df18e59"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["a01bef9c8591ae4155f9483eee09db092fb39bdd580e3715e927333e4aa89d6d"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["4e7de9c8f3564fe5cc5057de51c41b40a7da801d22c6ee5aa57f8bb2838ae857"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["00e5a14e08930f94148569274ca1e9355938fabf65fffef3b7cb3c3e3edabb23"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["ce64070e4dffe61183241dca3e922b65ecd509430a3e283fab5c143532f79d3e"].into(), + STASH_ENDOWMENT, + ), + ( + hex!["b0492fa7ac84ecb20f9f69e1c328b521fce8f472af2cc13784286d2240e4924c"].into(), + CONTROLLER_ENDOWMENT, + ), + ( + hex!["58e8d8750021d11f5bf1106966235ed293a4288511016af7f3b2e81a84ead342"].into(), + 92_500_000_000_000_000_000_000_000, + ), + ( + hex!["688421b084a363cb394c5e3a7c79f44482bf2f15f6d86ea37ae110a3af238f07"].into(), + 10_000_000_000_000_000_000_000_000, + ), + ( + hex!["765169492c492ee29f2af9af46f9e1b117aa0283b73a4361ae12ace1c41a6c72"].into(), + 150_000_000_000_000_000_000_000_000, + ), + ( + hex!["6490626e3bde470c449e90b83df92ddb8514f02067a0ddd66f1080b5033dec2d"].into(), + 1474_790_000_000_000_000_002_374, + ), + ( + hex!["ec80b8b78a2b283f0a48712c8446241cf5f36d2f480559cdc73253981963f402"].into(), + 25_000_000_000_000_000_000_000, + ), + ]; } /// 5 EDG stake amount for Commonwealth validators pub const STAKED_ENDOWMENT: Balance = 5_000_000_000_000_000_000; /// The mainnet commonwealth validator pubkeys and staked balances. These /// staked amounts should be less than the balances of the stash accounts. -pub fn get_cw_mainnet_validators() -> Vec<(AccountId, AccountId, Balance, AuraId, GrandpaId, ImOnlineId, AuthorityDiscoveryId)> { - return vec![( - hex!["1ec5e3d9a77ac81d6da0290c04d003bbcb04af8c4902bd59dbf9be4dfa47234f"].into(), - hex!["d6fb4a2f0d5dfc62c37a09e6aac5c3ea4ce2ba021f553c940e63d59dadf0cd24"].into(), - STAKED_ENDOWMENT, - hex!["532cdeaeb19afd03eb4a57d4dddad09268fb720478d5386263330f5bf86f1cc4"].unchecked_into(), - hex!["ae5e4e8c3bbb47737a2b4abe79a71289f60271a94a5eaebf6b200f638fcbe332"].unchecked_into(), - hex!["532cdeaeb19afd03eb4a57d4dddad09268fb720478d5386263330f5bf86f1cc4"].unchecked_into(), - hex!["5e0755efa5da8b2bb83d2443635268b0be48ba020587fdc3731a5b87b51ff500"].unchecked_into(), - ), ( - hex!["720967cda4c9097924d705695b62dfb6dc6dbeade65b5575abf5c4ca38e50503"].into(), - hex!["38a58e82baf9df6ec1f9a7064a337f872778649f3dd9002e3fe48df94b475232"].into(), - STAKED_ENDOWMENT, - hex!["89d7a1fb903a63494696c6d10d76704da7760da7f32dc3b5aa122bfba3f85680"].unchecked_into(), - hex!["f272b4cdec7e979dd76c7860f7e9dd8cb1da974d74366a266c4de501b2079896"].unchecked_into(), - hex!["89d7a1fb903a63494696c6d10d76704da7760da7f32dc3b5aa122bfba3f85680"].unchecked_into(), - hex!["fea24c3e2b57972eead003295fcfc52fb57ffd1bdfedf1dcfb1cd35df11dcc37"].unchecked_into(), - ), ( - hex!["de90c8b070c0a63fbf52655af7492dc8e7d985334a4c60c02bc2f59424ff1430"].into(), - hex!["0e33e22cd22b272f388bcd41f13942d803089106ec350b8754e1d290ee6ff52b"].into(), - STAKED_ENDOWMENT, - hex!["98a4f5d4b363447331f54328d83816f773e30799be5979c3d6d9be08f4941799"].unchecked_into(), - hex!["8634c736497e74b1cedbecec7efe94bdff2ec899f60c97e003e8123f366e14e3"].unchecked_into(), - hex!["98a4f5d4b363447331f54328d83816f773e30799be5979c3d6d9be08f4941799"].unchecked_into(), - hex!["bce40bb0b2649d3fa924e050c603dccb5b7468f89924158e9b6d4d048c79dc23"].unchecked_into(), - ), ( - hex!["9665bd715c72b686c2557fe11e6cd54924adef62dc1f52cf43a503f363cf843c"].into(), - hex!["6aa8f0dd6b6221788d68bf2486126fb14bb65ea710028c11f7ca131e0df10707"].into(), - STAKED_ENDOWMENT, - hex!["095ca61a04a9bd2fc95b31c1f86b73ef85e1388e75822896b4079cf5bc1c0e14"].unchecked_into(), - hex!["98d7399dd06f0192a2eb3096aca6df6f2600634d77b92c926bed92d60c50b75d"].unchecked_into(), - hex!["095ca61a04a9bd2fc95b31c1f86b73ef85e1388e75822896b4079cf5bc1c0e14"].unchecked_into(), - hex!["8e84ac19afbba97a686f1b20a3288610f76177b3c71cdc1f31df0828ba6acd1c"].unchecked_into(), - ), ( - hex!["464c96a206e310511a27acc92b2e410a14bd83cb8788b522d0cee03f0d285862"].into(), - hex!["ae5bfe517affa6f7456ad6b9f7465520059e6d7b2a8928673460461abb741c18"].into(), - STAKED_ENDOWMENT, - hex!["76c5e8b1a4656cf7f174662674c61cb3a8fb67cee15d4f9a85f25235653c2a76"].unchecked_into(), - hex!["08b8316bbc960b4e3d610724e4f330556356b567fac3a7cb63fe458dbafdf028"].unchecked_into(), - hex!["76c5e8b1a4656cf7f174662674c61cb3a8fb67cee15d4f9a85f25235653c2a76"].unchecked_into(), - hex!["a69f1ccc84e40afae38d2d2f87b5910b164a8b451a0d70ac51e117f1222ede65"].unchecked_into(), - ), ( - hex!["34c71b1e42e910b94b8cbb2c960873bd4bf0db6e80afdf41cdc52acd91d6393f"].into(), - hex!["6a782c02fd24ed538224f3d0bda56146bc6bacd34f9a784c1b5367e19cda456e"].into(), - STAKED_ENDOWMENT, - hex!["82b6147e4e661551609f04168599ed213c21fa194aba3327fb2fd6247a52b5d2"].unchecked_into(), - hex!["996b0ef45bd1f90b17ebc5f038cea21ccc1725a2c1daf3a85e774e22e173bb6e"].unchecked_into(), - hex!["82b6147e4e661551609f04168599ed213c21fa194aba3327fb2fd6247a52b5d2"].unchecked_into(), - hex!["bef61229205f6027e92e70bcd6b01e352c21d795e38dd64cf87335fd214d994b"].unchecked_into(), - ), ( - hex!["d02002915139ac3e4552c5006f92cccfbf8b02cb4d4ca1993a69d63368cc1f0c"].into(), - hex!["4864744ab79cd62cbc1094da8e6f54aba8cba7ed6d616bdd8df10572d146c15c"].into(), - STAKED_ENDOWMENT, - hex!["3cf4ee0a14ea22e82a8953d60fc68f80a62d881e0b56c97445b3ea96adc4d31c"].unchecked_into(), - hex!["2f9a90f811621556d0dd1bdf324d0154444b34a0501a9f5bd338cf41d94634f9"].unchecked_into(), - hex!["3cf4ee0a14ea22e82a8953d60fc68f80a62d881e0b56c97445b3ea96adc4d31c"].unchecked_into(), - hex!["4e85c095e94a47dea48c7c6824d3f4818e1c34df1e00fe658d650845c275e13e"].unchecked_into(), - ), ( - hex!["143f9f9019fa62919ed6da39b8f147cb52501438e1e9e7a82d22d7b49df18e59"].into(), - hex!["a01bef9c8591ae4155f9483eee09db092fb39bdd580e3715e927333e4aa89d6d"].into(), - STAKED_ENDOWMENT, - hex!["191decd2b0b7e447a2009d0c8f963b118ee7781adada0e217273ac924514b3a8"].unchecked_into(), - hex!["a81b12f94160734c3e53ac961a73c796783be50225e4e9b028e8318654f2d876"].unchecked_into(), - hex!["191decd2b0b7e447a2009d0c8f963b118ee7781adada0e217273ac924514b3a8"].unchecked_into(), - hex!["38fc0932145f659c13d14d4be0215b3a811738bf713c771b980032d66d10d567"].unchecked_into(), - ), ( - hex!["4e7de9c8f3564fe5cc5057de51c41b40a7da801d22c6ee5aa57f8bb2838ae857"].into(), - hex!["00e5a14e08930f94148569274ca1e9355938fabf65fffef3b7cb3c3e3edabb23"].into(), - STAKED_ENDOWMENT, - hex!["d76fca327e6b6c91c220acbe0769d16ede7c96578e7743036a784fe3d528d40d"].unchecked_into(), - hex!["da5bcd957592d12041bb9777605b3e3aeeac7712c2ba2339a80e33acfc5cf07e"].unchecked_into(), - hex!["d76fca327e6b6c91c220acbe0769d16ede7c96578e7743036a784fe3d528d40d"].unchecked_into(), - hex!["e04db33479ca34e1ee304db70edf95b37427c2350b14eff984bccc4d07e8876a"].unchecked_into(), - ), ( - hex!["ce64070e4dffe61183241dca3e922b65ecd509430a3e283fab5c143532f79d3e"].into(), - hex!["b0492fa7ac84ecb20f9f69e1c328b521fce8f472af2cc13784286d2240e4924c"].into(), - STAKED_ENDOWMENT, - hex!["5342c923d5c187f4417862556555ee09475c11141cbc0103272b826e0f8cd0b9"].unchecked_into(), - hex!["a7a35e31a1b49a5ced7f4f6ef214da56318e7ca0dfad50274dbcb88456f35621"].unchecked_into(), - hex!["5342c923d5c187f4417862556555ee09475c11141cbc0103272b826e0f8cd0b9"].unchecked_into(), - hex!["504e8b32ad648f3bfaf186840421b7717af828b77b2d512a30dd6cd62060401e"].unchecked_into(), - )]; +pub fn get_cw_mainnet_validators() -> Vec<( + AccountId, + AccountId, + Balance, + AuraId, + GrandpaId, + ImOnlineId, + AuthorityDiscoveryId, +)> { + return vec![ + ( + hex!["1ec5e3d9a77ac81d6da0290c04d003bbcb04af8c4902bd59dbf9be4dfa47234f"].into(), + hex!["d6fb4a2f0d5dfc62c37a09e6aac5c3ea4ce2ba021f553c940e63d59dadf0cd24"].into(), + STAKED_ENDOWMENT, + hex!["532cdeaeb19afd03eb4a57d4dddad09268fb720478d5386263330f5bf86f1cc4"].unchecked_into(), + hex!["ae5e4e8c3bbb47737a2b4abe79a71289f60271a94a5eaebf6b200f638fcbe332"].unchecked_into(), + hex!["532cdeaeb19afd03eb4a57d4dddad09268fb720478d5386263330f5bf86f1cc4"].unchecked_into(), + hex!["5e0755efa5da8b2bb83d2443635268b0be48ba020587fdc3731a5b87b51ff500"].unchecked_into(), + ), + ( + hex!["720967cda4c9097924d705695b62dfb6dc6dbeade65b5575abf5c4ca38e50503"].into(), + hex!["38a58e82baf9df6ec1f9a7064a337f872778649f3dd9002e3fe48df94b475232"].into(), + STAKED_ENDOWMENT, + hex!["89d7a1fb903a63494696c6d10d76704da7760da7f32dc3b5aa122bfba3f85680"].unchecked_into(), + hex!["f272b4cdec7e979dd76c7860f7e9dd8cb1da974d74366a266c4de501b2079896"].unchecked_into(), + hex!["89d7a1fb903a63494696c6d10d76704da7760da7f32dc3b5aa122bfba3f85680"].unchecked_into(), + hex!["fea24c3e2b57972eead003295fcfc52fb57ffd1bdfedf1dcfb1cd35df11dcc37"].unchecked_into(), + ), + ( + hex!["de90c8b070c0a63fbf52655af7492dc8e7d985334a4c60c02bc2f59424ff1430"].into(), + hex!["0e33e22cd22b272f388bcd41f13942d803089106ec350b8754e1d290ee6ff52b"].into(), + STAKED_ENDOWMENT, + hex!["98a4f5d4b363447331f54328d83816f773e30799be5979c3d6d9be08f4941799"].unchecked_into(), + hex!["8634c736497e74b1cedbecec7efe94bdff2ec899f60c97e003e8123f366e14e3"].unchecked_into(), + hex!["98a4f5d4b363447331f54328d83816f773e30799be5979c3d6d9be08f4941799"].unchecked_into(), + hex!["bce40bb0b2649d3fa924e050c603dccb5b7468f89924158e9b6d4d048c79dc23"].unchecked_into(), + ), + ( + hex!["9665bd715c72b686c2557fe11e6cd54924adef62dc1f52cf43a503f363cf843c"].into(), + hex!["6aa8f0dd6b6221788d68bf2486126fb14bb65ea710028c11f7ca131e0df10707"].into(), + STAKED_ENDOWMENT, + hex!["095ca61a04a9bd2fc95b31c1f86b73ef85e1388e75822896b4079cf5bc1c0e14"].unchecked_into(), + hex!["98d7399dd06f0192a2eb3096aca6df6f2600634d77b92c926bed92d60c50b75d"].unchecked_into(), + hex!["095ca61a04a9bd2fc95b31c1f86b73ef85e1388e75822896b4079cf5bc1c0e14"].unchecked_into(), + hex!["8e84ac19afbba97a686f1b20a3288610f76177b3c71cdc1f31df0828ba6acd1c"].unchecked_into(), + ), + ( + hex!["464c96a206e310511a27acc92b2e410a14bd83cb8788b522d0cee03f0d285862"].into(), + hex!["ae5bfe517affa6f7456ad6b9f7465520059e6d7b2a8928673460461abb741c18"].into(), + STAKED_ENDOWMENT, + hex!["76c5e8b1a4656cf7f174662674c61cb3a8fb67cee15d4f9a85f25235653c2a76"].unchecked_into(), + hex!["08b8316bbc960b4e3d610724e4f330556356b567fac3a7cb63fe458dbafdf028"].unchecked_into(), + hex!["76c5e8b1a4656cf7f174662674c61cb3a8fb67cee15d4f9a85f25235653c2a76"].unchecked_into(), + hex!["a69f1ccc84e40afae38d2d2f87b5910b164a8b451a0d70ac51e117f1222ede65"].unchecked_into(), + ), + ( + hex!["34c71b1e42e910b94b8cbb2c960873bd4bf0db6e80afdf41cdc52acd91d6393f"].into(), + hex!["6a782c02fd24ed538224f3d0bda56146bc6bacd34f9a784c1b5367e19cda456e"].into(), + STAKED_ENDOWMENT, + hex!["82b6147e4e661551609f04168599ed213c21fa194aba3327fb2fd6247a52b5d2"].unchecked_into(), + hex!["996b0ef45bd1f90b17ebc5f038cea21ccc1725a2c1daf3a85e774e22e173bb6e"].unchecked_into(), + hex!["82b6147e4e661551609f04168599ed213c21fa194aba3327fb2fd6247a52b5d2"].unchecked_into(), + hex!["bef61229205f6027e92e70bcd6b01e352c21d795e38dd64cf87335fd214d994b"].unchecked_into(), + ), + ( + hex!["d02002915139ac3e4552c5006f92cccfbf8b02cb4d4ca1993a69d63368cc1f0c"].into(), + hex!["4864744ab79cd62cbc1094da8e6f54aba8cba7ed6d616bdd8df10572d146c15c"].into(), + STAKED_ENDOWMENT, + hex!["3cf4ee0a14ea22e82a8953d60fc68f80a62d881e0b56c97445b3ea96adc4d31c"].unchecked_into(), + hex!["2f9a90f811621556d0dd1bdf324d0154444b34a0501a9f5bd338cf41d94634f9"].unchecked_into(), + hex!["3cf4ee0a14ea22e82a8953d60fc68f80a62d881e0b56c97445b3ea96adc4d31c"].unchecked_into(), + hex!["4e85c095e94a47dea48c7c6824d3f4818e1c34df1e00fe658d650845c275e13e"].unchecked_into(), + ), + ( + hex!["143f9f9019fa62919ed6da39b8f147cb52501438e1e9e7a82d22d7b49df18e59"].into(), + hex!["a01bef9c8591ae4155f9483eee09db092fb39bdd580e3715e927333e4aa89d6d"].into(), + STAKED_ENDOWMENT, + hex!["191decd2b0b7e447a2009d0c8f963b118ee7781adada0e217273ac924514b3a8"].unchecked_into(), + hex!["a81b12f94160734c3e53ac961a73c796783be50225e4e9b028e8318654f2d876"].unchecked_into(), + hex!["191decd2b0b7e447a2009d0c8f963b118ee7781adada0e217273ac924514b3a8"].unchecked_into(), + hex!["38fc0932145f659c13d14d4be0215b3a811738bf713c771b980032d66d10d567"].unchecked_into(), + ), + ( + hex!["4e7de9c8f3564fe5cc5057de51c41b40a7da801d22c6ee5aa57f8bb2838ae857"].into(), + hex!["00e5a14e08930f94148569274ca1e9355938fabf65fffef3b7cb3c3e3edabb23"].into(), + STAKED_ENDOWMENT, + hex!["d76fca327e6b6c91c220acbe0769d16ede7c96578e7743036a784fe3d528d40d"].unchecked_into(), + hex!["da5bcd957592d12041bb9777605b3e3aeeac7712c2ba2339a80e33acfc5cf07e"].unchecked_into(), + hex!["d76fca327e6b6c91c220acbe0769d16ede7c96578e7743036a784fe3d528d40d"].unchecked_into(), + hex!["e04db33479ca34e1ee304db70edf95b37427c2350b14eff984bccc4d07e8876a"].unchecked_into(), + ), + ( + hex!["ce64070e4dffe61183241dca3e922b65ecd509430a3e283fab5c143532f79d3e"].into(), + hex!["b0492fa7ac84ecb20f9f69e1c328b521fce8f472af2cc13784286d2240e4924c"].into(), + STAKED_ENDOWMENT, + hex!["5342c923d5c187f4417862556555ee09475c11141cbc0103272b826e0f8cd0b9"].unchecked_into(), + hex!["a7a35e31a1b49a5ced7f4f6ef214da56318e7ca0dfad50274dbcb88456f35621"].unchecked_into(), + hex!["5342c923d5c187f4417862556555ee09475c11141cbc0103272b826e0f8cd0b9"].unchecked_into(), + hex!["504e8b32ad648f3bfaf186840421b7717af828b77b2d512a30dd6cd62060401e"].unchecked_into(), + ), + ]; } /// Commonwealth election member pub fn get_mainnet_election_members() -> Vec { - return vec![ - hex!["ca91588bb9258ade926d0c0631798d7e3f17c4581fae56283287d54883244a55"].into(), - ]; + return vec![hex!["ca91588bb9258ade926d0c0631798d7e3f17c4581fae56283287d54883244a55"].into()]; } /// Mainnet root key diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index a1314877..db691421 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -18,33 +18,59 @@ //! Service implementation. Specialized wrapper over substrate service. -use sc_service::ChainSpec; -use std::{sync::{Arc, Mutex}, collections::HashMap}; -use fc_rpc_core::types::PendingTransactions; -use sc_client_api::{ExecutorProvider, RemoteBackend, BlockchainEvents}; -use sc_consensus_aura; -use sc_finality_grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; -use fc_consensus::FrontierBlockImport; +use crate::Cli; +use edgeware_executor::Executor; +use edgeware_opts::{EthApi as EthApiCmd, RpcConfig}; use edgeware_primitives::Block; + use edgeware_runtime::RuntimeApi; -use sc_service::{ - config::{Configuration}, error::{Error as ServiceError}, - RpcHandlers, TaskManager, -}; -use sp_inherents::InherentDataProviders; +#[cfg(feature = "frontier-block-import")] +use fc_consensus::FrontierBlockImport; + + +use fc_rpc_core::types::{FilterPool, PendingTransactions}; +use futures::prelude::*; +use sc_cli::SubstrateCli; +use sc_client_api::{ExecutorProvider, RemoteBackend}; +use sc_consensus_aura::{self, ImportQueueParams, SlotProportion, StartAuraParams}; use sc_network::{Event, NetworkService}; +use sc_service::{config::Configuration, error::Error as ServiceError, BasePath, ChainSpec, RpcHandlers, TaskManager}; +use sc_telemetry::{Telemetry, TelemetryWorker}; +use sp_consensus::SlotData; +use sp_core::U256; use sp_runtime::traits::Block as BlockT; -use futures::prelude::*; -use edgeware_executor::Executor; +use std::{ + collections::{BTreeMap, HashMap}, + str::FromStr, + sync::{Arc, Mutex}, + time::Duration, +}; + type FullClient = sc_service::TFullClient; type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; -type FullGrandpaBlockImport = - sc_finality_grandpa::GrandpaBlockImport; +type FullGrandpaBlockImport = sc_finality_grandpa::GrandpaBlockImport; type LightClient = sc_service::TLightClient; -/// Can be called for a `Configuration` to check if it is a configuration for the `Kusama` network. +#[cfg(feature = "frontier-block-import")] +type ConsensusResult = sc_consensus_aura::AuraBlockImport< + Block, + FullClient, + FrontierBlockImport, + sp_consensus_aura::ed25519::AuthorityPair, +>; + +#[cfg(not(feature = "frontier-block-import"))] +type ConsensusResult = sc_consensus_aura::AuraBlockImport< + Block, + FullClient, + FullGrandpaBlockImport, + sp_consensus_aura::ed25519::AuthorityPair, +>; + +/// Can be called for a `Configuration` to check if it is a configuration for +/// the `Kusama` network. pub trait IdentifyVariant { /// Returns if this is a configuration for the `Kusama` network. fn is_mainnet(&self) -> bool; @@ -63,104 +89,187 @@ impl IdentifyVariant for Box { } } -pub fn new_partial(config: &Configuration) -> Result, - sc_transaction_pool::FullPool, - ( - sc_consensus_aura::AuraBlockImport< - Block, - FullClient, - FrontierBlockImport< - Block, - FullGrandpaBlockImport, - FullClient - >, - sp_consensus_aura::ed25519::AuthorityPair - >, - sc_finality_grandpa::LinkHalf, - PendingTransactions, - ) ->, ServiceError> { - let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::(&config)?; +pub fn open_frontier_backend(config: &Configuration) -> Result>, String> { + let config_dir = config + .base_path + .as_ref() + .map(|base_path| base_path.config_dir(config.chain_spec.id())) + .unwrap_or_else(|| { + BasePath::from_project("", "", &crate::cli::Cli::executable_name()).config_dir(config.chain_spec.id()) + }); + let database_dir = config_dir.join("frontier").join("db"); + + Ok(Arc::new(fc_db::Backend::::new(&fc_db::DatabaseSettings { + source: fc_db::DatabaseSettingsSrc::RocksDb { + path: database_dir, + cache_size: 0, + }, + })?)) +} + +pub fn new_partial( + config: &Configuration, + cli: &Cli, +) -> Result< + sc_service::PartialComponents< + FullClient, + FullBackend, + FullSelectChain, + sp_consensus::DefaultImportQueue, + sc_transaction_pool::FullPool, + ( + ConsensusResult, + sc_finality_grandpa::LinkHalf, + PendingTransactions, + Option, + Arc>, + Option, + ), + >, + ServiceError, +> { + let telemetry = config + .telemetry_endpoints + .clone() + .filter(|x| !x.is_empty()) + .map(|endpoints| -> Result<_, sc_telemetry::Error> { + let worker = TelemetryWorker::new(16)?; + let telemetry = worker.handle().new_telemetry(endpoints); + Ok((worker, telemetry)) + }) + .transpose()?; + + let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( + &config, + telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), + )?; let client = Arc::new(client); + let telemetry = telemetry.map(|(worker, telemetry)| { + task_manager.spawn_handle().spawn("telemetry", worker.run()); + telemetry + }); + let select_chain = sc_consensus::LongestChain::new(backend.clone()); let transaction_pool = sc_transaction_pool::BasicPool::new_full( config.transaction_pool.clone(), + config.role.is_authority().into(), config.prometheus_registry(), task_manager.spawn_handle(), client.clone(), ); - let pending_transactions: PendingTransactions - = Some(Arc::new(Mutex::new(HashMap::new()))); + let pending_transactions: PendingTransactions = Some(Arc::new(Mutex::new(HashMap::new()))); + + let filter_pool: Option = Some(Arc::new(Mutex::new(BTreeMap::new()))); + + let frontier_backend = open_frontier_backend(config)?; let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( client.clone(), &(client.clone() as Arc<_>), select_chain.clone(), + telemetry.as_ref().map(|x| x.handle()), )?; - let frontier_block_import = FrontierBlockImport::new( - grandpa_block_import.clone(), - client.clone(), - true - ); + #[cfg(feature = "frontier-block-import")] + let frontier_block_import = + FrontierBlockImport::new(grandpa_block_import.clone(), client.clone(), frontier_backend.clone()); let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, sp_consensus_aura::ed25519::AuthorityPair>::new( + #[cfg(feature = "frontier-block-import")] frontier_block_import, - client.clone() + #[cfg(not(feature = "frontier-block-import"))] + grandpa_block_import.clone(), + client.clone(), ); + let slot_duration = sc_consensus_aura::slot_duration(&*client)?; + let raw_slot_duration = slot_duration.slot_duration(); - let inherent_data_providers = sp_inherents::InherentDataProviders::new(); + let target_gas_price = U256::from(cli.run.target_gas_price); - let import_queue = sc_consensus_aura::import_queue::<_, _, _, sp_consensus_aura::ed25519::AuthorityPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - aura_block_import.clone(), - Some(Box::new(grandpa_block_import.clone())), - client.clone(), - inherent_data_providers.clone(), - &task_manager.spawn_handle(), - config.prometheus_registry(), - sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), + let import_queue = sc_consensus_aura::import_queue::( + ImportQueueParams { + block_import: aura_block_import.clone(), + justification_import: Some(Box::new(grandpa_block_import.clone())), + client: client.clone(), + create_inherent_data_providers: move |_, ()| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + + let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration( + *timestamp, + raw_slot_duration, + ); + + let fee = pallet_dynamic_fee::InherentDataProvider(target_gas_price); + + Ok((timestamp, slot, fee)) + }, + spawner: &task_manager.spawn_essential_handle(), + can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), + registry: config.prometheus_registry(), + check_for_equivocation: Default::default(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }, )?; Ok(sc_service::PartialComponents { - client, backend, task_manager, import_queue, keystore_container, select_chain, transaction_pool, - inherent_data_providers, - other: (aura_block_import.clone(), grandpa_link, pending_transactions,) + client, + backend, + task_manager, + import_queue, + keystore_container, + select_chain, + transaction_pool, + other: ( + aura_block_import, + grandpa_link, + pending_transactions, + filter_pool, + frontier_backend, + telemetry, + ), }) } /// Creates a full service from the configuration. -pub fn new_full_base( - mut config: Configuration, - enable_dev_signer: bool, - with_startup_data: impl FnOnce( - &sc_consensus_aura::AuraBlockImport< - Block, - FullClient, - FrontierBlockImport< - Block, - FullGrandpaBlockImport, - FullClient - >, - sp_consensus_aura::ed25519::AuthorityPair - >, - &sc_finality_grandpa::LinkHalf, - ), -) -> Result { +pub fn new_full_base(mut config: Configuration, cli: &Cli) -> Result { + let ethapi: Vec<_> = cli + .run + .ethapi + .iter() + .map(|v| EthApiCmd::from_str(&v.to_string())) + .flatten() + .collect(); + + let rpc_config = RpcConfig { + ethapi: ethapi.clone(), + ethapi_max_permits: cli.run.ethapi_max_permits, + ethapi_trace_max_count: cli.run.ethapi_trace_max_count, + ethapi_trace_cache_duration: cli.run.ethapi_trace_cache_duration, + max_past_logs: cli.run.max_past_logs, + }; + + let enable_dev_signer = cli.run.enable_dev_signer; + let target_gas_price = U256::from(cli.run.target_gas_price); + let sc_service::PartialComponents { - client, backend, mut task_manager, import_queue, keystore_container, - select_chain, transaction_pool, inherent_data_providers, - other: (block_import, grandpa_link, pending_transactions), - } = new_partial(&config)?; + client, + backend, + mut task_manager, + import_queue, + keystore_container, + select_chain, + transaction_pool, + other: (block_import, grandpa_link, pending_transactions, filter_pool, frontier_backend, mut telemetry), + } = new_partial(&config, cli)?; - config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config()); + config + .network + .extra_sets + .push(sc_finality_grandpa::grandpa_peers_set_config()); let (network, network_status_sinks, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { @@ -174,9 +283,7 @@ pub fn new_full_base( })?; if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(), - ); + sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone()); } let role = config.role.clone(); @@ -184,14 +291,27 @@ pub fn new_full_base( let name = config.network.node_name.clone(); let enable_grandpa = !config.disable_grandpa; let prometheus_registry = config.prometheus_registry().cloned(); - let telemetry_connection_sinks = sc_service::TelemetryConnectionSinks::default(); + + let spawned_requesters = edgeware_rpc::spawn_tasks( + &rpc_config, + edgeware_rpc::SpawnTasksParams { + task_manager: &task_manager, + client: client.clone(), + substrate_backend: backend.clone(), + frontier_backend: frontier_backend.clone(), + pending_transactions: pending_transactions.clone(), + filter_pool: filter_pool.clone(), + }, + ); let (rpc_extensions_builder, rpc_setup) = { let justification_stream = grandpa_link.justification_stream(); let shared_authority_set = grandpa_link.shared_authority_set().clone(); let shared_voter_state = sc_finality_grandpa::SharedVoterState::empty(); - let finality_proof_provider = - GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone()); + let finality_proof_provider = sc_finality_grandpa::FinalityProofProvider::new_for_service( + backend.clone(), + Some(shared_authority_set.clone()), + ); let rpc_setup = (shared_voter_state.clone(), finality_proof_provider.clone()); let client = client.clone(); @@ -199,6 +319,10 @@ pub fn new_full_base( let select_chain = select_chain.clone(); let network = network.clone(); let pending = pending_transactions.clone(); + let filter_pool = filter_pool.clone(); + let frontier_backend = frontier_backend.clone(); + let max_past_logs = rpc_config.max_past_logs; + let is_authority = config.role.clone().is_authority(); let _keystore = keystore_container.sync_keystore(); let subscription_executor = sc_rpc::SubscriptionTaskExecutor::new(task_manager.spawn_handle()); @@ -207,12 +331,12 @@ pub fn new_full_base( let deps = edgeware_rpc::FullDeps { client: client.clone(), pool: pool.clone(), + graph: pool.pool().clone(), select_chain: select_chain.clone(), network: network.clone(), - pending_transactions: pending.clone(), is_authority, - enable_dev_signer, deny_unsafe, + // Grandpa grandpa: edgeware_rpc::GrandpaDeps { shared_voter_state: shared_voter_state.clone(), shared_authority_set: shared_authority_set.clone(), @@ -220,6 +344,16 @@ pub fn new_full_base( subscription_executor: subscription_executor.clone(), finality_provider: finality_proof_provider.clone(), }, + // Frontier + enable_dev_signer, + pending_transactions: pending.clone(), + filter_pool: filter_pool.clone(), + backend: frontier_backend.clone(), + max_past_logs, + ethapi_cmd: ethapi.clone(), + debug_requester: spawned_requesters.debug.clone(), + trace_filter_requester: spawned_requesters.trace.clone(), + trace_filter_max_count: rpc_config.ethapi_trace_max_count, }; edgeware_rpc::create_full(deps, subscription_executor.clone()) @@ -239,98 +373,74 @@ pub fn new_full_base( task_manager: &mut task_manager, on_demand: None, remote_blockchain: None, - telemetry_connection_sinks: telemetry_connection_sinks.clone(), network_status_sinks: network_status_sinks.clone(), system_rpc_tx, + telemetry: telemetry.as_mut(), })?; - // Spawn Frontier pending transactions maintenance task (as essential, otherwise we leak). - if pending_transactions.is_some() { - use futures::StreamExt; - use fp_consensus::{FRONTIER_ENGINE_ID, ConsensusLog}; - use sp_runtime::generic::OpaqueDigestItemId; - - const TRANSACTION_RETAIN_THRESHOLD: u64 = 5; - task_manager.spawn_essential_handle().spawn( - "frontier-pending-transactions", - client.import_notification_stream().for_each(move |notification| { - - if let Ok(locked) = &mut pending_transactions.clone().unwrap().lock() { - // As pending transactions have a finite lifespan anyway - // we can ignore MultiplePostRuntimeLogs error checks. - let mut frontier_log: Option<_> = None; - for log in notification.header.digest.logs { - let log = log.try_to::(OpaqueDigestItemId::Consensus(&FRONTIER_ENGINE_ID)); - if let Some(log) = log { - frontier_log = Some(log); - } - } - - let imported_number: u64 = notification.header.number as u64; - - if let Some(ConsensusLog::EndBlock { - block_hash: _, transaction_hashes, - }) = frontier_log { - // Retain all pending transactions that were not - // processed in the current block. - locked.retain(|&k, _| !transaction_hashes.contains(&k)); - } - locked.retain(|_, v| { - // Drop all the transactions that exceeded the given lifespan. - let lifespan_limit = v.at_block + TRANSACTION_RETAIN_THRESHOLD; - lifespan_limit > imported_number - }); - } - futures::future::ready(()) - }) - ); - } - let (shared_voter_state, _finality_proof_provider) = rpc_setup; - (with_startup_data)(&block_import, &grandpa_link); + let backoff_authoring_blocks: Option<()> = None; if let sc_service::config::Role::Authority { .. } = &role { - let proposer = sc_basic_authorship::ProposerFactory::new( + let proposer_factory = sc_basic_authorship::ProposerFactory::new( task_manager.spawn_handle(), client.clone(), transaction_pool.clone(), prometheus_registry.as_ref(), + telemetry.as_ref().map(|x| x.handle()), ); - let can_author_with = - sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); - - let backoff_authoring_blocks: Option<()> = None; - let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, sp_consensus_aura::ed25519::AuthorityPair, _, _, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - client.clone(), - select_chain, - block_import, - proposer, - network.clone(), - inherent_data_providers.clone(), - force_authoring, - backoff_authoring_blocks, - keystore_container.sync_keystore(), - can_author_with, - )?; + let can_author_with = sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); + let slot_duration = sc_consensus_aura::slot_duration(&*client)?; + let raw_slot_duration = slot_duration.slot_duration(); + + let aura = + sc_consensus_aura::start_aura::( + StartAuraParams { + slot_duration, + client: client.clone(), + select_chain, + block_import, + proposer_factory, + create_inherent_data_providers: move |_, ()| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + + let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration( + *timestamp, + raw_slot_duration, + ); + + let fee = pallet_dynamic_fee::InherentDataProvider(target_gas_price); + + Ok((timestamp, slot, fee)) + }, + force_authoring, + backoff_authoring_blocks, + keystore: keystore_container.sync_keystore(), + can_author_with, + sync_oracle: network.clone(), + block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }, + )?; // the AURA authoring task is considered essential, i.e. if it // fails we take down the service with it. - task_manager.spawn_essential_handle().spawn_blocking("aura-proposer", aura); + task_manager + .spawn_essential_handle() + .spawn_blocking("aura-proposer", aura); } // Spawn authority discovery module. if role.is_authority() { - let authority_discovery_role = sc_authority_discovery::Role::PublishAndDiscover( - keystore_container.keystore(), - ); - let dht_event_stream = network.event_stream("authority-discovery") - .filter_map(|e| async move { match e { + let authority_discovery_role = sc_authority_discovery::Role::PublishAndDiscover(keystore_container.keystore()); + let dht_event_stream = network.event_stream("authority-discovery").filter_map(|e| async move { + match e { Event::Dht(e) => Some(e), _ => None, - }}); + } + }); let (authority_discovery_worker, _service) = sc_authority_discovery::new_worker_and_service( client.clone(), network.clone(), @@ -339,7 +449,9 @@ pub fn new_full_base( prometheus_registry.clone(), ); - task_manager.spawn_handle().spawn("authority-discovery-worker", authority_discovery_worker.run()); + task_manager + .spawn_handle() + .spawn("authority-discovery-worker", authority_discovery_worker.run()); } // if the node isn't actively participating in consensus then it doesn't @@ -352,12 +464,13 @@ pub fn new_full_base( let config = sc_finality_grandpa::Config { // FIXME #1578 make this available through chainspec - gossip_duration: std::time::Duration::from_millis(333), + gossip_duration: Duration::from_millis(333), justification_period: 512, name: Some(name), observer_enabled: false, keystore, - is_authority: role.is_network_authority(), + is_authority: role.is_authority(), + telemetry: telemetry.as_ref().map(|x| x.handle()), }; if enable_grandpa { @@ -371,7 +484,7 @@ pub fn new_full_base( config, link: grandpa_link, network: network.clone(), - telemetry_on_connect: Some(telemetry_connection_sinks.on_connect_stream()), + telemetry: telemetry.as_ref().map(|x| x.handle()), voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), prometheus_registry, shared_voter_state, @@ -379,43 +492,65 @@ pub fn new_full_base( // the GRANDPA voter task is considered infallible, i.e. // if it fails we take down the service with it. - task_manager.spawn_essential_handle().spawn_blocking( - "grandpa-voter", - sc_finality_grandpa::run_grandpa_voter(grandpa_config)? - ); + task_manager + .spawn_essential_handle() + .spawn_blocking("grandpa-voter", sc_finality_grandpa::run_grandpa_voter(grandpa_config)?); } network_starter.start_network(); Ok(NewFullBase { - task_manager, inherent_data_providers, client, network, network_status_sinks, + task_manager, + client, + network, transaction_pool, }) } pub struct NewFullBase { pub task_manager: TaskManager, - pub inherent_data_providers: InherentDataProviders, pub client: Arc, pub network: Arc::Hash>>, - pub network_status_sinks: sc_service::NetworkStatusSinks, pub transaction_pool: Arc>, } /// Builds a new service for a full client. -pub fn new_full(config: Configuration, enable_dev_signer: bool) --> Result { - new_full_base(config, enable_dev_signer, |_, _| ()).map(|NewFullBase { task_manager, .. }| { - task_manager - }) +pub fn new_full(config: Configuration, cli: &Cli) -> Result { + new_full_base(config, cli).map(|NewFullBase { task_manager, .. }| task_manager) } -pub fn new_light_base(config: Configuration) -> Result<( - TaskManager, RpcHandlers, Arc, - Arc::Hash>>, - Arc>> -), ServiceError> { +pub fn new_light_base( + config: Configuration, +) -> Result< + ( + TaskManager, + RpcHandlers, + Arc, + Arc::Hash>>, + Arc>>, + ), + ServiceError, +> { + let telemetry = config + .telemetry_endpoints + .clone() + .filter(|x| !x.is_empty()) + .map(|endpoints| -> Result<_, sc_telemetry::Error> { + let worker = TelemetryWorker::new(16)?; + let telemetry = worker.handle().new_telemetry(endpoints); + Ok((worker, telemetry)) + }) + .transpose()?; + let (client, backend, keystore_container, mut task_manager, on_demand) = - sc_service::new_light_parts::(&config)?; + sc_service::new_light_parts::( + &config, + telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), + )?; + + let mut telemetry = telemetry.map(|(worker, telemetry)| { + task_manager.spawn_handle().spawn("telemetry", worker.run()); + telemetry + }); let select_chain = sc_consensus::LongestChain::new(backend.clone()); @@ -431,22 +566,32 @@ pub fn new_light_base(config: Configuration) -> Result<( client.clone(), &(client.clone() as Arc<_>), select_chain.clone(), + telemetry.as_ref().map(|x| x.handle()), )?; - let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, sp_consensus_aura::ed25519::AuthorityPair>::new( - grandpa_block_import.clone(), - client.clone(), - ); + let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration(); - let import_queue = sc_consensus_aura::import_queue::<_, _, _, sp_consensus_aura::ed25519::AuthorityPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - aura_block_import, - Some(Box::new(grandpa_block_import)), - client.clone(), - InherentDataProviders::new(), - &task_manager.spawn_handle(), - config.prometheus_registry(), - sp_consensus::NeverCanAuthor, + let import_queue = sc_consensus_aura::import_queue::( + ImportQueueParams { + block_import: grandpa_block_import.clone(), + justification_import: Some(Box::new(grandpa_block_import.clone())), + client: client.clone(), + create_inherent_data_providers: move |_, ()| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + + let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration( + *timestamp, + slot_duration, + ); + + Ok((timestamp, slot)) + }, + spawner: &task_manager.spawn_essential_handle(), + can_author_with: sp_consensus::NeverCanAuthor, + registry: config.prometheus_registry(), + check_for_equivocation: Default::default(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }, )?; let (network, network_status_sinks, system_rpc_tx, network_starter) = @@ -459,12 +604,11 @@ pub fn new_light_base(config: Configuration) -> Result<( on_demand: Some(on_demand.clone()), block_announce_validator_builder: None, })?; + network_starter.start_network(); if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(), - ); + sc_service::build_offchain_workers(&config, task_manager.spawn_handle(), client.clone(), network.clone()); } let light_deps = edgeware_rpc::LightDeps { @@ -476,27 +620,26 @@ pub fn new_light_base(config: Configuration) -> Result<( let rpc_extensions = edgeware_rpc::create_light(light_deps); - let rpc_handlers = - sc_service::spawn_tasks(sc_service::SpawnTasksParams { - on_demand: Some(on_demand), - remote_blockchain: Some(backend.remote_blockchain()), - rpc_extensions_builder: Box::new(sc_service::NoopRpcExtensionBuilder(rpc_extensions)), - client: client.clone(), - transaction_pool: transaction_pool.clone(), - keystore: keystore_container.sync_keystore(), - config, backend, network_status_sinks, system_rpc_tx, - network: network.clone(), - telemetry_connection_sinks: sc_service::TelemetryConnectionSinks::default(), - task_manager: &mut task_manager, - })?; + let rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { + on_demand: Some(on_demand), + remote_blockchain: Some(backend.remote_blockchain()), + rpc_extensions_builder: Box::new(sc_service::NoopRpcExtensionBuilder(rpc_extensions)), + client: client.clone(), + transaction_pool: transaction_pool.clone(), + keystore: keystore_container.sync_keystore(), + config, + backend, + network_status_sinks, + system_rpc_tx, + network: network.clone(), + task_manager: &mut task_manager, + telemetry: telemetry.as_mut(), + })?; Ok((task_manager, rpc_handlers, client, network, transaction_pool)) } /// Builds a new service for a light client. pub fn new_light(config: Configuration) -> Result { - new_light_base(config).map(|(task_manager, _, _, _, _)| { - task_manager - }) + new_light_base(config).map(|(task_manager, ..)| task_manager) } - diff --git a/node/cli/src/testnet_fixtures.rs b/node/cli/src/testnet_fixtures.rs index 709ca1ca..cf7a0ca8 100644 --- a/node/cli/src/testnet_fixtures.rs +++ b/node/cli/src/testnet_fixtures.rs @@ -16,110 +16,134 @@ //! Testnet fixtures +use edgeware_primitives::AccountId; +use hex_literal::hex; +use pallet_im_online::ed25519::AuthorityId as ImOnlineId; +use sc_network::config::MultiaddrWithPeerId; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_aura::ed25519::AuthorityId as AuraId; -use edgeware_primitives::{AccountId}; -use sp_finality_grandpa::AuthorityId as GrandpaId; -use pallet_im_online::ed25519::{AuthorityId as ImOnlineId}; use sp_core::crypto::UncheckedInto; -use hex_literal::hex; -use sc_network::config::MultiaddrWithPeerId; +use sp_finality_grandpa::AuthorityId as GrandpaId; /// Testnet bootnodes pub fn get_testnet_bootnodes() -> Vec { return vec![ - "/ip4/45.77.78.68/tcp/30333/p2p/QmVxmq3EtJa7NWae6hQv3PqBNud2UhubUWVXjVewtGeciK".parse().unwrap(), - "/ip4/45.76.17.97/tcp/30333/p2p/QmSpWQuAmrFgiygF2DZd3bzyHCWuzYcFXmLpzcph5mnTu9".parse().unwrap(), - "/ip4/45.77.93.189/tcp/30333/p2p/QmVJfKRBVPcZHnaqfGyRym3aTXZMtrmNn8XYGsowoxUhr9".parse().unwrap(), - "/ip4/108.61.209.73/tcp/30333/p2p/QmQFddsCpMh3rF7xTWuqWAcWy1pqS4bvShTRVe9zbYJQRh".parse().unwrap(), - "/ip4/45.76.248.131/tcp/30333/p2p/QmeDZ3uK2aSv738r7trsQrpGt7HGgDLL3JqTY2SGHxN7qC".parse().unwrap(), - "/ip4/96.30.192.236/tcp/30333/p2p/QmNkioYhmd26XqzHRmRWCnvd5NGoMNKYh9fgxvAy9Zf7mS".parse().unwrap(), + "/ip4/45.77.78.68/tcp/30333/p2p/QmVxmq3EtJa7NWae6hQv3PqBNud2UhubUWVXjVewtGeciK" + .parse() + .unwrap(), + "/ip4/45.76.17.97/tcp/30333/p2p/QmSpWQuAmrFgiygF2DZd3bzyHCWuzYcFXmLpzcph5mnTu9" + .parse() + .unwrap(), + "/ip4/45.77.93.189/tcp/30333/p2p/QmVJfKRBVPcZHnaqfGyRym3aTXZMtrmNn8XYGsowoxUhr9" + .parse() + .unwrap(), + "/ip4/108.61.209.73/tcp/30333/p2p/QmQFddsCpMh3rF7xTWuqWAcWy1pqS4bvShTRVe9zbYJQRh" + .parse() + .unwrap(), + "/ip4/45.76.248.131/tcp/30333/p2p/QmeDZ3uK2aSv738r7trsQrpGt7HGgDLL3JqTY2SGHxN7qC" + .parse() + .unwrap(), + "/ip4/96.30.192.236/tcp/30333/p2p/QmNkioYhmd26XqzHRmRWCnvd5NGoMNKYh9fgxvAy9Zf7mS" + .parse() + .unwrap(), ]; } - - /// Testnet initial authorities -pub fn get_testnet_initial_authorities() -> Vec<(AccountId, AccountId, GrandpaId, AuraId, ImOnlineId, AuthorityDiscoveryId)> { - return vec![( - // 5DRQpsFg1BgziDA5oMfwVyWzF8CkwwnxsguSu1utbgRNQFrK - hex!["3c070e2721a02249bd35a0677e1a3b1a8b9a07c25a902e7e9373b4e4d0378a54"].into(), - // 5GNyVHKVDEh4FfAQNhdkTWKuPT42j9ExsFJHfP7RjDo4s8qB - hex!["bedff87aaf3154ee73dae8754f9af11e033a0cbba09a8e91f4dde82d3d6bed20"].into(), - // 5HfcYNfpoch9w88CzAqH9PuWHUzwbSJHBA1v3BF9WsRoLht7 - hex!["f7ccdcf57cd3ecd9e56c3324ad95a1484e6f21b0b6f3540a09ada389499cab9d"].unchecked_into(), - // 5ETqvphCpj22HfKcKRc4zS1VCdZXKtaF1ArhHAyQU73ceVm5 - hex!["6a1e4860a31716685e0e0f49f3333c5799bbdab5dd3bb1e674134f6f9b2be689"].unchecked_into(), - // 5ETqvphCpj22HfKcKRc4zS1VCdZXKtaF1ArhHAyQU73ceVm5 - hex!["6a1e4860a31716685e0e0f49f3333c5799bbdab5dd3bb1e674134f6f9b2be689"].unchecked_into(), - // 5ETqvphCpj22HfKcKRc4zS1VCdZXKtaF1ArhHAyQU73ceVm5 - hex!["6a1e4860a31716685e0e0f49f3333c5799bbdab5dd3bb1e674134f6f9b2be689"].unchecked_into(), - ),( - // 5EHvssibZkZHkZwoABzBqbb21rsaJjQg8KfW75TjVZmzbEh9 - hex!["628e7d34e61faa51f4aac5c400406646876c7189575d84eb6d4e4f5ecec8e672"].into(), - // 5DscYaYpUohKFeRJRvKYGU1XuDvLNo4XKuN6gDzeKSxF95eB - hex!["5002e2d414c9c0dc6753b54499077da71b8abe348ab0e745a78d1ca5e70cd752"].into(), - // 5DU7imzCeBoaWPkw6dqVpMUj8zzkgKom3uG3RJtPLNQpVhzk - hex!["3e1735fcc35cf289761f00cddabc74e91a9b565b9838a205f0027e23d06e76b1"].unchecked_into(), - // 5GnSM7vxsa5weU2EFTFi3qBRtxB66g4MtbaRpgCBRfEzA1G9 - hex!["d0c50804164d9e79b3899df678d6de83a226b581fc972f8b8bdc74070ae7e8af"].unchecked_into(), - // 5GnSM7vxsa5weU2EFTFi3qBRtxB66g4MtbaRpgCBRfEzA1G9 - hex!["d0c50804164d9e79b3899df678d6de83a226b581fc972f8b8bdc74070ae7e8af"].unchecked_into(), - // 5GnSM7vxsa5weU2EFTFi3qBRtxB66g4MtbaRpgCBRfEzA1G9 - hex!["d0c50804164d9e79b3899df678d6de83a226b581fc972f8b8bdc74070ae7e8af"].unchecked_into(), - ), ( - // 5CwKvDp9JTo3fLW9Q6NrEZ7PaCCjeLCmGbTnN2hEfs9WfRM7 - hex!["269ba9c9b8a209acdb1858501a649ac20ea2331a519c9104dbdda40356e3723f"].into(), - // 5E6xrSDyaARfbwkYQfDqsP2xA1wzLMoFRiXrpmWiuuV8GuZm - hex!["5a31704dfdb8e263a15b4af4ddd1c0b14e675377126c3bcddcb9cba0570c040f"].into(), - // 5CzV3FMTHzQxtF3TSkVcp2CNJHnuwUCJjhTsuYEUGxizRAUq - hex!["29041a9d8ca43fd99a9c0e2447c6d137e7ba991d8475c790cbf78744636f9915"].unchecked_into(), - // 5DDtisexsMoEG94f4tr5qRaSKJ42f1H1kBxEHKgq5Kocvsdq - hex!["333e04dd11f60ebf3037e2615be6d63b01f310b920f8022fb1d6737a2c73dfa5"].unchecked_into(), - // 5DDtisexsMoEG94f4tr5qRaSKJ42f1H1kBxEHKgq5Kocvsdq - hex!["333e04dd11f60ebf3037e2615be6d63b01f310b920f8022fb1d6737a2c73dfa5"].unchecked_into(), - // 5DDtisexsMoEG94f4tr5qRaSKJ42f1H1kBxEHKgq5Kocvsdq - hex!["333e04dd11f60ebf3037e2615be6d63b01f310b920f8022fb1d6737a2c73dfa5"].unchecked_into(), - ), ( - // 5DvWxEcMP66DgHigGm2eTTg4pPueDMMDS5F67ixK2WpCTKMU - hex!["5239cc265b2d7ac6dad6b640a28a64ce5e09b7de22fd0549c2d282d461da260e"].into(), - // 5EkGSct2SPojcFF6fX6EvF3xbaW5aq3oEW2ujJLjTKk8pexP - hex!["76a4bad1d5fe37ba60dcc9160f3b0fb1822c64f0e92f2171c358a0b7e59aef37"].into(), - // 5GywTGqF81sdGsynZG7hr8DgibrCDsdvNN9mGCQhf7CNqHpv - hex!["d98ab5ea66c0ee4d443b3b6f896daf9c7fefb4d1d2eeca7653ffae84557cf5f3"].unchecked_into(), - // 5D8sbkeQpqoAXt7E4WcNTBEK3sn4CGp67HRBJRQsqXFfsXB5 - hex!["2f6a032ba0dbdcac7fa68607533971ba399a9a06002978b4c071f87334d153b0"].unchecked_into(), - // 5D8sbkeQpqoAXt7E4WcNTBEK3sn4CGp67HRBJRQsqXFfsXB5 - hex!["2f6a032ba0dbdcac7fa68607533971ba399a9a06002978b4c071f87334d153b0"].unchecked_into(), - // 5D8sbkeQpqoAXt7E4WcNTBEK3sn4CGp67HRBJRQsqXFfsXB5 - hex!["2f6a032ba0dbdcac7fa68607533971ba399a9a06002978b4c071f87334d153b0"].unchecked_into(), - ), ( - // 5ECSwHL89ShGsfBt34HyjCHK7gkd6vGT5A4gTa5yd4mKPhYe - hex!["5e603412d1c84d56f590423a78050aebd3ec34e6d3bc775ca87d19216eb91911"].into(), - // 5C7rVE4qA7GvruqzHjc9RYnoNBP5hbCCKqpEjCm5KEmfvHir - hex!["0266c9d3e063215ef8f35fc87ccd50489b3c6a2356aac39f89d0667145fab16b"].into(), - // 5GCJ3HKN5MaseCwqwNJ4pUbpJqRbfAmZXWB8SCMJM6FMyM9B - hex!["b6bab8caa7be249400b5062d17908c59c0e40dcbe2bd1c818098a5dae916a869"].unchecked_into(), - // 5HPtGdWoRmiReRYE16AQitm4MG8s47ngfHLGUeKHZuo1Cdry - hex!["ebcde238597379c874dd51fcca5e0f651972b218c46aa21c471167474e089c86"].unchecked_into(), - // 5HPtGdWoRmiReRYE16AQitm4MG8s47ngfHLGUeKHZuo1Cdry - hex!["ebcde238597379c874dd51fcca5e0f651972b218c46aa21c471167474e089c86"].unchecked_into(), - // 5HPtGdWoRmiReRYE16AQitm4MG8s47ngfHLGUeKHZuo1Cdry - hex!["ebcde238597379c874dd51fcca5e0f651972b218c46aa21c471167474e089c86"].unchecked_into(), - ), ( - // 5GH23iTUJtvz9KGDK36nXWHtrkm6E83ZZjVPFhb8DKQk3cv3 - hex!["ba551cfbf9e91da337f21658276dfbd56ba43be852395db10a89a64e07978f31"].into(), - // 5HQwfPfmbuWt3fKyEK3SSuDneVtF4MwHbK1afsXPHxAfogyj - hex!["ec9c8c8d80eab0b1fc4733e25af31137fb656390c595bb1c7536f73b201ede57"].into(), - // 5GokhX8Ce1VrMaWFt5RMdAq2EkzoBxdUerFoMzRLDYNPyS2M - hex!["d1c60ddadc9a3f65da208c5c50e7fc9ed0ab069e79553d08dcc36a401948fa1a"].unchecked_into(), - // 5Ec2hh96mXEavdu2C866hgUC4joBYpBVujXQJgQsDWfUMmM1 - hex!["705c8360296c7b6af2f842e7a0804492c86a855aaa605fdf419f577f1f4fecbe"].unchecked_into(), - // 5Ec2hh96mXEavdu2C866hgUC4joBYpBVujXQJgQsDWfUMmM1 - hex!["705c8360296c7b6af2f842e7a0804492c86a855aaa605fdf419f577f1f4fecbe"].unchecked_into(), - // 5Ec2hh96mXEavdu2C866hgUC4joBYpBVujXQJgQsDWfUMmM1 - hex!["705c8360296c7b6af2f842e7a0804492c86a855aaa605fdf419f577f1f4fecbe"].unchecked_into(), - )]; +pub fn get_testnet_initial_authorities() -> Vec<( + AccountId, + AccountId, + GrandpaId, + AuraId, + ImOnlineId, + AuthorityDiscoveryId, +)> { + return vec![ + ( + // 5DRQpsFg1BgziDA5oMfwVyWzF8CkwwnxsguSu1utbgRNQFrK + hex!["3c070e2721a02249bd35a0677e1a3b1a8b9a07c25a902e7e9373b4e4d0378a54"].into(), + // 5GNyVHKVDEh4FfAQNhdkTWKuPT42j9ExsFJHfP7RjDo4s8qB + hex!["bedff87aaf3154ee73dae8754f9af11e033a0cbba09a8e91f4dde82d3d6bed20"].into(), + // 5HfcYNfpoch9w88CzAqH9PuWHUzwbSJHBA1v3BF9WsRoLht7 + hex!["f7ccdcf57cd3ecd9e56c3324ad95a1484e6f21b0b6f3540a09ada389499cab9d"].unchecked_into(), + // 5ETqvphCpj22HfKcKRc4zS1VCdZXKtaF1ArhHAyQU73ceVm5 + hex!["6a1e4860a31716685e0e0f49f3333c5799bbdab5dd3bb1e674134f6f9b2be689"].unchecked_into(), + // 5ETqvphCpj22HfKcKRc4zS1VCdZXKtaF1ArhHAyQU73ceVm5 + hex!["6a1e4860a31716685e0e0f49f3333c5799bbdab5dd3bb1e674134f6f9b2be689"].unchecked_into(), + // 5ETqvphCpj22HfKcKRc4zS1VCdZXKtaF1ArhHAyQU73ceVm5 + hex!["6a1e4860a31716685e0e0f49f3333c5799bbdab5dd3bb1e674134f6f9b2be689"].unchecked_into(), + ), + ( + // 5EHvssibZkZHkZwoABzBqbb21rsaJjQg8KfW75TjVZmzbEh9 + hex!["628e7d34e61faa51f4aac5c400406646876c7189575d84eb6d4e4f5ecec8e672"].into(), + // 5DscYaYpUohKFeRJRvKYGU1XuDvLNo4XKuN6gDzeKSxF95eB + hex!["5002e2d414c9c0dc6753b54499077da71b8abe348ab0e745a78d1ca5e70cd752"].into(), + // 5DU7imzCeBoaWPkw6dqVpMUj8zzkgKom3uG3RJtPLNQpVhzk + hex!["3e1735fcc35cf289761f00cddabc74e91a9b565b9838a205f0027e23d06e76b1"].unchecked_into(), + // 5GnSM7vxsa5weU2EFTFi3qBRtxB66g4MtbaRpgCBRfEzA1G9 + hex!["d0c50804164d9e79b3899df678d6de83a226b581fc972f8b8bdc74070ae7e8af"].unchecked_into(), + // 5GnSM7vxsa5weU2EFTFi3qBRtxB66g4MtbaRpgCBRfEzA1G9 + hex!["d0c50804164d9e79b3899df678d6de83a226b581fc972f8b8bdc74070ae7e8af"].unchecked_into(), + // 5GnSM7vxsa5weU2EFTFi3qBRtxB66g4MtbaRpgCBRfEzA1G9 + hex!["d0c50804164d9e79b3899df678d6de83a226b581fc972f8b8bdc74070ae7e8af"].unchecked_into(), + ), + ( + // 5CwKvDp9JTo3fLW9Q6NrEZ7PaCCjeLCmGbTnN2hEfs9WfRM7 + hex!["269ba9c9b8a209acdb1858501a649ac20ea2331a519c9104dbdda40356e3723f"].into(), + // 5E6xrSDyaARfbwkYQfDqsP2xA1wzLMoFRiXrpmWiuuV8GuZm + hex!["5a31704dfdb8e263a15b4af4ddd1c0b14e675377126c3bcddcb9cba0570c040f"].into(), + // 5CzV3FMTHzQxtF3TSkVcp2CNJHnuwUCJjhTsuYEUGxizRAUq + hex!["29041a9d8ca43fd99a9c0e2447c6d137e7ba991d8475c790cbf78744636f9915"].unchecked_into(), + // 5DDtisexsMoEG94f4tr5qRaSKJ42f1H1kBxEHKgq5Kocvsdq + hex!["333e04dd11f60ebf3037e2615be6d63b01f310b920f8022fb1d6737a2c73dfa5"].unchecked_into(), + // 5DDtisexsMoEG94f4tr5qRaSKJ42f1H1kBxEHKgq5Kocvsdq + hex!["333e04dd11f60ebf3037e2615be6d63b01f310b920f8022fb1d6737a2c73dfa5"].unchecked_into(), + // 5DDtisexsMoEG94f4tr5qRaSKJ42f1H1kBxEHKgq5Kocvsdq + hex!["333e04dd11f60ebf3037e2615be6d63b01f310b920f8022fb1d6737a2c73dfa5"].unchecked_into(), + ), + ( + // 5DvWxEcMP66DgHigGm2eTTg4pPueDMMDS5F67ixK2WpCTKMU + hex!["5239cc265b2d7ac6dad6b640a28a64ce5e09b7de22fd0549c2d282d461da260e"].into(), + // 5EkGSct2SPojcFF6fX6EvF3xbaW5aq3oEW2ujJLjTKk8pexP + hex!["76a4bad1d5fe37ba60dcc9160f3b0fb1822c64f0e92f2171c358a0b7e59aef37"].into(), + // 5GywTGqF81sdGsynZG7hr8DgibrCDsdvNN9mGCQhf7CNqHpv + hex!["d98ab5ea66c0ee4d443b3b6f896daf9c7fefb4d1d2eeca7653ffae84557cf5f3"].unchecked_into(), + // 5D8sbkeQpqoAXt7E4WcNTBEK3sn4CGp67HRBJRQsqXFfsXB5 + hex!["2f6a032ba0dbdcac7fa68607533971ba399a9a06002978b4c071f87334d153b0"].unchecked_into(), + // 5D8sbkeQpqoAXt7E4WcNTBEK3sn4CGp67HRBJRQsqXFfsXB5 + hex!["2f6a032ba0dbdcac7fa68607533971ba399a9a06002978b4c071f87334d153b0"].unchecked_into(), + // 5D8sbkeQpqoAXt7E4WcNTBEK3sn4CGp67HRBJRQsqXFfsXB5 + hex!["2f6a032ba0dbdcac7fa68607533971ba399a9a06002978b4c071f87334d153b0"].unchecked_into(), + ), + ( + // 5ECSwHL89ShGsfBt34HyjCHK7gkd6vGT5A4gTa5yd4mKPhYe + hex!["5e603412d1c84d56f590423a78050aebd3ec34e6d3bc775ca87d19216eb91911"].into(), + // 5C7rVE4qA7GvruqzHjc9RYnoNBP5hbCCKqpEjCm5KEmfvHir + hex!["0266c9d3e063215ef8f35fc87ccd50489b3c6a2356aac39f89d0667145fab16b"].into(), + // 5GCJ3HKN5MaseCwqwNJ4pUbpJqRbfAmZXWB8SCMJM6FMyM9B + hex!["b6bab8caa7be249400b5062d17908c59c0e40dcbe2bd1c818098a5dae916a869"].unchecked_into(), + // 5HPtGdWoRmiReRYE16AQitm4MG8s47ngfHLGUeKHZuo1Cdry + hex!["ebcde238597379c874dd51fcca5e0f651972b218c46aa21c471167474e089c86"].unchecked_into(), + // 5HPtGdWoRmiReRYE16AQitm4MG8s47ngfHLGUeKHZuo1Cdry + hex!["ebcde238597379c874dd51fcca5e0f651972b218c46aa21c471167474e089c86"].unchecked_into(), + // 5HPtGdWoRmiReRYE16AQitm4MG8s47ngfHLGUeKHZuo1Cdry + hex!["ebcde238597379c874dd51fcca5e0f651972b218c46aa21c471167474e089c86"].unchecked_into(), + ), + ( + // 5GH23iTUJtvz9KGDK36nXWHtrkm6E83ZZjVPFhb8DKQk3cv3 + hex!["ba551cfbf9e91da337f21658276dfbd56ba43be852395db10a89a64e07978f31"].into(), + // 5HQwfPfmbuWt3fKyEK3SSuDneVtF4MwHbK1afsXPHxAfogyj + hex!["ec9c8c8d80eab0b1fc4733e25af31137fb656390c595bb1c7536f73b201ede57"].into(), + // 5GokhX8Ce1VrMaWFt5RMdAq2EkzoBxdUerFoMzRLDYNPyS2M + hex!["d1c60ddadc9a3f65da208c5c50e7fc9ed0ab069e79553d08dcc36a401948fa1a"].unchecked_into(), + // 5Ec2hh96mXEavdu2C866hgUC4joBYpBVujXQJgQsDWfUMmM1 + hex!["705c8360296c7b6af2f842e7a0804492c86a855aaa605fdf419f577f1f4fecbe"].unchecked_into(), + // 5Ec2hh96mXEavdu2C866hgUC4joBYpBVujXQJgQsDWfUMmM1 + hex!["705c8360296c7b6af2f842e7a0804492c86a855aaa605fdf419f577f1f4fecbe"].unchecked_into(), + // 5Ec2hh96mXEavdu2C866hgUC4joBYpBVujXQJgQsDWfUMmM1 + hex!["705c8360296c7b6af2f842e7a0804492c86a855aaa605fdf419f577f1f4fecbe"].unchecked_into(), + ), + ]; } /// Testnet root key @@ -135,97 +159,134 @@ pub fn get_testnet_election_members() -> Vec { hex!["72195640f79f8254ce35db3b5d0b17c0243b0fb4489fa4b04688ed121ba22603"].into(), hex!["80d5673f528ec827a9a1ed4bb5b47b737e9dffae3e62e95e104b4f1afc52ec68"].into(), hex!["9878e771c7637945322a46ec58ab59ee62d0a308fc38335cbdd98c50fd0fdc41"].into(), - ]; } /// MTestnet bootnodes (network compatible from Edgeware mainnet launch) pub fn get_mtestnet_bootnodes() -> Vec { return vec![ - "/ip4/45.77.148.197/tcp/30333/p2p/QmUeUUGWMthMvmqKVRPKdXsuDMynCQfmZ7sjVMvce9VU7V".parse().unwrap(), - "/ip4/45.77.106.16/tcp/30333/p2p/QmcfVBingGpGxZX34KW5JNmknTvPXPP5n6yV6VC9sLot4o".parse().unwrap(), - "/ip4/207.148.19.178/tcp/30333/p2p/QmZFSZSkT5EjPFtocrFmm4qxfnzuz5gen21mNLM4gZ3ETs".parse().unwrap(), - "/ip4/45.63.20.50/tcp/30333/p2p/QmWuqHRV2FRaGpDW4TYYhwEeUut8Tqurwh5Nx4xWCMhPZq".parse().unwrap(), - "/ip4/108.61.132.86/tcp/30333/p2p/Qma1a5Wqn8XrVabVkvg5RW7fUQqJrjZoajTMb4wXFBY8ko".parse().unwrap(), - "/ip4/8.9.37.163/tcp/30333/p2p/QmbZspwqedBb9khWRM7vEeub7CoYcqzGLUg3ZGt2EXVexf".parse().unwrap(), - "/ip4/149.28.224.192/tcp/30333/p2p/QmTTmfPicKr3qRSbfKCA8UJShD6HMVCt6KVwGhBwJ4X9Bx".parse().unwrap(), - "/ip4/45.76.7.184/tcp/30333/p2p/Qmb94o15MrsVSXoL2914duanHzWN4kSyg3cUaRptuKeCQz".parse().unwrap(), - "/ip4/45.63.23.125/tcp/30333/p2p/QmNvjhhpJdJfcaPRk3EyWN9jxuufNWBEPDCJSzF7ViQdYK".parse().unwrap(), - "/ip4/96.30.192.15/tcp/30333/p2p/QmS3Qi9QbVVdvFp6wtFoMqyKYRSoAWswheyLqWp6vAFDph".parse().unwrap(), + "/ip4/45.77.148.197/tcp/30333/p2p/QmUeUUGWMthMvmqKVRPKdXsuDMynCQfmZ7sjVMvce9VU7V" + .parse() + .unwrap(), + "/ip4/45.77.106.16/tcp/30333/p2p/QmcfVBingGpGxZX34KW5JNmknTvPXPP5n6yV6VC9sLot4o" + .parse() + .unwrap(), + "/ip4/207.148.19.178/tcp/30333/p2p/QmZFSZSkT5EjPFtocrFmm4qxfnzuz5gen21mNLM4gZ3ETs" + .parse() + .unwrap(), + "/ip4/45.63.20.50/tcp/30333/p2p/QmWuqHRV2FRaGpDW4TYYhwEeUut8Tqurwh5Nx4xWCMhPZq" + .parse() + .unwrap(), + "/ip4/108.61.132.86/tcp/30333/p2p/Qma1a5Wqn8XrVabVkvg5RW7fUQqJrjZoajTMb4wXFBY8ko" + .parse() + .unwrap(), + "/ip4/8.9.37.163/tcp/30333/p2p/QmbZspwqedBb9khWRM7vEeub7CoYcqzGLUg3ZGt2EXVexf" + .parse() + .unwrap(), + "/ip4/149.28.224.192/tcp/30333/p2p/QmTTmfPicKr3qRSbfKCA8UJShD6HMVCt6KVwGhBwJ4X9Bx" + .parse() + .unwrap(), + "/ip4/45.76.7.184/tcp/30333/p2p/Qmb94o15MrsVSXoL2914duanHzWN4kSyg3cUaRptuKeCQz" + .parse() + .unwrap(), + "/ip4/45.63.23.125/tcp/30333/p2p/QmNvjhhpJdJfcaPRk3EyWN9jxuufNWBEPDCJSzF7ViQdYK" + .parse() + .unwrap(), + "/ip4/96.30.192.15/tcp/30333/p2p/QmS3Qi9QbVVdvFp6wtFoMqyKYRSoAWswheyLqWp6vAFDph" + .parse() + .unwrap(), ]; } /// Testnet initial authorities -pub fn get_mtestnet_initial_authorities() -> Vec<(AccountId, AccountId, GrandpaId, AuraId, ImOnlineId, AuthorityDiscoveryId)> { - return vec![( - hex!["d0403d32c41576b2f58c91792913e32ef36549ea8668638f2803ba9021a5c540"].into(), - hex!["04fc990505c36a1725eba235594c852b8591553e2f0ff00ffc31fc47a000a564"].into(), - hex!["80a875dda00106ee48795b3f58fea60e297dce90ae8de099a767e83e37a24867"].unchecked_into(), - hex!["929ff8381a23b32cbc97c789fce25b4023c521e3ef1d440d787ef1fa0924fc4f"].unchecked_into(), - hex!["6d5dd00530489bddd02540f95c51b7e755442dd9ec44bb8c0abbcf4fe9efb99a"].unchecked_into(), - hex!["ae5725899c7bf38ee0a7676af1f9d68bd4f24c92b1311a646fa821cdd51ab92e"].unchecked_into(), - ),( - hex!["be75eba0978208a501c32f13ac9533c623bccaad0e4357c76fc02f872559762e"].into(), - hex!["7655af5c8313bc9e53c4100be0ac5fe00b028f60bb690cae9b5b6c1a1d489043"].into(), - hex!["43970f5535a774e1eaac7a92cf58a0038f424422d9d8fb9cb0ee73497a706cec"].unchecked_into(), - hex!["e6cd805c1380cd03598b32e45537148190931913ec37c303196e2fd65fabe7f1"].unchecked_into(), - hex!["aa8971133ee02484eabe74996452dbdca2b933431dfe19d51709c3c1d887648b"].unchecked_into(), - hex!["90fea7ba6bb163d884dbdd8b2ba5b22113189c1d4944b939294b28e662ab4f17"].unchecked_into(), - ), ( - hex!["9cb2224f01ded140fd6ff494dc106c82715697bc83c4c6f33d58f0b3274fc214"].into(), - hex!["a2f39001e9c1dec6824d7dc7f9f4ff05e967b1dea9c884e19261c487eaeda819"].into(), - hex!["7415b2ea8dd54a86dc035bfca42e844920192614e8db17a4118f7eb3606322db"].unchecked_into(), - hex!["e37cefbd9712a8848b355cd57ca23ac129a4d66de15bc476ce33fe65e6b11777"].unchecked_into(), - hex!["0883d53c64d360d43b29619f11046a51ae0ab10e1a057851e00e77f6f9043b71"].unchecked_into(), - hex!["9e5f5ce86bddce022c7fa7d11052117526f39fa8b9306b46a6a87e725e5f3110"].unchecked_into(), - ), ( - hex!["d606367a017eed18e1c179dda9eecad1bb6bfbd901ab8bb809e4a7701394c54d"].into(), - hex!["e2b32900704016d9d9375e5b673a22afa481e865e0fbc1129d3e409f7dbc8e30"].into(), - hex!["6d12ec818ed65ac5fc3e46c1e4421b7af8f61098dbfc35fed2e37a7d2946d5a3"].unchecked_into(), - hex!["ae250307973a96b368f1d4fef704dd8a0beb95e16b5363af5bb65e8d9de401cc"].unchecked_into(), - hex!["afb6f2137d72a5c2511858bc06309918dc3fd3ab33503de10067681973755f9e"].unchecked_into(), - hex!["94fec49b0b244e2bef6f0c9c4cb4c02c3b055362739bc5d4e54e7fd0525b4d04"].unchecked_into(), - ), ( - hex!["56a031ff9c856c605d5ef165145c7055fa5d4a236b0de3367c51ab3b6aa93a71"].into(), - hex!["d6d19faba8eb8c42c21287da2805d820b74efa60bc2703ea8e5246c84766c54d"].into(), - hex!["3b994d10cd1e052546097ae8a41cad1b2441b471f2de7917425dbe84e34160ea"].unchecked_into(), - hex!["d33194e2bd13b3361ebeeb5a385a9471ec9212ae7bd5220b5b68b98535cafc09"].unchecked_into(), - hex!["632a979cc1a2608bced771160eed35129ed9372e3bfa04632f8189dc32aae57d"].unchecked_into(), - hex!["2ed5510d149e2de79bd6fdb9fe8688261b0931a173addd96f40e9c0877cae306"].unchecked_into(), - ), ( - hex!["dcfa10872cbdc30efa5a5cc14612084044c35f367ddd1ed8af5d80958ec84910"].into(), - hex!["3ade1880c7a80eadf40fe81ced4ab4d1b1cf0560d691f896352e36a756846942"].into(), - hex!["4205907674a7341551348a16cab18383fa7207c033637df2466317c0aca4876b"].unchecked_into(), - hex!["6291c8f876525a3eee31d387bd55b1b4fd82a722e4006a54de404f956073c591"].unchecked_into(), - hex!["3ad6d8c9a8626eff2df6f455976db799b0f1d4524eb00b11768a8513422dc864"].unchecked_into(), - hex!["12e5b5d715ac0b6dc3f0b2e6f1fb2dee57e8b595bbbd621020ea63ce038aa94c"].unchecked_into(), - ), ( - hex!["e48f98d4bbcafbdd0c4684c4606a2c584abc35d0e186ab8d045aeceabe1c6c4b"].into(), - hex!["5247cdd57825d2bd7922c582c7c073e97387083a4a5cd0d1ea095fa20ac8393a"].into(), - hex!["b750fafb7f16e02617b58c2c4a8fc94fff3934bbd5361a78c4f0c9d4e688b3e0"].unchecked_into(), - hex!["7155fcc6466f89e331c174c656258ac9701ca4290e0fd06383e61336bbc18b1a"].unchecked_into(), - hex!["2727f5f65caab717de55fcff8871e51951391bd15f46f74404479ffbd155fb51"].unchecked_into(), - hex!["705277403dcdb765fd68b6a0db71ade446189f5b1e047be6228af51a6fa39c34"].unchecked_into(), - ), ( - hex!["186a149dbd823f37a1d98cc55f61ad06832e2154b48457cc5cb80452014aff5c"].into(), - hex!["24f65879dee07a7a91ada9e8a024824c5b32af27687d796e40eeb0ca666eef6a"].into(), - hex!["1da90a0ef8a500510e68ab4713837ac0da1b05b38538fd20a157e3bb5b1d6603"].unchecked_into(), - hex!["9fd89819442f21949c3f5915dbe961219de42e32947c47669d89fb8b26e5360c"].unchecked_into(), - hex!["614f8583a6006053ea5529331c3d92603e716398311e899d9137b4c26b70a826"].unchecked_into(), - hex!["3aec8b7baf0e520fc91b73e8e78d69ce4232bb23ed08def718dd040a396b7712"].unchecked_into(), - ), ( - hex!["9834b2fa930a67ccdab7dbbfb4fcf74416f0fc8c5658f67fe2e3feccf553566d"].into(), - hex!["86347d327bd5991a471c0eee25a7dab54bf4f441e4aed1ca59f41efae5eaa128"].into(), - hex!["ba7b5b18baa2fcf8b0aa3f1923a417ffefd3c909005ce530a37fb42abeb3bbb4"].unchecked_into(), - hex!["4f119bac5db308398feaaba7f16c25cbe26f6bb99b1a72b04d4ebb649d6151dc"].unchecked_into(), - hex!["f620a289821496f9ffdca490a5a457da493ebadde242fea7a38b4fd1340040a2"].unchecked_into(), - hex!["a4a20f07d64813595efe5fe6f31627d7386e3673f380b9a1f319b3c168573717"].unchecked_into(), - ), ( - hex!["92c8abefa9fe6c8ee91acea87143436e44095f8252630c175feefdb18e3fb73c"].into(), - hex!["3279738232083ef63a8f7005916b677aac0efca0d71a9d26cce613b2f58f6d23"].into(), - hex!["66317ac47aae3c8e8fcdecee852a968be931a89bd9a146d9bb16b345d98b6d1d"].unchecked_into(), - hex!["64838c72edccba1a0d3ec703a123257e442a82380e8403a316cbdb90123138a4"].unchecked_into(), - hex!["f1a07551ad066eebd0193cf55e619836dce1dbb9dfda2d9405072eac9031bf9f"].unchecked_into(), - hex!["a245ab29c25d4e12af0c91bc65f6c72d6ab9b834acd4364576362575077bbd37"].unchecked_into(), - )]; -} \ No newline at end of file +pub fn get_mtestnet_initial_authorities() -> Vec<( + AccountId, + AccountId, + GrandpaId, + AuraId, + ImOnlineId, + AuthorityDiscoveryId, +)> { + return vec![ + ( + hex!["d0403d32c41576b2f58c91792913e32ef36549ea8668638f2803ba9021a5c540"].into(), + hex!["04fc990505c36a1725eba235594c852b8591553e2f0ff00ffc31fc47a000a564"].into(), + hex!["80a875dda00106ee48795b3f58fea60e297dce90ae8de099a767e83e37a24867"].unchecked_into(), + hex!["929ff8381a23b32cbc97c789fce25b4023c521e3ef1d440d787ef1fa0924fc4f"].unchecked_into(), + hex!["6d5dd00530489bddd02540f95c51b7e755442dd9ec44bb8c0abbcf4fe9efb99a"].unchecked_into(), + hex!["ae5725899c7bf38ee0a7676af1f9d68bd4f24c92b1311a646fa821cdd51ab92e"].unchecked_into(), + ), + ( + hex!["be75eba0978208a501c32f13ac9533c623bccaad0e4357c76fc02f872559762e"].into(), + hex!["7655af5c8313bc9e53c4100be0ac5fe00b028f60bb690cae9b5b6c1a1d489043"].into(), + hex!["43970f5535a774e1eaac7a92cf58a0038f424422d9d8fb9cb0ee73497a706cec"].unchecked_into(), + hex!["e6cd805c1380cd03598b32e45537148190931913ec37c303196e2fd65fabe7f1"].unchecked_into(), + hex!["aa8971133ee02484eabe74996452dbdca2b933431dfe19d51709c3c1d887648b"].unchecked_into(), + hex!["90fea7ba6bb163d884dbdd8b2ba5b22113189c1d4944b939294b28e662ab4f17"].unchecked_into(), + ), + ( + hex!["9cb2224f01ded140fd6ff494dc106c82715697bc83c4c6f33d58f0b3274fc214"].into(), + hex!["a2f39001e9c1dec6824d7dc7f9f4ff05e967b1dea9c884e19261c487eaeda819"].into(), + hex!["7415b2ea8dd54a86dc035bfca42e844920192614e8db17a4118f7eb3606322db"].unchecked_into(), + hex!["e37cefbd9712a8848b355cd57ca23ac129a4d66de15bc476ce33fe65e6b11777"].unchecked_into(), + hex!["0883d53c64d360d43b29619f11046a51ae0ab10e1a057851e00e77f6f9043b71"].unchecked_into(), + hex!["9e5f5ce86bddce022c7fa7d11052117526f39fa8b9306b46a6a87e725e5f3110"].unchecked_into(), + ), + ( + hex!["d606367a017eed18e1c179dda9eecad1bb6bfbd901ab8bb809e4a7701394c54d"].into(), + hex!["e2b32900704016d9d9375e5b673a22afa481e865e0fbc1129d3e409f7dbc8e30"].into(), + hex!["6d12ec818ed65ac5fc3e46c1e4421b7af8f61098dbfc35fed2e37a7d2946d5a3"].unchecked_into(), + hex!["ae250307973a96b368f1d4fef704dd8a0beb95e16b5363af5bb65e8d9de401cc"].unchecked_into(), + hex!["afb6f2137d72a5c2511858bc06309918dc3fd3ab33503de10067681973755f9e"].unchecked_into(), + hex!["94fec49b0b244e2bef6f0c9c4cb4c02c3b055362739bc5d4e54e7fd0525b4d04"].unchecked_into(), + ), + ( + hex!["56a031ff9c856c605d5ef165145c7055fa5d4a236b0de3367c51ab3b6aa93a71"].into(), + hex!["d6d19faba8eb8c42c21287da2805d820b74efa60bc2703ea8e5246c84766c54d"].into(), + hex!["3b994d10cd1e052546097ae8a41cad1b2441b471f2de7917425dbe84e34160ea"].unchecked_into(), + hex!["d33194e2bd13b3361ebeeb5a385a9471ec9212ae7bd5220b5b68b98535cafc09"].unchecked_into(), + hex!["632a979cc1a2608bced771160eed35129ed9372e3bfa04632f8189dc32aae57d"].unchecked_into(), + hex!["2ed5510d149e2de79bd6fdb9fe8688261b0931a173addd96f40e9c0877cae306"].unchecked_into(), + ), + ( + hex!["dcfa10872cbdc30efa5a5cc14612084044c35f367ddd1ed8af5d80958ec84910"].into(), + hex!["3ade1880c7a80eadf40fe81ced4ab4d1b1cf0560d691f896352e36a756846942"].into(), + hex!["4205907674a7341551348a16cab18383fa7207c033637df2466317c0aca4876b"].unchecked_into(), + hex!["6291c8f876525a3eee31d387bd55b1b4fd82a722e4006a54de404f956073c591"].unchecked_into(), + hex!["3ad6d8c9a8626eff2df6f455976db799b0f1d4524eb00b11768a8513422dc864"].unchecked_into(), + hex!["12e5b5d715ac0b6dc3f0b2e6f1fb2dee57e8b595bbbd621020ea63ce038aa94c"].unchecked_into(), + ), + ( + hex!["e48f98d4bbcafbdd0c4684c4606a2c584abc35d0e186ab8d045aeceabe1c6c4b"].into(), + hex!["5247cdd57825d2bd7922c582c7c073e97387083a4a5cd0d1ea095fa20ac8393a"].into(), + hex!["b750fafb7f16e02617b58c2c4a8fc94fff3934bbd5361a78c4f0c9d4e688b3e0"].unchecked_into(), + hex!["7155fcc6466f89e331c174c656258ac9701ca4290e0fd06383e61336bbc18b1a"].unchecked_into(), + hex!["2727f5f65caab717de55fcff8871e51951391bd15f46f74404479ffbd155fb51"].unchecked_into(), + hex!["705277403dcdb765fd68b6a0db71ade446189f5b1e047be6228af51a6fa39c34"].unchecked_into(), + ), + ( + hex!["186a149dbd823f37a1d98cc55f61ad06832e2154b48457cc5cb80452014aff5c"].into(), + hex!["24f65879dee07a7a91ada9e8a024824c5b32af27687d796e40eeb0ca666eef6a"].into(), + hex!["1da90a0ef8a500510e68ab4713837ac0da1b05b38538fd20a157e3bb5b1d6603"].unchecked_into(), + hex!["9fd89819442f21949c3f5915dbe961219de42e32947c47669d89fb8b26e5360c"].unchecked_into(), + hex!["614f8583a6006053ea5529331c3d92603e716398311e899d9137b4c26b70a826"].unchecked_into(), + hex!["3aec8b7baf0e520fc91b73e8e78d69ce4232bb23ed08def718dd040a396b7712"].unchecked_into(), + ), + ( + hex!["9834b2fa930a67ccdab7dbbfb4fcf74416f0fc8c5658f67fe2e3feccf553566d"].into(), + hex!["86347d327bd5991a471c0eee25a7dab54bf4f441e4aed1ca59f41efae5eaa128"].into(), + hex!["ba7b5b18baa2fcf8b0aa3f1923a417ffefd3c909005ce530a37fb42abeb3bbb4"].unchecked_into(), + hex!["4f119bac5db308398feaaba7f16c25cbe26f6bb99b1a72b04d4ebb649d6151dc"].unchecked_into(), + hex!["f620a289821496f9ffdca490a5a457da493ebadde242fea7a38b4fd1340040a2"].unchecked_into(), + hex!["a4a20f07d64813595efe5fe6f31627d7386e3673f380b9a1f319b3c168573717"].unchecked_into(), + ), + ( + hex!["92c8abefa9fe6c8ee91acea87143436e44095f8252630c175feefdb18e3fb73c"].into(), + hex!["3279738232083ef63a8f7005916b677aac0efca0d71a9d26cce613b2f58f6d23"].into(), + hex!["66317ac47aae3c8e8fcdecee852a968be931a89bd9a146d9bb16b345d98b6d1d"].unchecked_into(), + hex!["64838c72edccba1a0d3ec703a123257e442a82380e8403a316cbdb90123138a4"].unchecked_into(), + hex!["f1a07551ad066eebd0193cf55e619836dce1dbb9dfda2d9405072eac9031bf9f"].unchecked_into(), + hex!["a245ab29c25d4e12af0c91bc65f6c72d6ab9b834acd4364576362575077bbd37"].unchecked_into(), + ), + ]; +} diff --git a/node/debug/Cargo.toml b/node/debug/Cargo.toml new file mode 100644 index 00000000..ab0201f1 --- /dev/null +++ b/node/debug/Cargo.toml @@ -0,0 +1,39 @@ +[package] +name = "edgeware-rpc-primitives-debug" +version = '0.1.0' +authors = ['PureStake'] +edition = '2018' +homepage = 'https://edgewa.re' +license = 'GPL-3.0-only' +repository = 'https://github.com/PureStake/moonbeam/' + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } +ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] } +ethereum-types = { version = "0.11.0", default-features = false } +sp-runtime = { version = "3.0", default-features = false } +sp-api = { version = "*", default-features = false } +sp-io = { version = "*", default-features = false } +sp-std = { version = "*", default-features = false } +sp-core = { version = "*", default-features = false } +serde = { version = "1.0", features = ["derive"], optional = true } +serde_json = { version = "1.0", optional = true } +hex = { version = "0.4", features = ["serde"], optional = true} + +[features] +default = ["std"] +std = [ + "codec/std", + "sp-api/std", + "sp-runtime/std", + "sp-io/std", + "sp-std/std", + "sp-core/std", + "ethereum/std", + "ethereum-types/std", + "serde", + "serde_json", + "hex" +] diff --git a/node/debug/src/block.rs b/node/debug/src/block.rs new file mode 100644 index 00000000..e3216901 --- /dev/null +++ b/node/debug/src/block.rs @@ -0,0 +1,106 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +//! Types for the tracing of a all Ethereum transactions of a block. + +#[cfg(feature = "std")] +use crate::serialization::*; +#[cfg(feature = "std")] +use serde::Serialize; + +use codec::{Decode, Encode}; +use ethereum_types::{H160, H256, U256}; +use sp_std::vec::Vec; + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +pub struct TransactionTrace { + #[cfg_attr(feature = "std", serde(flatten))] + pub action: TransactionTraceAction, + #[cfg_attr(feature = "std", serde(serialize_with = "h256_0x_serialize"))] + pub block_hash: H256, + pub block_number: u32, + #[cfg_attr(feature = "std", serde(flatten))] + pub output: TransactionTraceOutput, + pub subtraces: u32, + pub trace_address: Vec, + #[cfg_attr(feature = "std", serde(serialize_with = "h256_0x_serialize"))] + pub transaction_hash: H256, + pub transaction_position: u32, +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr( + feature = "std", + serde(rename_all = "camelCase", tag = "type", content = "action") +)] +pub enum TransactionTraceAction { + #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] + Call { + call_type: super::CallType, + from: H160, + gas: U256, + #[cfg_attr(feature = "std", serde(serialize_with = "bytes_0x_serialize"))] + input: Vec, + to: H160, + value: U256, + }, + #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] + Create { + creation_method: super::CreateType, + from: H160, + gas: U256, + #[cfg_attr(feature = "std", serde(serialize_with = "bytes_0x_serialize"))] + init: Vec, + value: U256, + }, + #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] + Suicide { + address: H160, + balance: U256, + refund_address: H160, + }, +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +pub enum TransactionTraceOutput { + Result(TransactionTraceResult), + Error(#[cfg_attr(feature = "std", serde(serialize_with = "string_serialize"))] Vec), +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase", untagged))] +pub enum TransactionTraceResult { + #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] + Call { + gas_used: U256, + #[cfg_attr(feature = "std", serde(serialize_with = "bytes_0x_serialize"))] + output: Vec, + }, + #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] + Create { + address: H160, + #[cfg_attr(feature = "std", serde(serialize_with = "bytes_0x_serialize"))] + code: Vec, + gas_used: U256, + }, + Suicide, +} diff --git a/node/debug/src/lib.rs b/node/debug/src/lib.rs new file mode 100644 index 00000000..a704f90d --- /dev/null +++ b/node/debug/src/lib.rs @@ -0,0 +1,93 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] + +use codec::{Decode, Encode}; +use ethereum::Transaction; +use ethereum_types::H160; +use sp_std::vec::Vec; + +#[cfg(feature = "std")] +use serde::Serialize; + +sp_api::decl_runtime_apis! { + pub trait DebugRuntimeApi { + fn trace_transaction( + extrinsics: Vec, + transaction: &Transaction, + trace_type: single::TraceType, + ) -> Result; + + fn trace_block( + extrinsics: Vec, + ) -> Result, sp_runtime::DispatchError>; + } +} + +// These functions are quite usefull, shoud it be moved into its own crate ? +#[cfg(feature = "std")] +pub mod serialization; +#[cfg(feature = "std")] +use crate::serialization::*; + +pub mod block; +pub mod single; + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +pub enum CallResult { + Output(#[cfg_attr(feature = "std", serde(serialize_with = "bytes_0x_serialize"))] Vec), + // field "error" + Error(#[cfg_attr(feature = "std", serde(serialize_with = "string_serialize"))] Vec), +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase", untagged))] +pub enum CreateResult { + Error { + #[cfg_attr(feature = "std", serde(serialize_with = "string_serialize"))] + error: Vec, + }, + Success { + #[cfg_attr(feature = "std", serde(rename = "createdContractAddressHash"))] + created_contract_address_hash: H160, + #[cfg_attr( + feature = "std", + serde(serialize_with = "bytes_0x_serialize", rename = "createdContractCode") + )] + created_contract_code: Vec, + }, +} + +#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "lowercase"))] +pub enum CallType { + Call, + CallCode, + DelegateCall, + StaticCall, +} + +#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "lowercase"))] +pub enum CreateType { + Create, +} diff --git a/node/debug/src/serialization.rs b/node/debug/src/serialization.rs new file mode 100644 index 00000000..8b23c2c1 --- /dev/null +++ b/node/debug/src/serialization.rs @@ -0,0 +1,83 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +//! Provide serialization functions for various types and formats. + +use ethereum_types::{H256, U256}; +use serde::{ + ser::{Error, SerializeSeq}, + Serializer, +}; + +pub fn seq_h256_serialize(data: &Option>, serializer: S) -> Result +where + S: Serializer, +{ + let d = data.clone().unwrap(); + let mut seq = serializer.serialize_seq(Some(d.len()))?; + for h in d { + seq.serialize_element(&format!("{:x}", h))?; + } + seq.end() +} + +pub fn bytes_0x_serialize(bytes: &[u8], serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("0x{}", hex::encode(bytes))) +} + +pub fn opcode_serialize(opcode: &[u8], serializer: S) -> Result +where + S: Serializer, +{ + let d = std::str::from_utf8(opcode) + .map_err(|_| S::Error::custom("Opcode serialize error."))? + .to_uppercase(); + serializer.serialize_str(&d) +} + +pub fn string_serialize(value: &[u8], serializer: S) -> Result +where + S: Serializer, +{ + let d = std::str::from_utf8(value) + .map_err(|_| S::Error::custom("String serialize error."))? + .to_string(); + serializer.serialize_str(&d) +} + +pub fn u256_serialize(data: &U256, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_u64(data.low_u64()) +} + +pub fn h256_serialize(data: &H256, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("{:x}", data)) +} + +pub fn h256_0x_serialize(data: &H256, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("0x{:x}", data)) +} diff --git a/node/debug/src/single.rs b/node/debug/src/single.rs new file mode 100644 index 00000000..de2650a5 --- /dev/null +++ b/node/debug/src/single.rs @@ -0,0 +1,155 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +//! Types for the tracing of a single Ethereum transaction. +//! Structure from "raw" debug_trace and a "call list" matching +//! Blockscout formatter. This "call list" is also used to build +//! the whole block tracing output. + +#[cfg(feature = "std")] +use crate::serialization::*; +#[cfg(feature = "std")] +use serde::Serialize; + +use codec::{Decode, Encode}; +use ethereum_types::{H160, H256, U256}; +use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; + +#[derive(Clone, Copy, Eq, PartialEq, Debug, Encode, Decode)] +pub enum TraceType { + /// Classic geth with no javascript based tracing. + Raw { + disable_storage: bool, + disable_memory: bool, + disable_stack: bool, + }, + /// List of calls and subcalls (output Blockscout expects). + CallList, +} + +/// Single transaction trace. +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase", untagged))] +pub enum TransactionTrace { + /// Classical output of `debug_trace`. + #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] + Raw { + gas: U256, + #[cfg_attr(feature = "std", serde(with = "hex"))] + return_value: Vec, + step_logs: Vec, + }, + /// Matches the formatter used by Blockscout. + /// Is also used to built output of OpenEthereum's `trace_filter`. + CallList(Vec), +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +pub struct RawStepLog { + #[cfg_attr(feature = "std", serde(serialize_with = "u256_serialize"))] + pub depth: U256, + + //error: TODO + #[cfg_attr(feature = "std", serde(serialize_with = "u256_serialize"))] + pub gas: U256, + + #[cfg_attr(feature = "std", serde(serialize_with = "u256_serialize"))] + pub gas_cost: U256, + + #[cfg_attr( + feature = "std", + serde( + serialize_with = "seq_h256_serialize", + skip_serializing_if = "Option::is_none" + ) + )] + pub memory: Option>, + + #[cfg_attr(feature = "std", serde(serialize_with = "opcode_serialize"))] + pub op: Vec, + + #[cfg_attr(feature = "std", serde(serialize_with = "u256_serialize"))] + pub pc: U256, + + #[cfg_attr( + feature = "std", + serde( + serialize_with = "seq_h256_serialize", + skip_serializing_if = "Option::is_none" + ) + )] + pub stack: Option>, + + #[cfg_attr(feature = "std", serde(skip_serializing_if = "Option::is_none"))] + pub storage: Option>, +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase", tag = "type"))] +pub enum CallInner { + #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] + Call { + /// Type of call. + call_type: crate::CallType, + to: H160, + #[cfg_attr(feature = "std", serde(serialize_with = "bytes_0x_serialize"))] + input: Vec, + /// "output" or "error" field + #[cfg_attr(feature = "std", serde(flatten))] + res: crate::CallResult, + }, + + #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] + Create { + #[cfg_attr(feature = "std", serde(serialize_with = "bytes_0x_serialize"))] + init: Vec, + #[cfg_attr(feature = "std", serde(flatten))] + res: crate::CreateResult, + }, + // Revert, + SelfDestruct { + #[cfg_attr(feature = "std", serde(skip))] + balance: U256, + #[cfg_attr(feature = "std", serde(skip))] + refund_address: H160, + }, +} + +#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +pub struct Call { + pub from: H160, + /// Indices of parent calls. + pub trace_address: Vec, + /// Number of children calls. + /// Not needed for Blockscout, but needed for `crate::block` + /// types that are build from this type. + #[cfg_attr(feature = "std", serde(skip))] + pub subtraces: u32, + /// Sends funds to the (payable) function + pub value: U256, + /// Remaining gas in the runtime. + pub gas: U256, + /// Gas used by this context. + pub gas_used: U256, + #[cfg_attr(feature = "std", serde(flatten))] + pub inner: CallInner, +} diff --git a/node/evm_tracer/Cargo.toml b/node/evm_tracer/Cargo.toml new file mode 100644 index 00000000..106d3b15 --- /dev/null +++ b/node/evm_tracer/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "edgeware-evm-tracer" +version = '0.1.0' +authors = ['PureStake'] +edition = '2018' +homepage = 'https://edgewa.re' +license = 'GPL-3.0-only' +repository = 'https://github.com/PureStake/moonbeam/' + +[dependencies] +fp-evm = { git = "https://github.com/webb-tools/frontier", default-features = false, branch = "erup-4-minimal-changes" } +pallet-evm = { git = "https://github.com/webb-tools/frontier", default-features = false, branch = "erup-4-minimal-changes" } +evm = { version = "0.27.0", default-features = false, features = ["with-codec", "tracing"] } +evm-runtime = { version = "0.27.0", default-features = false, features = ["tracing"] } +evm-gasometer = { version = "0.27.0", default-features = false, features = ["tracing"] } +sp-core = { version = "3.0", default-features = false } +sp-std = { version = "3.0", default-features = false } +sp-io = { version = "3.0", default-features = false } +sp-runtime = { version = "3.0", default-features = false } +edgeware-rpc-primitives-debug = { path = "../debug", default-features = false } +ethereum-types = { version = "0.11.0", default-features = false } + +[features] +default = ["std"] +std = [ + "evm/std", + "evm-runtime/std", + "evm-gasometer/std", + "evm/with-serde", + "pallet-evm/std", + "sp-core/std", + "sp-std/std", + "sp-runtime/std", + "ethereum-types/std", + "fp-evm/std", + "edgeware-rpc-primitives-debug/std", +] diff --git a/node/evm_tracer/src/call_list.rs b/node/evm_tracer/src/call_list.rs new file mode 100644 index 00000000..b7e3cdd5 --- /dev/null +++ b/node/evm_tracer/src/call_list.rs @@ -0,0 +1,379 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +use crate::util::*; +use ethereum_types::{H160, U256}; +use evm::{Capture, ExitError, ExitReason, ExitSucceed}; +use edgeware_rpc_primitives_debug::{ + single::{Call, CallInner, TransactionTrace}, + CallResult, CallType, CreateResult, +}; +use sp_std::collections::btree_map::BTreeMap; + +/// Listen to EVM events to provide a overview of the internal transactions. +/// It can be used to implement `trace_filter`. +/// +/// # Output example +/// +/// ```json +/// [ +/// { +/// "type": "call", +/// "callType": "call", +/// "from": "0xfe2882ac0a337a976aa73023c2a2a917f57ba2ed", +/// "to": "0x3ca17a1c4995b95c600275e52da93d2e64dd591f", +/// "input": "0x", +/// "output": "0x", +/// "traceAddress": [], +/// "value": "0x0", +/// "gas": "0xf9be", +/// "gasUsed": "0xf9be" +/// }, +/// { +/// "type": "call", +/// "callType": "call", +/// "from": "0x3ca17a1c4995b95c600275e52da93d2e64dd591f", +/// "to": "0x1416aa2a27db08ce3a81a01cdfc981417d28a6e6", +/// "input": "0xfd63983b0000000000000000000000000000000000000000000000000000000000000006", +/// "output": "0x000000000000000000000000000000000000000000000000000000000000000d", +/// "traceAddress": [0], +/// "value": "0x0", +/// "gas": "0x9b9b", +/// "gasUsed": "0x4f6d" +/// } +/// ] +/// ``` +#[derive(Debug)] +pub struct CallListTracer { + // Transaction cost that must be added to the first context cost. + transaction_cost: u64, + + // Final logs. + entries: BTreeMap, + // Next index to use. + entries_next_index: u32, + // Stack of contexts with data to keep between events. + context_stack: Vec, + + // Type of the next call. + // By default is None and corresponds to the root call, which + // can be determined using the `is_static` field of the `Call` event. + // Then by looking at call traps events we can set this value to the correct + // call type, to be used when the following `Call` event is received. + call_type: Option, +} + +#[derive(Debug)] +struct Context { + entries_index: u32, + + context_type: ContextType, + + from: H160, + trace_address: Vec, + subtraces: u32, + value: U256, + + gas: u64, + start_gas: Option, + + // input / data + data: Vec, + // to / create address + to: H160, +} + +impl CallListTracer { + pub fn new() -> Self { + Self { + transaction_cost: 0, + + entries: BTreeMap::new(), + entries_next_index: 0, + + context_stack: vec![], + + call_type: None, + } + } + + /// Setup event listeners and execute provided closure. + /// + /// Consume the tracer and return it alongside the return value of + /// the closure. + pub fn trace R>(self, f: F) -> (Self, R) { + let wrapped = Rc::new(RefCell::new(self)); + + let result = { + let mut gasometer = ListenerProxy(Rc::clone(&wrapped)); + let mut runtime = ListenerProxy(Rc::clone(&wrapped)); + let mut evm = ListenerProxy(Rc::clone(&wrapped)); + + // Each line wraps the previous `f` into a `using` call. + // Listening to new events results in adding one new line. + // Order is irrelevant when registering listeners. + let f = || runtime_using(&mut runtime, f); + let f = || gasometer_using(&mut gasometer, f); + let f = || evm_using(&mut evm, f); + f() + }; + + (Rc::try_unwrap(wrapped).unwrap().into_inner(), result) + } + + pub fn into_tx_trace(self) -> TransactionTrace { + TransactionTrace::CallList(self.entries.into_iter().map(|(_, value)| value).collect()) + } +} + +impl GasometerListener for CallListTracer { + fn event(&mut self, event: GasometerEvent) { + match event { + GasometerEvent::RecordCost { snapshot, .. } + | GasometerEvent::RecordDynamicCost { snapshot, .. } + | GasometerEvent::RecordStipend { snapshot, .. } => { + if let Some(context) = self.context_stack.last_mut() { + if context.start_gas.is_none() { + context.start_gas = Some(snapshot.gas()); + } + context.gas = snapshot.gas(); + } + } + GasometerEvent::RecordTransaction { cost, .. } => self.transaction_cost = cost, + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } +} + +impl RuntimeListener for CallListTracer { + fn event(&mut self, event: RuntimeEvent) { + match event { + RuntimeEvent::StepResult { + result: Err(Capture::Trap(opcode)), + .. + } => { + if let Some(ContextType::Call(call_type)) = ContextType::from(*opcode) { + self.call_type = Some(call_type) + } + } + RuntimeEvent::StepResult { + result: Err(Capture::Exit(reason)), + return_value, + } => { + if let Some(context) = self.context_stack.pop() { + let mut gas_used = context.start_gas.unwrap() - context.gas; + if context.entries_index == 0 { + gas_used += self.transaction_cost; + } + + self.entries.insert( + context.entries_index, + match context.context_type { + ContextType::Call(call_type) => { + let res = match &reason { + ExitReason::Succeed(ExitSucceed::Returned) => { + CallResult::Output(return_value.to_vec()) + } + ExitReason::Succeed(_) => CallResult::Output(vec![]), + ExitReason::Error(error) => { + CallResult::Error(error_message(error)) + } + + ExitReason::Revert(_) => { + CallResult::Error(b"execution reverted".to_vec()) + } + ExitReason::Fatal(_) => CallResult::Error(vec![]), + }; + + Call { + from: context.from, + trace_address: context.trace_address, + subtraces: context.subtraces, + value: context.value, + gas: context.gas.into(), + gas_used: gas_used.into(), + inner: CallInner::Call { + call_type, + to: context.to, + input: context.data, + res, + }, + } + } + ContextType::Create => { + let res = match &reason { + ExitReason::Succeed(_) => CreateResult::Success { + created_contract_address_hash: context.to, + created_contract_code: return_value.to_vec(), + }, + ExitReason::Error(error) => CreateResult::Error { + error: error_message(error), + }, + ExitReason::Revert(_) => CreateResult::Error { + error: b"execution reverted".to_vec(), + }, + ExitReason::Fatal(_) => CreateResult::Error { error: vec![] }, + }; + + Call { + value: context.value, + trace_address: context.trace_address, + subtraces: context.subtraces, + gas: context.gas.into(), + gas_used: gas_used.into(), + from: context.from, + inner: CallInner::Create { + init: context.data, + res, + }, + } + } + }, + ); + } + } + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } +} + +impl EvmListener for CallListTracer { + fn event(&mut self, event: EvmEvent) { + let trace_address = if let Some(context) = self.context_stack.last_mut() { + let mut trace_address = context.trace_address.clone(); + trace_address.push(context.subtraces); + context.subtraces += 1; + trace_address + } else { + vec![] + }; + + match event { + EvmEvent::Call { + // code_address, + // transfer, + input, + // target_gas, + is_static, + context, + .. + } => { + let call_type = match (self.call_type, is_static) { + (None, true) => CallType::StaticCall, + (None, false) => CallType::Call, + (Some(call_type), _) => call_type, + }; + + self.context_stack.push(Context { + entries_index: self.entries_next_index, + + context_type: ContextType::Call(call_type), + + from: context.caller, + trace_address, + subtraces: 0, + value: context.apparent_value, + + gas: 0, + start_gas: None, + + data: input.to_vec(), + to: context.address, + }); + + self.entries_next_index += 1; + } + EvmEvent::Create { + caller, + address, + // scheme, + value, + init_code, + // target_gas, + .. + } => { + self.context_stack.push(Context { + entries_index: self.entries_next_index, + + context_type: ContextType::Create, + + from: caller, + trace_address, + subtraces: 0, + value, + + gas: 0, + start_gas: None, + + data: init_code.to_vec(), + to: address, + }); + + self.entries_next_index += 1; + } + EvmEvent::Suicide { + address, + target, + balance, + } => { + self.entries.insert( + self.entries_next_index, + Call { + from: address, // this contract is self destructing + trace_address, + subtraces: 0, + value: 0.into(), + gas: 0.into(), + gas_used: 0.into(), + inner: CallInner::SelfDestruct { + refund_address: target, + balance, + }, + }, + ); + + self.entries_next_index += 1; + } + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } +} + +fn error_message(error: &ExitError) -> Vec { + match error { + ExitError::StackUnderflow => "stack underflow", + ExitError::StackOverflow => "stack overflow", + ExitError::InvalidJump => "invalid jump", + ExitError::InvalidRange => "invalid range", + ExitError::DesignatedInvalid => "designated invalid", + ExitError::CallTooDeep => "call too deep", + ExitError::CreateCollision => "create collision", + ExitError::CreateContractLimit => "create contract limit", + ExitError::OutOfOffset => "out of offset", + ExitError::OutOfGas => "out of gas", + ExitError::OutOfFund => "out of funds", + ExitError::Other(err) => err, + _ => "unexpected error", + } + .as_bytes() + .to_vec() +} diff --git a/node/evm_tracer/src/lib.rs b/node/evm_tracer/src/lib.rs new file mode 100644 index 00000000..baffd1fa --- /dev/null +++ b/node/evm_tracer/src/lib.rs @@ -0,0 +1,31 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +//! Substrate EVM tracing. +//! +//! The purpose of this crate is enable tracing the EVM opcode execution and will be used by +//! both Dapp developers - to get a granular view on their transactions - and indexers to access +//! the EVM callstack (internal transactions). + +#![cfg_attr(not(feature = "std"), no_std)] + +mod call_list; +mod raw; +mod util; + +pub use call_list::CallListTracer; +pub use raw::RawTracer; +pub use util::EvmListener; diff --git a/node/evm_tracer/src/raw.rs b/node/evm_tracer/src/raw.rs new file mode 100644 index 00000000..a6caf01f --- /dev/null +++ b/node/evm_tracer/src/raw.rs @@ -0,0 +1,328 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +use crate::util::*; + +use ethereum_types::{H160, H256}; +use evm::{Capture, ExitReason}; +use edgeware_rpc_primitives_debug::single::{RawStepLog, TransactionTrace}; +use sp_std::{collections::btree_map::BTreeMap, vec, vec::Vec}; + +/// Listen to EVM events to provide the intermediate machine state between opcode executions +/// (stepping), resulting in a granular per opcode output. +/// +/// # Output example +/// +/// ```json +/// { +/// "pc": 230, +/// "op": "SSTORE", +/// "gas": 62841, +/// "gasCost": 20000, +/// "depth": 1, +/// "stack": [ +/// "00000000000000000000000000000000000000000000000000000000398f7223", +/// ], +/// "memory": [ +/// "0000000000000000000000000000000000000000000000000000000000000000", +/// ], +/// "storage": {"0x":"0x"} +/// } +/// ``` +#[derive(Debug)] +pub struct RawTracer { + disable_storage: bool, + disable_memory: bool, + disable_stack: bool, + + step_logs: Vec, + return_value: Vec, + final_gas: u64, + + new_context: bool, + context_stack: Vec, +} + +#[derive(Debug)] +struct Context { + storage_cache: BTreeMap, + address: H160, + current_step: Option, + global_storage_changes: BTreeMap>, +} + +#[derive(Debug)] +struct Step { + /// Current opcode. + opcode: Opcode, + /// Depth of the context. + depth: usize, + /// Remaining gas. + gas: u64, + /// Gas cost of the following opcode. + gas_cost: u64, + /// Program counter position. + position: usize, + /// EVM memory copy (if not disabled). + memory: Option>, + /// EVM stack copy (if not disabled). + stack: Option>, +} + +impl RawTracer { + pub fn new(disable_storage: bool, disable_memory: bool, disable_stack: bool) -> Self { + Self { + disable_storage, + disable_memory, + disable_stack, + + step_logs: vec![], + return_value: vec![], + final_gas: 0, + + new_context: false, + context_stack: vec![], + } + } + + /// Setup event listeners and execute provided closure. + /// + /// Consume the tracer and return it alongside the return value of + /// the closure. + pub fn trace R>(self, f: F) -> (Self, R) { + let wrapped = Rc::new(RefCell::new(self)); + + let result = { + let mut gasometer = ListenerProxy(Rc::clone(&wrapped)); + let mut runtime = ListenerProxy(Rc::clone(&wrapped)); + + // Each line wraps the previous `f` into a `using` call. + // Listening to new events results in adding one new line. + // Order is irrelevant when registering listeners. + let f = || runtime_using(&mut runtime, f); + let f = || gasometer_using(&mut gasometer, f); + f() + }; + + (Rc::try_unwrap(wrapped).unwrap().into_inner(), result) + } + + pub fn into_tx_trace(self) -> TransactionTrace { + TransactionTrace::Raw { + step_logs: self.step_logs, + gas: self.final_gas.into(), + return_value: self.return_value, + } + } +} + +impl GasometerListener for RawTracer { + fn event(&mut self, event: GasometerEvent) { + match event { + GasometerEvent::RecordTransaction { .. } => { + // First event of a transaction. + // Next step will be the first context. + self.new_context = true; + } + GasometerEvent::RecordCost { cost, snapshot } => { + if let Some(context) = self.context_stack.last_mut() { + // Register opcode cost. (ignore costs not between Step and StepResult) + if let Some(step) = &mut context.current_step { + step.gas = snapshot.gas(); + step.gas_cost = cost; + self.final_gas = step.gas; + } + } + } + GasometerEvent::RecordDynamicCost { + gas_cost, snapshot, .. + } => { + if let Some(context) = self.context_stack.last_mut() { + // Register opcode cost. (ignore costs not between Step and StepResult) + if let Some(step) = &mut context.current_step { + step.gas = snapshot.gas(); + step.gas_cost = gas_cost; + self.final_gas = step.gas; + } + } + } + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } +} + +impl RuntimeListener for RawTracer { + fn event(&mut self, event: RuntimeEvent) { + match event { + RuntimeEvent::Step { + context, + opcode, + position, + stack, + memory, + } => { + // Create a context if needed. + if self.new_context { + self.new_context = false; + + self.context_stack.push(Context { + storage_cache: BTreeMap::new(), + address: context.address, + current_step: None, + global_storage_changes: BTreeMap::new(), + }); + } + + let depth = self.context_stack.len(); + + // Ignore steps outside of any context (shouldn't even be possible). + if let Some(context) = self.context_stack.last_mut() { + context.current_step = Some(Step { + opcode, + depth, + gas: 0, // 0 for now, will add with gas events + gas_cost: 0, // 0 for now, will add with gas events + position: *position.as_ref().unwrap_or(&0), + memory: if self.disable_memory { + None + } else { + Some(memory.data().clone()) + }, + stack: if self.disable_stack { + None + } else { + Some(stack.data().clone()) + }, + }); + } + } + RuntimeEvent::StepResult { + result, + return_value, + } => { + // StepResult is expected to be emited after a step (in a context). + // Only case StepResult will occur without a Step before is in a transfer + // transaction to a non-contract address. However it will not contain any + // steps and return an empty trace, so we can ignore this edge case. + if let Some(context) = self.context_stack.last_mut() { + if let Some(current_step) = context.current_step.take() { + let Step { + opcode, + depth, + gas, + gas_cost, + position, + memory, + stack, + } = current_step; + + let memory = memory.map(convert_memory); + + let storage = if self.disable_storage { + None + } else { + Some(context.storage_cache.clone()) + }; + + self.step_logs.push(RawStepLog { + depth: depth.into(), + gas: gas.into(), + gas_cost: gas_cost.into(), + memory, + op: opcodes_string(opcode), + pc: position.into(), + stack, + storage, + }); + } + } + + // We match on the capture to handle traps/exits. + match result { + Err(Capture::Exit(reason)) => { + // Exit = we exit the context (should always be some) + if let Some(mut context) = self.context_stack.pop() { + // If final context is exited, we store gas and return value. + if self.context_stack.is_empty() { + self.return_value = return_value.to_vec(); + } + + // If the context exited without revert we must keep track of the + // updated storage keys. + if !self.disable_storage && matches!(reason, &ExitReason::Succeed(_)) { + if let Some(parent_context) = self.context_stack.last_mut() { + // Add cache to storage changes. + context + .global_storage_changes + .insert(context.address, context.storage_cache); + + // Apply storage changes to parent, either updating its cache or map of changes. + for (address, mut storage) in + context.global_storage_changes.into_iter() + { + // Same address => We update its cache (only tracked keys) + if parent_context.address == address { + for (cached_key, cached_value) in + parent_context.storage_cache.iter_mut() + { + if let Some(value) = storage.remove(cached_key) { + *cached_value = value; + } + } + } + // Otherwise, update the storage changes. + else { + parent_context + .global_storage_changes + .entry(address) + .or_insert_with(BTreeMap::new) + .append(&mut storage); + } + } + } + } + } + } + Err(Capture::Trap(opcode)) if ContextType::from(*opcode).is_some() => { + self.new_context = true; + } + _ => (), + } + } + RuntimeEvent::SLoad { + address: _, + index, + value, + } + | RuntimeEvent::SStore { + address: _, + index, + value, + } => { + if let Some(context) = self.context_stack.last_mut() { + if !self.disable_storage { + context.storage_cache.insert(index, value); + } + } + } + // We ignore other kinds of message if any (new ones may be added in the future). + #[allow(unreachable_patterns)] + _ => (), + } + } +} diff --git a/node/evm_tracer/src/util.rs b/node/evm_tracer/src/util.rs new file mode 100644 index 00000000..cdf8fb58 --- /dev/null +++ b/node/evm_tracer/src/util.rs @@ -0,0 +1,246 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +use ethereum_types::H256; +pub use evm::tracing::{using as evm_using, Event as EvmEvent, EventListener as EvmListener}; +pub use evm::Opcode; +pub use evm_gasometer::tracing::{ + using as gasometer_using, Event as GasometerEvent, EventListener as GasometerListener, +}; +pub use evm_runtime::tracing::{ + using as runtime_using, Event as RuntimeEvent, EventListener as RuntimeListener, +}; +use edgeware_rpc_primitives_debug::CallType; +pub use sp_std::{cell::RefCell, fmt::Debug, rc::Rc, vec, vec::Vec}; +pub struct ListenerProxy(pub Rc>); + +impl GasometerListener for ListenerProxy { + fn event(&mut self, event: GasometerEvent) { + self.0.borrow_mut().event(event); + } +} + +impl RuntimeListener for ListenerProxy { + fn event(&mut self, event: RuntimeEvent) { + self.0.borrow_mut().event(event); + } +} + +impl EvmListener for ListenerProxy { + fn event(&mut self, event: EvmEvent) { + self.0.borrow_mut().event(event); + } +} + +pub fn opcodes_string(opcode: Opcode) -> Vec { + let out = match opcode { + Opcode(0) => "Stop", + Opcode(1) => "Add", + Opcode(2) => "Mul", + Opcode(3) => "Sub", + Opcode(4) => "Div", + Opcode(5) => "SDiv", + Opcode(6) => "Mod", + Opcode(7) => "SMod", + Opcode(8) => "AddMod", + Opcode(9) => "MulMod", + Opcode(10) => "Exp", + Opcode(11) => "SignExtend", + Opcode(16) => "Lt", + Opcode(17) => "Gt", + Opcode(18) => "Slt", + Opcode(19) => "Sgt", + Opcode(20) => "Eq", + Opcode(21) => "IsZero", + Opcode(22) => "And", + Opcode(23) => "Or", + Opcode(24) => "Xor", + Opcode(25) => "Not", + Opcode(26) => "Byte", + Opcode(27) => "Shl", + Opcode(28) => "Shr", + Opcode(29) => "Sar", + Opcode(32) => "Keccak256", + Opcode(48) => "Address", + Opcode(49) => "Balance", + Opcode(50) => "Origin", + Opcode(51) => "Caller", + Opcode(52) => "CallValue", + Opcode(53) => "CallDataLoad", + Opcode(54) => "CallDataSize", + Opcode(55) => "CallDataCopy", + Opcode(56) => "CodeSize", + Opcode(57) => "CodeCopy", + Opcode(58) => "GasPrice", + Opcode(59) => "ExtCodeSize", + Opcode(60) => "ExtCodeCopy", + Opcode(61) => "ReturnDataSize", + Opcode(62) => "ReturnDataCopy", + Opcode(63) => "ExtCodeHash", + Opcode(64) => "BlockHash", + Opcode(65) => "Coinbase", + Opcode(66) => "Timestamp", + Opcode(67) => "Number", + Opcode(68) => "Difficulty", + Opcode(69) => "GasLimit", + Opcode(70) => "ChainId", + Opcode(80) => "Pop", + Opcode(81) => "MLoad", + Opcode(82) => "MStore", + Opcode(83) => "MStore8", + Opcode(84) => "SLoad", + Opcode(85) => "SStore", + Opcode(86) => "Jump", + Opcode(87) => "JumpI", + Opcode(88) => "GetPc", + Opcode(89) => "MSize", + Opcode(90) => "Gas", + Opcode(91) => "JumpDest", + Opcode(96) => "Push1", + Opcode(97) => "Push2", + Opcode(98) => "Push3", + Opcode(99) => "Push4", + Opcode(100) => "Push5", + Opcode(101) => "Push6", + Opcode(102) => "Push7", + Opcode(103) => "Push8", + Opcode(104) => "Push9", + Opcode(105) => "Push10", + Opcode(106) => "Push11", + Opcode(107) => "Push12", + Opcode(108) => "Push13", + Opcode(109) => "Push14", + Opcode(110) => "Push15", + Opcode(111) => "Push16", + Opcode(112) => "Push17", + Opcode(113) => "Push18", + Opcode(114) => "Push19", + Opcode(115) => "Push20", + Opcode(116) => "Push21", + Opcode(117) => "Push22", + Opcode(118) => "Push23", + Opcode(119) => "Push24", + Opcode(120) => "Push25", + Opcode(121) => "Push26", + Opcode(122) => "Push27", + Opcode(123) => "Push28", + Opcode(124) => "Push29", + Opcode(125) => "Push30", + Opcode(126) => "Push31", + Opcode(127) => "Push32", + Opcode(128) => "Dup1", + Opcode(129) => "Dup2", + Opcode(130) => "Dup3", + Opcode(131) => "Dup4", + Opcode(132) => "Dup5", + Opcode(133) => "Dup6", + Opcode(134) => "Dup7", + Opcode(135) => "Dup8", + Opcode(136) => "Dup9", + Opcode(137) => "Dup10", + Opcode(138) => "Dup11", + Opcode(139) => "Dup12", + Opcode(140) => "Dup13", + Opcode(141) => "Dup14", + Opcode(142) => "Dup15", + Opcode(143) => "Dup16", + Opcode(144) => "Swap1", + Opcode(145) => "Swap2", + Opcode(146) => "Swap3", + Opcode(147) => "Swap4", + Opcode(148) => "Swap5", + Opcode(149) => "Swap6", + Opcode(150) => "Swap7", + Opcode(151) => "Swap8", + Opcode(152) => "Swap9", + Opcode(153) => "Swap10", + Opcode(154) => "Swap11", + Opcode(155) => "Swap12", + Opcode(156) => "Swap13", + Opcode(157) => "Swap14", + Opcode(158) => "Swap15", + Opcode(159) => "Swap16", + Opcode(160) => "Log0", + Opcode(161) => "Log1", + Opcode(162) => "Log2", + Opcode(163) => "Log3", + Opcode(164) => "Log4", + Opcode(176) => "JumpTo", + Opcode(177) => "JumpIf", + Opcode(178) => "JumpSub", + Opcode(180) => "JumpSubv", + Opcode(181) => "BeginSub", + Opcode(182) => "BeginData", + Opcode(184) => "ReturnSub", + Opcode(185) => "PutLocal", + Opcode(186) => "GetLocal", + Opcode(225) => "SLoadBytes", + Opcode(226) => "SStoreBytes", + Opcode(227) => "SSize", + Opcode(240) => "Create", + Opcode(241) => "Call", + Opcode(242) => "CallCode", + Opcode(243) => "Return", + Opcode(244) => "DelegateCall", + Opcode(245) => "Create2", + Opcode(250) => "StaticCall", + Opcode(252) => "TxExecGas", + Opcode(253) => "Revert", + Opcode(254) => "Invalid", + Opcode(255) => "SelfDestruct", + _ => unreachable!("Unreachable Opcode identifier."), + }; + out.as_bytes().to_vec() +} + +#[derive(Debug)] +pub enum ContextType { + Call(CallType), + Create, +} + +impl ContextType { + pub fn from(opcode: Opcode) -> Option { + match opcode.0 { + 0xF0 | 0xF5 => Some(ContextType::Create), + 0xF1 => Some(ContextType::Call(CallType::Call)), + 0xF2 => Some(ContextType::Call(CallType::CallCode)), + 0xF4 => Some(ContextType::Call(CallType::DelegateCall)), + 0xFA => Some(ContextType::Call(CallType::StaticCall)), + _ => None, + } + } +} + +pub fn convert_memory(memory: Vec) -> Vec { + let size = 32; + memory + .chunks(size) + .map(|c| { + let mut msg = [0u8; 32]; + let chunk = c.len(); + if chunk < size { + let left = size - chunk; + let remainder = vec![0; left]; + msg[0..left].copy_from_slice(&remainder[..]); + msg[left..size].copy_from_slice(c); + } else { + msg[0..size].copy_from_slice(c) + } + H256::from_slice(&msg[..]) + }) + .collect() +} diff --git a/node/executor/Cargo.toml b/node/executor/Cargo.toml index c3c8cbee..99b946c6 100644 --- a/node/executor/Cargo.toml +++ b/node/executor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "edgeware-executor" -version = "3.2.0" +version = "3.3.0" authors = ["Commonwealth Labs "] description = "Edgeware implementation using a substrate node." edition = "2018" @@ -11,34 +11,32 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] trie-root = "0.16.0" -codec = { package = "parity-scale-codec", version = "1.3.0" } -sp-io = { version = "2.0"} -sp-state-machine = { version = "0.8"} -sc-executor = { version = "0.8"} -sp-core = { version = "2.0"} -sp-trie = { version = "2.0"} -frame-benchmarking = { version = "2.0"} +codec = { package = "parity-scale-codec", version = "2.0.0" } +sp-io = { version = "3.0" } +sp-state-machine = { version = "0.9" } +sc-executor = { version = "0.9" } +sp-core = { version = "3.0" } +sp-trie = { version = "3.0" } +frame-benchmarking = { version = "3.0" } -edgeware-primitives = { version = "3.2.0", path = "../primitives" } -edgeware-runtime = { version = "3.2.0", path = "../runtime" } -edgeware-runtime-interface = { version = "3.2.0", path = "../runtime-interface" } +edgeware-primitives = { version = "3.3.0", path = "../primitives" } +edgeware-runtime = { version = "3.3.0", path = "../runtime" } +edgeware-runtime-interface = { version = "3.3.0", path = "../runtime-interface" } [dev-dependencies] -sp-runtime = { version = "2.0"} -frame-support = { version = "2.0"} -pallet-balances = { version = "2.0"} -pallet-transaction-payment = { version = "2.0"} -pallet-session = { version = "2.0"} -frame-system = { version = "2.0"} -pallet-timestamp = { version = "2.0"} -pallet-treasury = { version = "2.0"} -pallet-grandpa = { version = "2.0"} -pallet-indices = { version = "2.0"} +sp-runtime = { version = "3.0" } +frame-support = { version = "3.0" } +pallet-balances = { version = "3.0" } +pallet-transaction-payment = { version = "3.0" } +pallet-session = { version = "3.0" } +frame-system = { version = "3.0" } +pallet-timestamp = { version = "3.0" } +pallet-treasury = { version = "3.0" } +pallet-grandpa = { version = "3.0" } +pallet-indices = { version = "3.0" } wabt = "0.10.0" criterion = "0.3.0" -edgeware-testing = { version = "3.2.0", path = "../testing" } - [features] wasmtime = [ "sc-executor/wasmtime", diff --git a/node/executor/benches/bench.rs b/node/executor/benches/bench.rs index 42171b21..4f8238db 100644 --- a/node/executor/benches/bench.rs +++ b/node/executor/benches/bench.rs @@ -15,21 +15,22 @@ // along with Edgeware. If not, see . use codec::{Decode, Encode}; -use criterion::{BatchSize, Criterion, criterion_group, criterion_main}; +use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; use edgeware_executor::Executor; use edgeware_primitives::{BlockNumber, Hash}; use edgeware_runtime::{ - Block, BuildStorage, Call, CheckedExtrinsic, GenesisConfig, Header, UncheckedExtrinsic, + constants::currency::*, Block, BuildStorage, Call, CheckedExtrinsic, GenesisConfig, Header, UncheckedExtrinsic, }; -use edgeware_runtime::constants::currency::*; use edgeware_testing::keyring::*; -use sp_core::{NativeOrEncoded, NeverNativeValue}; -use sp_core::storage::well_known_keys; -use sp_core::traits::{CodeExecutor, RuntimeCode}; use frame_support::Hashable; -use sp_state_machine::TestExternalities as CoreTestExternalities; -use sc_executor::{NativeExecutor, RuntimeInfo, WasmExecutionMethod, Externalities}; +use sc_executor::{Externalities, NativeExecutor, RuntimeInfo, WasmExecutionMethod}; +use sp_core::{ + storage::well_known_keys, + traits::{CodeExecutor, RuntimeCode}, + NativeOrEncoded, NeverNativeValue, +}; use sp_runtime::traits::BlakeTwo256; +use sp_state_machine::TestExternalities as CoreTestExternalities; criterion_group!(benches, bench_execute_block); criterion_main!(benches); @@ -56,11 +57,10 @@ fn sign(xt: CheckedExtrinsic) -> UncheckedExtrinsic { } fn new_test_ext(genesis_config: &GenesisConfig) -> TestExternalities { - let mut test_ext = TestExternalities::new_with_code( - COMPACT_CODE, - genesis_config.build_storage().unwrap(), - ); - test_ext.ext().place_storage(well_known_keys::HEAP_PAGES.to_vec(), Some(HEAP_PAGES.encode())); + let mut test_ext = TestExternalities::new_with_code(COMPACT_CODE, genesis_config.build_storage().unwrap()); + test_ext + .ext() + .place_storage(well_known_keys::HEAP_PAGES.to_vec(), Some(HEAP_PAGES.encode())); test_ext } @@ -71,15 +71,14 @@ fn construct_block( parent_hash: Hash, extrinsics: Vec, ) -> (Vec, Hash) { - use sp_trie::{TrieConfiguration, trie_types::Layout}; + use sp_trie::{trie_types::Layout, TrieConfiguration}; // sign extrinsics. let extrinsics = extrinsics.into_iter().map(sign).collect::>(); // calculate the header fields that we can. - let extrinsics_root = Layout::::ordered_trie_root( - extrinsics.iter().map(Encode::encode) - ).to_fixed_bytes() + let extrinsics_root = Layout::::ordered_trie_root(extrinsics.iter().map(Encode::encode)) + .to_fixed_bytes() .into(); let header = Header { @@ -97,34 +96,37 @@ fn construct_block( }; // execute the block to get the real header. - executor.call:: _>( - ext, - &runtime_code, - "Core_initialize_block", - &header.encode(), - true, - None, - ).0.unwrap(); - - for i in extrinsics.iter() { - executor.call:: _>( + executor + .call:: _>( ext, &runtime_code, - "BlockBuilder_apply_extrinsic", - &i.encode(), + "Core_initialize_block", + &header.encode(), true, None, - ).0.unwrap(); + ) + .0 + .unwrap(); + + for i in extrinsics.iter() { + executor + .call:: _>( + ext, + &runtime_code, + "BlockBuilder_apply_extrinsic", + &i.encode(), + true, + None, + ) + .0 + .unwrap(); } - let header = match executor.call:: _>( - ext, - &runtime_code, - "BlockBuilder_finalize_block", - &[0u8;0], - true, - None, - ).0.unwrap() { + let header = match executor + .call:: _>(ext, &runtime_code, "BlockBuilder_finalize_block", &[0u8; 0], true, None) + .0 + .unwrap() + { NativeOrEncoded::Native(_) => unreachable!(), NativeOrEncoded::Encoded(h) => Header::decode(&mut &h[..]).unwrap(), }; @@ -133,30 +135,17 @@ fn construct_block( (Block { header, extrinsics }.encode(), hash.into()) } - -fn test_blocks(genesis_config: &GenesisConfig, executor: &NativeExecutor) - -> Vec<(Vec, Hash)> -{ +fn test_blocks(genesis_config: &GenesisConfig, executor: &NativeExecutor) -> Vec<(Vec, Hash)> { let mut test_ext = new_test_ext(genesis_config); - let mut block1_extrinsics = vec![ - CheckedExtrinsic { - signed: None, - function: Call::Timestamp(pallet_timestamp::Call::set(42 * 1000)), - }, - ]; - block1_extrinsics.extend((0..20).map(|i| { - CheckedExtrinsic { - signed: Some((alice(), signed_extra(i, 0))), - function: Call::Balances(pallet_balances::Call::transfer(bob().into(), 1 * DOLLARS)), - } + let mut block1_extrinsics = vec![CheckedExtrinsic { + signed: None, + function: Call::Timestamp(pallet_timestamp::Call::set(42 * 1000)), + }]; + block1_extrinsics.extend((0..20).map(|i| CheckedExtrinsic { + signed: Some((alice(), signed_extra(i, 0))), + function: Call::Balances(pallet_balances::Call::transfer(bob().into(), 1 * DOLLARS)), })); - let block1 = construct_block( - executor, - &mut test_ext.ext(), - 1, - GENESIS_HASH.into(), - block1_extrinsics, - ); + let block1 = construct_block(executor, &mut test_ext.ext(), 1, GENESIS_HASH.into(), block1_extrinsics); vec![block1] } @@ -190,14 +179,17 @@ fn bench_execute_block(c: &mut Criterion) { || new_test_ext(&genesis_config), |test_ext| { for block in blocks.iter() { - executor.call:: _>( - &mut test_ext.ext(), - &runtime_code, - "Core_execute_block", - &block.0, - use_native, - None, - ).0.unwrap(); + executor + .call:: _>( + &mut test_ext.ext(), + &runtime_code, + "Core_execute_block", + &block.0, + use_native, + None, + ) + .0 + .unwrap(); } }, BatchSize::LargeInput, diff --git a/node/executor/src/lib.rs b/node/executor/src/lib.rs index 5e49cc0c..e504d58f 100644 --- a/node/executor/src/lib.rs +++ b/node/executor/src/lib.rs @@ -14,14 +14,14 @@ // You should have received a copy of the GNU General Public License // along with Edgeware. If not, see . -//! A `CodeExecutor` specialization which uses natively compiled runtime when the wasm to be -//! executed is equivalent to the natively compiled code. +//! A `CodeExecutor` specialization which uses natively compiled runtime when +//! the wasm to be executed is equivalent to the natively compiled code. -pub use sc_executor::NativeExecutor; -use sc_executor::native_executor_instance; use edgeware_runtime_interface; -// Declare an instance of the native executor named `Executor`. Include the wasm binary as the -// equivalent wasm code. +use sc_executor::native_executor_instance; +pub use sc_executor::NativeExecutor; +// Declare an instance of the native executor named `Executor`. Include the wasm +// binary as the equivalent wasm code. native_executor_instance!( pub Executor, edgeware_runtime::api::dispatch, diff --git a/node/opts/Cargo.toml b/node/opts/Cargo.toml new file mode 100644 index 00000000..1f21820f --- /dev/null +++ b/node/opts/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "edgeware-opts" +version = "0.1.0" +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/node/opts/src/lib.rs b/node/opts/src/lib.rs new file mode 100644 index 00000000..8f7c5b11 --- /dev/null +++ b/node/opts/src/lib.rs @@ -0,0 +1,29 @@ +use std::str::FromStr; + +#[derive(Debug, PartialEq, Clone)] +pub enum EthApi { + Txpool, + Debug, + Trace, +} + +impl FromStr for EthApi { + type Err = String; + + fn from_str(s: &str) -> Result { + Ok(match s { + "txpool" => Self::Txpool, + "debug" => Self::Debug, + "trace" => Self::Trace, + _ => return Err(format!("`{}` is not recognized as a supported Ethereum Api", s)), + }) + } +} + +pub struct RpcConfig { + pub ethapi: Vec, + pub ethapi_max_permits: u32, + pub ethapi_trace_max_count: u32, + pub ethapi_trace_cache_duration: u64, + pub max_past_logs: u32, +} diff --git a/node/primitives/Cargo.toml b/node/primitives/Cargo.toml index b324cd8e..b34c31b2 100644 --- a/node/primitives/Cargo.toml +++ b/node/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "edgeware-primitives" -version = "3.2.0" +version = "3.3.0" authors = ["Commonwealth Labs "] edition = "2018" license = "GPL-3.0-or-later WITH Classpath-exception-2.0" @@ -10,14 +10,14 @@ description = "Edgeware runtime primitives" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] } -frame-system = { version = "2.0", default-features = false } -sp-application-crypto = { version = "2.0", default-features = false } -sp-core = { version = "2.0", default-features = false } -sp-runtime = { version = "2.0", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +frame-system = { version = "3.0", default-features = false } +sp-application-crypto = { version = "3.0", default-features = false } +sp-core = { version = "3.0", default-features = false } +sp-runtime = { version = "3.0", default-features = false } [dev-dependencies] -sp-serializer = { version = "2.0" } +sp-serializer = { version = "3.0" } pretty_assertions = "0.6.1" [features] diff --git a/node/primitives/src/lib.rs b/node/primitives/src/lib.rs index 5a6871c7..df4d27b0 100644 --- a/node/primitives/src/lib.rs +++ b/node/primitives/src/lib.rs @@ -17,24 +17,27 @@ //! Low-level types used throughout the Substrate code. #![warn(missing_docs)] - #![cfg_attr(not(feature = "std"), no_std)] use sp_runtime::{ - generic, traits::{Verify, BlakeTwo256, IdentifyAccount}, OpaqueExtrinsic, MultiSignature + generic, + traits::{BlakeTwo256, IdentifyAccount, Verify}, + MultiSignature, OpaqueExtrinsic, }; /// An index to a block. pub type BlockNumber = u32; -/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. +/// Alias to 512-bit hash when used in the context of a transaction signature on +/// the chain. pub type Signature = MultiSignature; -/// Some way of identifying an account on the chain. We intentionally make it equivalent -/// to the public key of our transaction signing scheme. +/// Some way of identifying an account on the chain. We intentionally make it +/// equivalent to the public key of our transaction signing scheme. pub type AccountId = <::Signer as IdentifyAccount>::AccountId; -/// The type for looking up accounts. We don't expect more than 4 billion of them. +/// The type for looking up accounts. We don't expect more than 4 billion of +/// them. pub type AccountIndex = u32; /// Balance of an account. @@ -66,6 +69,15 @@ pub type Block = generic::Block; /// Block ID. pub type BlockId = generic::BlockId; +/// NFT balance for nft module +pub type NFTBalance = u128; +/// Asset id type for assets module +pub type AssetId = u32; +/// Token amount type for tokens module +pub type Amount = i128; +/// Currency id for tokens module +pub type CurrencyId = u64; + /// App-specific crypto used for reporting equivocation/misbehavior in AURA and /// GRANDPA. Any rewards for misbehavior reporting will be paid out to this /// account. @@ -86,13 +98,13 @@ pub mod report { /// Identity of the equivocation/misbehavior reporter. pub type ReporterId = app::Public; - /// An `AppCrypto` type to allow submitting signed transactions using the reporting - /// application key as signer. + /// An `AppCrypto` type to allow submitting signed transactions using the + /// reporting application key as signer. pub struct ReporterAppCrypto; impl AppCrypto<::Signer, Signature> for ReporterAppCrypto { - type RuntimeAppPublic = ReporterId; - type GenericSignature = sp_core::ed25519::Signature; type GenericPublic = sp_core::ed25519::Public; + type GenericSignature = sp_core::ed25519::Signature; + type RuntimeAppPublic = ReporterId; } } diff --git a/node/rpc-client/Cargo.toml b/node/rpc-client/Cargo.toml index 45ac351f..385e2f2a 100644 --- a/node/rpc-client/Cargo.toml +++ b/node/rpc-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "edgeware-rpc-client" -version = "3.2.0" +version = "3.3.0" authors = ["Commonwealth Labs "] edition = "2018" license = "GPL-3.0-or-later WITH Classpath-exception-2.0" @@ -15,6 +15,6 @@ hyper = "0.12.35" jsonrpc-core-client = { version = "15.0.0", default-features = false, features = ["http"] } log = "0.4.8" edgeware-primitives = { path = "../primitives" } -sp-tracing = { version = "2.0" } -sc-rpc = { version = "2.0" } +sp-tracing = { version = "3.0" } +sc-rpc = { version = "3.0" } diff --git a/node/rpc-client/src/main.rs b/node/rpc-client/src/main.rs index 8a5cd892..280b8753 100644 --- a/node/rpc-client/src/main.rs +++ b/node/rpc-client/src/main.rs @@ -18,20 +18,14 @@ //! Example edgeware RPC client code. //! -//! This module shows how you can write a Rust RPC client that connects to a running -//! edgeware node and use statically typed RPC wrappers. +//! This module shows how you can write a Rust RPC client that connects to a +//! running edgeware node and use statically typed RPC wrappers. +use edgeware_primitives::Hash; use futures::Future; use hyper::rt; -use edgeware_primitives::Hash; -use sc_rpc::author::{ - AuthorClient, - hash::ExtrinsicOrHash, -}; -use jsonrpc_core_client::{ - transports::http, - RpcError, -}; +use jsonrpc_core_client::{transports::http, RpcError}; +use sc_rpc::author::{hash::ExtrinsicOrHash, AuthorClient}; fn main() { sp_tracing::try_init_simple(); @@ -40,9 +34,7 @@ fn main() { let uri = "http://localhost:9933"; http::connect(uri) - .and_then(|client: AuthorClient| { - remove_all_extrinsics(client) - }) + .and_then(|client: AuthorClient| remove_all_extrinsics(client)) .map_err(|e| { println!("Error: {:?}", e); }) @@ -55,17 +47,21 @@ fn main() { /// 1. Calls the `pending_extrinsics` method to get all extrinsics in the pool. /// 2. Then calls `remove_extrinsic` passing the obtained raw extrinsics. /// -/// As the result of running the code the entire content of the transaction pool is going -/// to be removed and the extrinsics are going to be temporarily banned. -fn remove_all_extrinsics(client: AuthorClient) -> impl Future { - client.pending_extrinsics() +/// As the result of running the code the entire content of the transaction pool +/// is going to be removed and the extrinsics are going to be temporarily +/// banned. +fn remove_all_extrinsics(client: AuthorClient) -> impl Future { + client + .pending_extrinsics() .and_then(move |pending| { client.remove_extrinsic( - pending.into_iter().map(|tx| ExtrinsicOrHash::Extrinsic(tx.into())).collect() + pending + .into_iter() + .map(|tx| ExtrinsicOrHash::Extrinsic(tx.into())) + .collect(), ) }) .map(|removed| { println!("Removed extrinsics: {:?}", removed); }) } - diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index c5790496..daacf018 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "edgeware-rpc" -version = "3.2.0" +version = "3.3.0" authors = ["Commonwealth Labs "] edition = "2018" license = "GPL-3.0-or-later WITH Classpath-exception-2.0" @@ -10,30 +10,56 @@ description = "Edgeware rpc" targets = ["x86_64-unknown-linux-gnu"] [dependencies] +futures = { version = "0.3.1", features = ["compat"] } jsonrpc-core = "15.0.0" jsonrpc-pubsub = "15.0.0" +pallet-contracts-rpc = { version = "3.0" } +pallet-transaction-payment-rpc = { version = "3.0" } +pallet-transaction-payment-rpc-runtime-api = { version = "3.0" } +sc-client-api = { version = "3.0" } +sc-consensus-aura = { version = "0.9" } +sc-consensus-epochs = { version = "0.9" } +sc-finality-grandpa = { version = "0.9" } +sc-finality-grandpa-rpc = { version = "0.9" } +sc-keystore = { version = "3.0" } +sc-network = { version = "0.9" } +sc-rpc-api = { version = "0.9" } +sc-rpc = { version = "3.0" } +sc-service = { version = "0.9" } +sp-api = { version = "3.0" } +sp-block-builder = { version = "3.0" } +sp-blockchain = { version = "3.0" } +sp-consensus = { version = "0.9" } +sp-consensus-aura = { version = "0.9" } +sp-core = { version = "3.0" } +sp-offchain = { version = "3.0" } +sp-runtime = { version = "3.0" } +sp-storage = { version = "3.0" } +sp-session = { version = "3.0" } +sp-transaction-pool = { version = "3.0" } +sc-transaction-pool = { version = "3.0" } +sc-transaction-graph = { version = "3.0" } +substrate-frame-rpc-system = { version = "3.0" } +tokio = { version = "0.2.13", features = ["macros", "sync"] } + +pallet-ethereum = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-rpc = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fp-rpc = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-rpc-core = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-db = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fc-mapping-sync = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +merkle = { package = "pallet-merkle", default-features = false, git = "https://github.com/webb-tools/anon", branch = "erup-4" } +merkle-rpc = { package = "pallet-merkle-rpc", git = "https://github.com/webb-tools/anon", branch = "erup-4" } + edgeware-primitives = { path = "../primitives" } edgeware-runtime = { path = "../runtime" } -pallet-contracts-rpc = { version = "0.8" } -pallet-transaction-payment-rpc = { version = "2.0" } -sc-client-api = { version = "2.0" } -sc-consensus-aura = { version = "0.8" } -sc-consensus-epochs = { version = "0.8" } -sc-finality-grandpa = { version = "0.8" } -sc-finality-grandpa-rpc = { version = "0.8" } -sc-keystore = { version = "2.0" } -sc-network = { version = "0.8" } -sc-rpc-api = { version = "0.8" } -sc-rpc = { version = "2.0" } -sp-api = { version = "2.0" } -sp-block-builder = { version = "2.0" } -sp-blockchain = { version = "2.0" } -sp-consensus = { version = "0.8" } -sp-consensus-aura = { version = "0.8" } -sp-runtime = { version = "2.0" } -sp-transaction-pool = { version = "2.0" } -substrate-frame-rpc-system = { version = "2.0" } -pallet-ethereum = { version = "0.1" } -fc-rpc = { version = "0.1", features = ["rpc_binary_search_estimate"] } -fp-rpc = { version = "0.1" } -fc-rpc-core = { version = "0.1" } +edgeware-executor = { path = "../executor" } +edgeware-opts = { path = "../opts" } +edgeware-rpc-txpool = { path = "../../client/rpc/txpool" } +edgeware-rpc-primitives-txpool = { path = "../txpool" } +edgeware-rpc-debug = { path = "../../client/rpc/debug" } +edgeware-rpc-primitives-debug = { path = "../debug" } +edgeware-rpc-trace = { path = "../../client/rpc/trace" } + +[features] +std = [] \ No newline at end of file diff --git a/node/rpc/src/client.rs b/node/rpc/src/client.rs new file mode 100644 index 00000000..aca0598d --- /dev/null +++ b/node/rpc/src/client.rs @@ -0,0 +1,59 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . +pub use edgeware_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Header, Index}; +use sp_runtime::{ + traits::{BlakeTwo256}, +}; + + + +/// A set of APIs that polkadot-like runtimes must implement. +/// +/// This trait has no methods or associated type. It is a concise marker for all +/// the trait bounds that it contains. +pub trait RuntimeApiCollection: + sp_transaction_pool::runtime_api::TaggedTransactionQueue + + sp_api::ApiExt + + sp_block_builder::BlockBuilder + + substrate_frame_rpc_system::AccountNonceApi + + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + + sp_api::Metadata + + sp_offchain::OffchainWorkerApi + + sp_session::SessionKeys + + fp_rpc::EthereumRuntimeRPCApi + + edgeware_rpc_primitives_debug::DebugRuntimeApi + + edgeware_rpc_primitives_txpool::TxPoolRuntimeApi +where + >::StateBackend: sp_api::StateBackend, +{ +} + +impl RuntimeApiCollection for Api +where + Api: sp_transaction_pool::runtime_api::TaggedTransactionQueue + + sp_api::ApiExt + + sp_block_builder::BlockBuilder + + substrate_frame_rpc_system::AccountNonceApi + + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + + sp_api::Metadata + + sp_offchain::OffchainWorkerApi + + sp_session::SessionKeys + + fp_rpc::EthereumRuntimeRPCApi + + edgeware_rpc_primitives_debug::DebugRuntimeApi + + edgeware_rpc_primitives_txpool::TxPoolRuntimeApi, + >::StateBackend: sp_api::StateBackend, +{ +} diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 785a7aa4..060654ad 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -29,26 +29,55 @@ #![warn(missing_docs)] -use std::{sync::Arc}; -use fc_rpc_core::types::PendingTransactions; +pub use edgeware_opts as opts; +use edgeware_opts::EthApi as EthApiCmd; use edgeware_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Index}; +use fc_rpc::{OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override, StorageOverride}; +use fc_rpc_core::types::{FilterPool, PendingTransactions}; use jsonrpc_pubsub::manager::SubscriptionManager; -use sc_finality_grandpa::{ - SharedVoterState, SharedAuthoritySet, FinalityProofProvider, GrandpaJustificationStream +use merkle_rpc::{MerkleApi, MerkleClient}; +use pallet_ethereum::EthereumStorageSchema; +use sc_client_api::{ + backend::{AuxStore, Backend, StateBackend, StorageProvider}, + client::BlockchainEvents, + BlockOf, }; +use fc_mapping_sync::MappingSyncWorker; + +use sc_service::TaskManager; +use sc_finality_grandpa::{FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState}; use sc_finality_grandpa_rpc::GrandpaRpcHandler; -use sp_transaction_pool::TransactionPool; -pub use sc_rpc_api::DenyUnsafe; use sc_network::NetworkService; -use sp_api::ProvideRuntimeApi; +use sc_rpc::SubscriptionTaskExecutor; +pub use sc_rpc_api::DenyUnsafe; +use sc_transaction_graph::{ChainApi, Pool}; +use sp_api::{HeaderT, ProvideRuntimeApi}; +use sp_core::H256; use sp_block_builder::BlockBuilder; -use sp_blockchain::{Error as BlockChainError, HeaderMetadata, HeaderBackend}; +use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use sp_consensus::SelectChain; -use sc_client_api::{ - backend::{StorageProvider, AuxStore}, - client::BlockchainEvents, +use sp_transaction_pool::TransactionPool; +use std::{ + collections::{BTreeMap}, + sync::{Arc}, + time::Duration, }; -use sc_rpc::SubscriptionTaskExecutor; +use fc_rpc::EthTask; +use edgeware_rpc_trace::CacheTask; +use edgeware_rpc_debug::DebugHandler; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; +use tokio::sync::Semaphore; +use edgeware_rpc_primitives_debug::DebugRuntimeApi; +use fp_rpc::EthereumRuntimeRPCApi; +use edgeware_rpc_debug::{Debug, DebugRequester, DebugServer}; +use edgeware_rpc_trace::{CacheRequester as TraceFilterCacheRequester, Trace, TraceServer}; +use edgeware_rpc_txpool::{TxPool, TxPoolServer}; +use futures::StreamExt; + + +/// RPC Client +pub mod client; +use client::RuntimeApiCollection; /// Public io handler for exporting into other modules pub type IoHandler = jsonrpc_core::IoHandler; @@ -80,11 +109,13 @@ pub struct GrandpaDeps { } /// Full client dependencies. -pub struct FullDeps { +pub struct FullDeps { /// The client instance to use. pub client: Arc, /// Transaction pool instance. pub pool: Arc

, + /// Graph pool instance. + pub graph: Arc>, /// The SelectChain Strategy pub select_chain: SC, /// The Node authority flag @@ -93,54 +124,78 @@ pub struct FullDeps { pub enable_dev_signer: bool, /// Network service pub network: Arc>, - /// Ethereum pending transactions. - pub pending_transactions: PendingTransactions, /// Whether to deny unsafe calls pub deny_unsafe: DenyUnsafe, /// GRANDPA specific dependencies. pub grandpa: GrandpaDeps, + /// Ethereum pending transactions. + pub pending_transactions: PendingTransactions, + /// EthFilterApi pool. + pub filter_pool: Option, + /// Backend. + pub backend: Arc>, + /// Maximum number of logs in a query. + pub max_past_logs: u32, + /// The list of optional RPC extensions. + pub ethapi_cmd: Vec, + /// Debug server requester. + pub debug_requester: Option, + /// Trace filter cache server requester. + pub trace_filter_requester: Option, + /// Trace filter max count. + pub trace_filter_max_count: u32, } - /// Instantiate all Full RPC extensions. -pub fn create_full( - deps: FullDeps, +pub fn create_full( + deps: FullDeps, subscription_task_executor: SubscriptionTaskExecutor, -) -> jsonrpc_core::IoHandler where +) -> jsonrpc_core::IoHandler +where C: ProvideRuntimeApi + StorageProvider + AuxStore, - C: HeaderBackend + HeaderMetadata + 'static, + C: HeaderBackend + HeaderMetadata + 'static, C: Send + Sync + 'static, C: BlockchainEvents, - C::Api: substrate_frame_rpc_system::AccountNonceApi, - C::Api: pallet_contracts_rpc::ContractsRuntimeApi, + C::Api: pallet_contracts_rpc::ContractsRuntimeApi, C::Api: BlockBuilder, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: fp_rpc::EthereumRuntimeRPCApi, + C::Api: merkle::MerkleApi, C::Api: BlockBuilder, - P: TransactionPool + 'static, - SC: SelectChain +'static, + P: TransactionPool + 'static, + SC: SelectChain + 'static, B: sc_client_api::Backend + Send + Sync + 'static, B::State: sc_client_api::backend::StateBackend>, + A: ChainApi + 'static, + C::Api: RuntimeApiCollection, { - use substrate_frame_rpc_system::{FullSystem, SystemApi}; - use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; - use pallet_contracts_rpc::{Contracts, ContractsApi}; use fc_rpc::{ - EthApi, EthApiServer, NetApi, NetApiServer, EthPubSubApiServer, EthPubSubApi, - EthDevSigner, EthSigner, HexEncodedIdProvider, + EthApi, EthApiServer, EthDevSigner, EthFilterApi, EthFilterApiServer, EthPubSubApi, EthPubSubApiServer, + EthSigner, HexEncodedIdProvider, NetApi, NetApiServer, Web3Api, Web3ApiServer, }; + use pallet_contracts_rpc::{Contracts, ContractsApi}; + use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; + use substrate_frame_rpc_system::{FullSystem, SystemApi}; let mut io = jsonrpc_core::IoHandler::default(); let FullDeps { client, pool, + graph, select_chain: _, enable_dev_signer, is_authority, network, - pending_transactions, deny_unsafe, grandpa, + pending_transactions, + filter_pool, + backend, + max_past_logs, + debug_requester, + trace_filter_requester, + trace_filter_max_count, + ethapi_cmd, } = deps; let GrandpaDeps { shared_voter_state, @@ -150,70 +205,109 @@ pub fn create_full( finality_provider, } = grandpa; - io.extend_with( - SystemApi::to_delegate(FullSystem::new(client.clone(), pool.clone(), deny_unsafe)) - ); + io.extend_with(SystemApi::to_delegate(FullSystem::new( + client.clone(), + pool.clone(), + deny_unsafe, + ))); // Making synchronous calls in light client freezes the browser currently, // more context: https://github.com/paritytech/substrate/pull/3480 // These RPCs should use an asynchronous caller instead. - io.extend_with( - ContractsApi::to_delegate(Contracts::new(client.clone())) - ); - io.extend_with( - TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone())) - ); + io.extend_with(ContractsApi::to_delegate(Contracts::new(client.clone()))); + io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new( + client.clone(), + ))); let mut signers = Vec::new(); if enable_dev_signer { signers.push(Box::new(EthDevSigner::new()) as Box); } - io.extend_with( - EthApiServer::to_delegate(EthApi::new( - client.clone(), - pool.clone(), - edgeware_runtime::TransactionConverter, - network.clone(), - pending_transactions.clone(), - signers, - is_authority, - )) + let mut overrides_map = BTreeMap::new(); + overrides_map.insert( + EthereumStorageSchema::V1, + Box::new(SchemaV1Override::new(client.clone())) as Box + Send + Sync>, ); - io.extend_with( - NetApiServer::to_delegate(NetApi::new( - client.clone(), - network.clone(), - )) - ); - io.extend_with( - EthPubSubApiServer::to_delegate(EthPubSubApi::new( - pool.clone(), + + let overrides = Arc::new(OverrideHandle { + schemas: overrides_map, + fallback: Box::new(RuntimeApiStorageOverride::new(client.clone())), + }); + + io.extend_with(EthApiServer::to_delegate(EthApi::new( + client.clone(), + pool.clone(), + edgeware_runtime::TransactionConverter, + network.clone(), + pending_transactions.clone(), + signers, + overrides.clone(), + backend, + is_authority, + max_past_logs, + ))); + + if let Some(filter_pool) = filter_pool { + io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new( client.clone(), - network.clone(), - SubscriptionManager::::with_id_provider( - HexEncodedIdProvider::default(), - Arc::new(subscription_task_executor) - ), - )) - ); - io.extend_with( - sc_finality_grandpa_rpc::GrandpaApi::to_delegate( - GrandpaRpcHandler::new( - shared_authority_set, - shared_voter_state, - justification_stream, - subscription_executor, - finality_provider, - ) - ) - ); + filter_pool.clone(), + 500 as usize, // max stored filters + overrides.clone(), + max_past_logs, + ))); + } + + io.extend_with(NetApiServer::to_delegate(NetApi::new( + client.clone(), + network.clone(), + // Whether to format the `peer_count` response as Hex (default) or not. + true, + ))); + + io.extend_with(Web3ApiServer::to_delegate(Web3Api::new(client.clone()))); + io.extend_with(EthPubSubApiServer::to_delegate(EthPubSubApi::new( + pool.clone(), + client.clone(), + network.clone(), + SubscriptionManager::::with_id_provider( + HexEncodedIdProvider::default(), + Arc::new(subscription_task_executor), + ), + overrides, + ))); + + io.extend_with(MerkleApi::to_delegate(MerkleClient::new(client.clone()))); + io.extend_with(sc_finality_grandpa_rpc::GrandpaApi::to_delegate( + GrandpaRpcHandler::new( + shared_authority_set, + shared_voter_state, + justification_stream, + subscription_executor, + finality_provider, + ), + )); + + if ethapi_cmd.contains(&EthApiCmd::Txpool) { + io.extend_with(TxPoolServer::to_delegate(TxPool::new(Arc::clone(&client), graph))); + } + + if let Some(trace_filter_requester) = trace_filter_requester { + io.extend_with(TraceServer::to_delegate(Trace::new( + client, + trace_filter_requester, + trace_filter_max_count, + ))); + } + + if let Some(debug_requester) = debug_requester { + io.extend_with(DebugServer::to_delegate(Debug::new(debug_requester))); + } io } /// Instantiate all Light RPC extensions. -pub fn create_light( - deps: LightDeps, -) -> jsonrpc_core::IoHandler where +pub fn create_light(deps: LightDeps) -> jsonrpc_core::IoHandler +where C: sp_blockchain::HeaderBackend, C: Send + Sync + 'static, F: sc_client_api::light::Fetcher + 'static, @@ -226,12 +320,150 @@ pub fn create_light( client, pool, remote_blockchain, - fetcher + fetcher, } = deps; let mut io = jsonrpc_core::IoHandler::default(); - io.extend_with( - SystemApi::::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool)) - ); + io.extend_with(SystemApi::::to_delegate(LightSystem::new( + client, + remote_blockchain, + fetcher, + pool, + ))); io } + +/// Parameters for various rpc utilities +pub struct RpcRequesters { + /// debug + pub debug: Option, + /// trace + pub trace: Option, +} + +/// Parameters for various services to start +pub struct SpawnTasksParams<'a, B: BlockT, C, BE> { + /// task manager + pub task_manager: &'a TaskManager, + /// substrate client + pub client: Arc, + /// substrate backend + pub substrate_backend: Arc, + /// frontier backend + pub frontier_backend: Arc>, + /// pending txes + pub pending_transactions: PendingTransactions, + /// ethereum filter pool + pub filter_pool: Option, +} + +/// Spawn the tasks that are required to run Moonbeam. +pub fn spawn_tasks( + rpc_config: &edgeware_opts::RpcConfig, + params: SpawnTasksParams, +) -> RpcRequesters +where + C: ProvideRuntimeApi + BlockOf, + C: HeaderBackend + HeaderMetadata + 'static, + C: BlockchainEvents, + C: Send + Sync + 'static, + C::Api: EthereumRuntimeRPCApi + DebugRuntimeApi + DebugRuntimeApi, + C::Api: BlockBuilder, + B: BlockT + Send + Sync + 'static, + B::Header: HeaderT, + BE: Backend + 'static, + BE::State: StateBackend, +{ + let permit_pool = Arc::new(Semaphore::new(rpc_config.ethapi_max_permits as usize)); + + let (trace_filter_task, trace_filter_requester) = + if rpc_config.ethapi.contains(&EthApiCmd::Trace) { + let (trace_filter_task, trace_filter_requester) = CacheTask::create( + Arc::clone(¶ms.client), + Arc::clone(¶ms.substrate_backend), + Duration::from_secs(rpc_config.ethapi_trace_cache_duration), + Arc::clone(&permit_pool), + ); + (Some(trace_filter_task), Some(trace_filter_requester)) + } else { + (None, None) + }; + + let (debug_task, debug_requester) = if rpc_config.ethapi.contains(&EthApiCmd::Debug) { + let (debug_task, debug_requester) = DebugHandler::task( + Arc::clone(¶ms.client), + Arc::clone(¶ms.substrate_backend), + Arc::clone(¶ms.frontier_backend), + Arc::clone(&permit_pool), + ); + (Some(debug_task), Some(debug_requester)) + } else { + (None, None) + }; + + // Frontier offchain DB task. Essential. + // Maps emulated ethereum data to substrate native data. + params.task_manager.spawn_essential_handle().spawn( + "frontier-mapping-sync-worker", + MappingSyncWorker::new( + params.client.import_notification_stream(), + Duration::new(6, 0), + params.client.clone(), + params.substrate_backend.clone(), + params.frontier_backend.clone(), + ) + .for_each(|()| futures::future::ready(())), + ); + + // `trace_filter` cache task. Essential. + // Proxies rpc requests to it's handler. + if let Some(trace_filter_task) = trace_filter_task { + params + .task_manager + .spawn_essential_handle() + .spawn("trace-filter-cache", trace_filter_task); + } + + // `debug` task if enabled. Essential. + // Proxies rpc requests to it's handler. + if let Some(debug_task) = debug_task { + params + .task_manager + .spawn_essential_handle() + .spawn("ethapi-debug", debug_task); + } + + // Frontier `EthFilterApi` maintenance. + // Manages the pool of user-created Filters. + if let Some(filter_pool) = params.filter_pool { + // Each filter is allowed to stay in the pool for 100 blocks. + const FILTER_RETAIN_THRESHOLD: u64 = 100; + params.task_manager.spawn_essential_handle().spawn( + "frontier-filter-pool", + EthTask::filter_pool_task( + Arc::clone(¶ms.client), + filter_pool, + FILTER_RETAIN_THRESHOLD, + ), + ); + } + + // Frontier pending transactions task. Essential. + // Maintenance for the Frontier-specific pending transaction pool. + if let Some(pending_transactions) = params.pending_transactions { + const TRANSACTION_RETAIN_THRESHOLD: u64 = 100; + params.task_manager.spawn_essential_handle().spawn( + "frontier-pending-transactions", + EthTask::pending_transaction_task( + Arc::clone(¶ms.client), + pending_transactions, + TRANSACTION_RETAIN_THRESHOLD, + ), + ); + } + + RpcRequesters { + debug: debug_requester, + trace: trace_filter_requester, + } +} diff --git a/node/runtime-interface/Cargo.toml b/node/runtime-interface/Cargo.toml index 4aaebef1..fa5ed8bf 100644 --- a/node/runtime-interface/Cargo.toml +++ b/node/runtime-interface/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "edgeware-runtime-interface" -version = "3.2.0" +version = "3.3.0" authors = ["Commonwealth Labs "] description = "Edgeware runtime interface helpers and functions" edition = "2018" @@ -10,10 +10,10 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "1.3.0" } -sp-runtime = { version = "2.0" } -sp-runtime-interface = { version = "2.0" } -sp-runtime-interface-proc-macro = { version = "2.0" } +codec = { package = "parity-scale-codec", version = "2.0.0" } +sp-runtime = { version = "3.0" } +sp-runtime-interface = { version = "3.0" } +sp-runtime-interface-proc-macro = { version = "3.0" } edgeware-primitives = { path = "../primitives" } [features] diff --git a/node/runtime-interface/src/lib.rs b/node/runtime-interface/src/lib.rs index 594baa4f..4da882a4 100644 --- a/node/runtime-interface/src/lib.rs +++ b/node/runtime-interface/src/lib.rs @@ -18,48 +18,48 @@ use sp_runtime_interface::runtime_interface; #[runtime_interface] pub trait Storage { - fn child_storage_kill(_a: u64, _b: u64, _c: u32) { - return; - } + fn child_storage_kill(_a: u64, _b: u64, _c: u32) { + return; + } - fn child_root(_a: u64) -> Option { - return Some(_a); - } + fn child_root(_a: u64) -> Option { + return Some(_a); + } - fn child_get(_a: u64, _b: u64, _c: u32, _d: u64) -> Option { - return Some(_a); - } + fn child_get(_a: u64, _b: u64, _c: u32, _d: u64) -> Option { + return Some(_a); + } - fn child_storage_key_or_panic(_a: u64) -> u64 { - return _a; - } + fn child_storage_key_or_panic(_a: u64) -> u64 { + return _a; + } - fn child_read(_a: u64, _b: u64, _c: u32, _d: u64, _e: u64, _f: u32) -> Option { - return Some(_c); - } + fn child_read(_a: u64, _b: u64, _c: u32, _d: u64, _e: u64, _f: u32) -> Option { + return Some(_c); + } - fn child_clear(_a: u64, _b: u64, _c: u32, _d: u64) { - return; - } + fn child_clear(_a: u64, _b: u64, _c: u32, _d: u64) { + return; + } - fn child_set(_a: u64, _b: u64, _c: u32, _d: u64, _e: u64) { - return; - } - - /* - Not sure if these will be needed in the future but - commenting out since combing the git history is annoying - */ + fn child_set(_a: u64, _b: u64, _c: u32, _d: u64, _e: u64) { + return; + } - // fn child_exists(_a: u64, _b: u64, _c: u32, _d: u64) -> bool { - // return false; - // } + /* + Not sure if these will be needed in the future but + commenting out since combing the git history is annoying + */ - // fn child_clear_prefix(_a: u64, _b: u64, _c: u32, _d: u64) { - // return; - // } + // fn child_exists(_a: u64, _b: u64, _c: u32, _d: u64) -> bool { + // return false; + // } - // fn child_next_key(_a: u64, _b: u64, _c: u32, _d: u64) -> Option { - // return; - // } + // fn child_clear_prefix(_a: u64, _b: u64, _c: u32, _d: u64) { + // return; + // } + + // fn child_next_key(_a: u64, _b: u64, _c: u32, _d: u64) -> Option { + // return; + // } } diff --git a/node/runtime/Cargo.toml b/node/runtime/Cargo.toml index 4ef33331..b98734aa 100644 --- a/node/runtime/Cargo.toml +++ b/node/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "edgeware-runtime" -version = "3.2.0" +version = "3.3.0" authors = ["Commonwealth Labs "] edition = "2018" build = "build.rs" @@ -17,100 +17,127 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] # third-party dependencies -codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } integer-sqrt = { version = "0.1.2" } safe-mix = { version = "1.0", default-features = false } rustc-hex = { version = "2.0", optional = true } serde = { version = "1.0.102", optional = true } static_assertions = "1.1.0" -evm-runtime = { version = "0.21.0", default-features = false } +evm-runtime = { version = "0.27.0", default-features = false } +log = { version = "0.4.14", default-features = false } # primitives -sp-application-crypto = { version = "2.0", default-features = false } -sp-authority-discovery = { version = "2.0", default-features = false } -sp-consensus-aura = { version = "0.8", default-features = false } -sp-block-builder = { version = "2.0", default-features = false} -sp-inherents = { version = "2.0", default-features = false } -sp-core = { version = "2.0", default-features = false } -sp-io = { version = "2.0", default-features = false } -sp-std = { version = "2.0", default-features = false } -sp-api = { version = "2.0", default-features = false } -sp-runtime = { version = "2.0", default-features = false } -sp-staking = { version = "2.0", default-features = false } -sp-keyring = { version = "2.0", optional = true } -sp-session = { version = "2.0", default-features = false } -sp-transaction-pool = { version = "2.0", default-features = false } -sp-version = { version = "2.0", default-features = false } -sp-offchain = { version = "2.0", default-features = false } +sp-application-crypto = { version = "3.0", default-features = false } +sp-authority-discovery = { version = "3.0", default-features = false } +sp-consensus-aura = { version = "0.9", default-features = false } +sp-block-builder = { version = "3.0", default-features = false} +sp-inherents = { version = "3.0", default-features = false } +sp-core = { version = "3.0", default-features = false } +sp-io = { version = "3.0", default-features = false } +sp-std = { version = "3.0", default-features = false } +sp-api = { version = "3.0", default-features = false } +sp-runtime = { version = "3.0", default-features = false } +sp-staking = { version = "3.0", default-features = false } +sp-keyring = { version = "3.0", optional = true } +sp-session = { version = "3.0", default-features = false } +sp-transaction-pool = { version = "3.0", default-features = false } +sp-version = { version = "3.0", default-features = false } +sp-offchain = { version = "3.0", default-features = false } +sp-npos-elections = { version = "3.0", default-features = false } # edgeware primitives -edgeware-primitives = { version = "3.2.0", path = "../primitives", default-features = false } +edgeware-primitives = { version = "3.3.0", path = "../primitives", default-features = false } +edgeware-evm-tracer = { path = "../evm_tracer", default-features = false } +edgeware-rpc-primitives-debug = { path = "../debug", default-features = false } +edgeware-rpc-primitives-txpool = { path = "../txpool", default-features = false } # pallet dependencies -pallet-authority-discovery = { version = "2.0", default-features = false } -pallet-authorship = { version = "2.0", default-features = false } -pallet-aura = { version = "2.0", default-features = false } -pallet-balances = { version = "2.0", default-features = false } -pallet-collective = { version = "2.0", default-features = false, features = ["runtime-benchmarks"] } -pallet-contracts = { default-features = false, version = "2.0" } -pallet-contracts-primitives = { default-features = false, version = "2.0" } -pallet-contracts-rpc-runtime-api = { default-features = false, version = "0.8" } -pallet-democracy = { version = "2.0", default-features = false } -pallet-elections-phragmen = { version = "2.0", default-features = false } -frame-executive = { version = "2.0", default-features = false } -pallet-grandpa = { version = "2.0", default-features = false } -pallet-identity = { version = "2.0", default-features = false } -pallet-im-online = { version = "2.0", default-features = false } -pallet-indices = { version = "2.0", default-features = false } -pallet-multisig = { version = "2.0", default-features = false } -pallet-offences = { version = "2.0", default-features = false } -pallet-proxy = { version = "2.0", default-features = false } -pallet-randomness-collective-flip = { version = "2.0", default-features = false } -pallet-recovery = { version = "2.0", default-features = false } -pallet-scheduler = { version = "2.0", default-features = false } -pallet-session = { version = "2.0", default-features = false, features = ["historical"] } -pallet-staking = { version = "2.0", default-features = false } -pallet-staking-reward-curve = { version = "2.0" } -pallet-sudo = { version = "2.0", default-features = false } -frame-support = { version = "2.0", default-features = false } -frame-system = { version = "2.0", default-features = false } -frame-system-rpc-runtime-api = { version = "2.0", default-features = false } -pallet-timestamp = { version = "2.0", default-features = false } -pallet-treasury = { version = "2.0", default-features = false } -pallet-tips = { version = "2.0", default-features = false } -pallet-bounties = { version = "2.0", default-features = false } -pallet-utility = { version = "2.0", default-features = false } -pallet-transaction-payment = { version = "2.0", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { version = "2.0", default-features = false } -pallet-vesting = { version = "2.0", default-features = false } - -treasury-reward = { package = "edge-treasury-reward", path = "../../modules/edge-treasury-reward", default-features = false } -edge-chainbridge = { path = "../../modules/edge-chainbridge", default-features = false } -chainbridge = { path = "../../modules/chainbridge", default-features = false } -edge-assets = { path = "../../modules/edge-assets", default-features = false } - -fp-rpc = { version = "0.1", default-features = false } -pallet-ethereum = { version = "0.1", default-features = false } -pallet-evm = { version = "2.0", default-features = false } -pallet-evm-precompile-simple = { version = "2.0", default-features = false } -pallet-evm-precompile-modexp = { version = "2.0", default-features = false } -pallet-evm-precompile-ed25519 = { version = "2.0", default-features = false } +pallet-assets = { version = "3.0", default-features = false } +pallet-authority-discovery = { version = "3.0", default-features = false } +pallet-authorship = { version = "3.0", default-features = false } +pallet-aura = { version = "3.0", default-features = false } +pallet-balances = { version = "3.0", default-features = false } +pallet-collective = { version = "3.0", default-features = false, features = ["runtime-benchmarks"] } +pallet-contracts = { default-features = false, version = "3.0" } +pallet-contracts-primitives = { default-features = false, version = "3.0" } +pallet-contracts-rpc-runtime-api = { default-features = false, version = "3.0" } +pallet-democracy = { version = "3.0", default-features = false } +pallet-election-provider-multi-phase = { version = "3.0", default-features = false } +pallet-elections-phragmen = { version = "4.0", default-features = false } + +frame-executive = { version = "3.0", default-features = false } +pallet-grandpa = { version = "3.0", default-features = false } +pallet-identity = { version = "3.0", default-features = false } +pallet-im-online = { version = "3.0", default-features = false } +pallet-indices = { version = "3.0", default-features = false } +pallet-multisig = { version = "3.0", default-features = false } +pallet-offences = { version = "3.0", default-features = false } +pallet-proxy = { version = "3.0", default-features = false } +pallet-randomness-collective-flip = { version = "3.0", default-features = false } +pallet-recovery = { version = "3.0", default-features = false } +pallet-scheduler = { version = "3.0", default-features = false } +pallet-session = { version = "3.0", default-features = false, features = ["historical"] } +pallet-staking = { version = "3.0", default-features = false } +pallet-staking-reward-curve = { version = "3.0" } +pallet-sudo = { version = "3.0", default-features = false } +frame-support = { version = "3.0", default-features = false } +frame-system = { version = "3.0", default-features = false } +frame-system-rpc-runtime-api = { version = "3.0", default-features = false } +pallet-timestamp = { version = "3.0", default-features = false } +pallet-treasury = { version = "3.0", default-features = false } +pallet-tips = { version = "3.0", default-features = false } +pallet-bounties = { version = "3.0", default-features = false } +pallet-utility = { version = "3.0", default-features = false } +pallet-transaction-payment = { version = "3.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { version = "3.0", default-features = false } +pallet-vesting = { version = "3.0", default-features = false } + +treasury-reward = { package = "edge-treasury-reward", path = "../../pallets/edge-treasury-reward", default-features = false } +orml-nft = { path = "../../pallets/orml-nft", default-features = false } +nft = { package = "module-nft", path = "../../pallets/nft", default-features = false } + +pallet-dynamic-fee = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +fp-rpc = { default-features = false, git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes" } +pallet-evm = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } +pallet-ethereum = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } +pallet-evm-precompile-simple = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } +pallet-evm-precompile-modexp = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } +pallet-evm-precompile-dispatch = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } +pallet-evm-precompile-ed25519 = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } +pallet-evm-precompile-sha3fips = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } +pallet-evm-precompile-curve25519 = { git = "https://github.com/webb-tools/frontier", branch = "erup-4-minimal-changes", default-features = false } + +sha3 = { version = "0.9", default-features = false } + +merkle = { package = "pallet-merkle", default-features = false, git = "https://github.com/webb-tools/anon", branch = "erup-4" } +mixer = { package = "pallet-mixer", default-features = false, git = "https://github.com/webb-tools/anon", branch = "erup-4" } +merkle-rpc = { package = "pallet-merkle-rpc", git = "https://github.com/webb-tools/anon", branch = "erup-4", optional = true } +webb-currencies = { default-features = false, git = "https://github.com/webb-tools/anon", branch = "erup-4" } +webb-tokens = { default-features = false, git = "https://github.com/webb-tools/anon", branch = "erup-4" } +webb-traits = { default-features = false, git = "https://github.com/webb-tools/anon", branch = "erup-4" } + +evm = { version = "0.27.0", default-features = false, features = ["with-codec"] } # used for runtime benchmarking -frame-benchmarking = { version = "2.0", default-features = false, optional = true } -frame-system-benchmarking = { version = "2.0", default-features = false, optional = true } +frame-benchmarking = { version = "3.0", default-features = false, optional = true } +frame-system-benchmarking = { version = "3.0", default-features = false, optional = true } hex-literal = { version = "0.3.1", optional = true } [build-dependencies] substrate-wasm-builder = { package = "substrate-wasm-builder", version = "3.0.0" } [dev-dependencies] -sp-io = { version = "2.0" } +sp-io = { version = "3.0" } [features] default = ["std"] +no-reaping = [] std = [ + "sha3/std", "sp-authority-discovery/std", + "pallet-assets/std", "pallet-authority-discovery/std", "pallet-authorship/std", "sp-consensus-aura/std", @@ -124,6 +151,7 @@ std = [ "pallet-contracts-rpc-runtime-api/std", "pallet-democracy/std", "pallet-elections-phragmen/std", + "pallet-election-provider-multi-phase/std", "frame-executive/std", "pallet-grandpa/std", "pallet-identity/std", @@ -164,17 +192,31 @@ std = [ "sp-offchain/std", "edgeware-primitives/std", "treasury-reward/std", - "edge-chainbridge/std", - "chainbridge/std", - "edge-assets/std", "fp-rpc/std", "pallet-ethereum/std", "evm-runtime/std", + "evm/std", "pallet-evm-precompile-simple/std", "pallet-evm-precompile-modexp/std", "pallet-evm-precompile-ed25519/std", + "pallet-evm-precompile-bn128/std", + "pallet-evm-precompile-dispatch/std", + "pallet-evm-precompile-sha3fips/std", + "pallet-evm-precompile-blake2/std", + "pallet-evm-precompile-curve25519/std", "pallet-tips/std", "pallet-bounties/std", + "sp-npos-elections/std", + "merkle/std", + "merkle-rpc", + "mixer/std", + "webb-currencies/std", + "webb-tokens/std", + "orml-nft/std", + "nft/std", + "edgeware-evm-tracer/std", + "edgeware-rpc-primitives-debug/std", + "edgeware-rpc-primitives-txpool/std", ] runtime-benchmarks = [ @@ -183,6 +225,4 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "frame-system-benchmarking", "hex-literal", - "chainbridge/runtime-benchmarks", - "edge-assets/runtime-benchmarks", ] \ No newline at end of file diff --git a/node/runtime/build.rs b/node/runtime/build.rs index c1fa7498..a0998970 100644 --- a/node/runtime/build.rs +++ b/node/runtime/build.rs @@ -22,4 +22,4 @@ fn main() { .export_heap_base() .import_memory() .build() -} \ No newline at end of file +} diff --git a/node/runtime/src/constants.rs b/node/runtime/src/constants.rs index acc64ff4..3c71076f 100644 --- a/node/runtime/src/constants.rs +++ b/node/runtime/src/constants.rs @@ -18,9 +18,7 @@ /// Money matters. pub mod currency { - use edgeware_primitives::Balance; - - pub type AssetId = u32; + pub use edgeware_primitives::{Balance, AssetId, Amount, CurrencyId}; pub const MILLICENTS: Balance = 10_000_000_000_000; pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent. diff --git a/node/runtime/src/impls.rs b/node/runtime/src/impls.rs index 89f5095d..9e335ec5 100644 --- a/node/runtime/src/impls.rs +++ b/node/runtime/src/impls.rs @@ -14,10 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Edgeware. If not, see . -//! Some configurable implementations as associated type for the substrate runtime. +//! Some configurable implementations as associated type for the substrate +//! runtime. -use frame_support::traits::{OnUnbalanced, Currency}; -use crate::{Balances, Authorship, NegativeImbalance}; +use crate::{Authorship, Balances, NegativeImbalance}; +use frame_support::traits::{Currency, OnUnbalanced}; pub struct Author; impl OnUnbalanced for Author { diff --git a/node/runtime/src/lib.rs b/node/runtime/src/lib.rs index 582ef9a5..132f7a6c 100644 --- a/node/runtime/src/lib.rs +++ b/node/runtime/src/lib.rs @@ -14,102 +14,118 @@ // You should have received a copy of the GNU General Public License // along with Edgeware. If not, see . -//! The Substrate runtime. This can be compiled with ``#[no_std]`, ready for Wasm. +//! The Substrate runtime. This can be compiled with ``#[no_std]`, ready for +//! Wasm. #![cfg_attr(not(feature = "std"), no_std)] // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit = "256"] -use sp_std::{prelude::*, convert::TryFrom, marker::PhantomData}; +use sp_std::{convert::TryFrom, marker::PhantomData, prelude::*}; -pub use edgeware_primitives::{ - AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, Moment, Signature, Nonce, -}; +pub use edgeware_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, Moment, Nonce, Signature}; use frame_support::{ - construct_runtime, parameter_types, debug, RuntimeDebug, ConsensusEngineId, + construct_runtime, parameter_types, + traits::{ + Currency, FindAuthor, Imbalance, KeyOwnerProofSystem, LockIdentifier, MaxEncodedLen, OnUnbalanced, + U128CurrencyToVote, + }, weights::{ - Weight, IdentityFee, - constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, DispatchClass, + constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, + DispatchClass, IdentityFee, Weight, }, - traits::{Currency, FindAuthor, Imbalance, KeyOwnerProofSystem, OnUnbalanced, Randomness, LockIdentifier, U128CurrencyToVote}, + ConsensusEngineId, PalletId, RuntimeDebug, }; -use frame_system::{EnsureRoot, EnsureOneOf}; -use frame_system::limits::{BlockLength, BlockWeights}; +use codec::{Decode, Encode}; use frame_support::traits::InstanceFilter; -use codec::{Encode, Decode}; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + EnsureOneOf, EnsureRoot, +}; + +use edgeware_rpc_primitives_txpool::TxPoolResponse; +use pallet_ethereum::{Call::transact, Transaction as EthereumTransaction}; -pub use pallet_grandpa::fg_primitives; -pub use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; +pub use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; pub use pallet_im_online::ed25519::AuthorityId as ImOnlineId; +pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; +use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; pub use sp_api::impl_runtime_apis; pub use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; -pub use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; -pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, CurrencyAdapter}; pub use sp_consensus_aura::ed25519::AuthorityId as AuraId; pub use sp_core::{ crypto::KeyTypeId, u32_trait::{_1, _2, _3, _4, _5}, - OpaqueMetadata, U256, H160, H256, + OpaqueMetadata, H160, H256, U256, }; -use sp_io::hashing::blake2_128; + use sp_runtime::{ - Permill, Perbill, Perquintill, Percent, ApplyExtrinsicResult, - impl_opaque_keys, generic, create_runtime_str, ModuleId, FixedPointNumber, + create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, FixedPointNumber, Perbill, Percent, Permill, + Perquintill, }; -pub use sp_runtime::curve::PiecewiseLinear; use sp_runtime::traits::{ - self, BlakeTwo256, Block as BlockT, StaticLookup, SaturatedConversion, - ConvertInto, OpaqueKeys, NumberFor, + self, BlakeTwo256, Block as BlockT, ConvertInto, NumberFor, OpaqueKeys, SaturatedConversion, StaticLookup, +}; +pub use sp_runtime::{ + curve::PiecewiseLinear, + transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, }; -pub use sp_runtime::transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority}; +use sp_core::crypto::Public; #[cfg(any(feature = "std", test))] pub use sp_version::NativeVersion; -use sp_core::crypto::Public; pub use sp_version::RuntimeVersion; -pub use pallet_session::{historical as pallet_session_historical}; +pub use pallet_session::historical as pallet_session_historical; -use pallet_evm::{ - Account as EVMAccount, FeeCalculator, HashedAddressMapping, - EnsureAddressTruncated, Runner -}; -use fp_rpc::{TransactionStatus}; use evm_runtime::Config as EvmConfig; +use fp_rpc::TransactionStatus; +use pallet_evm::{Account as EVMAccount, EnsureAddressTruncated, HashedAddressMapping, Runner}; pub use sp_inherents::{CheckInherentsResult, InherentData}; use static_assertions::const_assert; -use pallet_contracts::WeightInfo; #[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; +pub use frame_system::Call as SystemCall; #[cfg(any(feature = "std", test))] pub use pallet_balances::Call as BalancesCall; #[cfg(any(feature = "std", test))] -pub use frame_system::Call as SystemCall; -#[cfg(any(feature = "std", test))] pub use pallet_staking::StakerStatus; -/// Implementations of some helper traits passed into runtime modules as associated types. +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; +/// Implementations of some helper traits passed into runtime modules as +/// associated types. pub mod impls; -use impls::{Author}; +use impls::Author; + +pub mod precompiles; +pub use precompiles::EdgewarePrecompiles; /// Constant values used within the runtime. pub mod constants; use constants::{currency::*, time::*}; +use pallet_contracts::weights::WeightInfo; use sp_runtime::generic::Era; +use merkle::{utils::keys::ScalarData, weights::Weights as MerkleWeights}; +use mixer::weights::Weights as MixerWeights; +use webb_currencies::BasicCurrencyAdapter; + // Make the WASM binary available. #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); #[cfg(feature = "std")] -/// Wasm binary unwrapped. If built with `BUILD_DUMMY_WASM_BINARY`, the function panics. +/// Wasm binary unwrapped. If built with `BUILD_DUMMY_WASM_BINARY`, the function +/// panics. pub fn wasm_binary_unwrap() -> &'static [u8] { - WASM_BINARY.expect("Development wasm binary is not available. This means the client is \ + WASM_BINARY.expect( + "Development wasm binary is not available. This means the client is \ built with `BUILD_DUMMY_WASM_BINARY` flag and it is only usable for \ - production chains. Please rebuild with the flag disabled.") + production chains. Please rebuild with the flag disabled.", + ) } /// Runtime version. @@ -121,10 +137,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to equal spec_version. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 45, - impl_version: 45, + spec_version: 47, + impl_version: 47, apis: RUNTIME_API_VERSIONS, - transaction_version: 1, + transaction_version: 2, }; /// Native version. @@ -145,7 +161,8 @@ impl OnUnbalanced for DealWithFees { // for fees, 80% to treasury, 20% to author let mut split = fees.ration(80, 20); if let Some(tips) = fees_then_tips.next() { - // for tips, if any, 80% to treasury, 20% to author (though this can be anything) + // for tips, if any, 80% to treasury, 20% to author (though this can be + // anything) tips.ration_merge_into(80, 20, &mut split); } Treasury::on_unbalanced(split.0); @@ -154,11 +171,11 @@ impl OnUnbalanced for DealWithFees { } } -/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers. -/// This is used to limit the maximal weight of a single extrinsic. +/// We assume that ~10% of the block weight is consumed by `on_initalize` +/// handlers. This is used to limit the maximal weight of a single extrinsic. const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); -/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used -/// by Operational extrinsics. +/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be +/// used by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 2 seconds of compute with a 6 second average block time. const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND; @@ -190,33 +207,34 @@ parameter_types! { } impl frame_system::Config for Runtime { + type AccountData = pallet_balances::AccountData; + type AccountId = AccountId; type BaseCallFilter = (); - type BlockWeights = RuntimeBlockWeights; + type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; - type DbWeight = RocksDbWeight; - type Origin = Origin; - type Call = Call; - type Index = Index; type BlockNumber = BlockNumber; + type BlockWeights = RuntimeBlockWeights; + type Call = Call; + type DbWeight = RocksDbWeight; + type Event = Event; type Hash = Hash; type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = Indices; type Header = generic::Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type Version = Version; - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); + type Index = Index; + type Lookup = Indices; type OnKilledAccount = (); - type SystemWeightInfo = frame_system::weights::SubstrateWeight; + type OnNewAccount = (); + type OnSetCode = (); + type Origin = Origin; + type PalletInfo = PalletInfo; type SS58Prefix = SS58Prefix; + type SystemWeightInfo = frame_system::weights::SubstrateWeight; + type Version = Version; } impl pallet_utility::Config for Runtime { - type Event = Event; type Call = Call; + type Event = Event; type WeightInfo = pallet_utility::weights::SubstrateWeight; } @@ -229,11 +247,11 @@ parameter_types! { } impl pallet_multisig::Config for Runtime { - type Event = Event; type Call = Call; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; + type Event = Event; type MaxSignatories = MaxSignatories; type WeightInfo = pallet_multisig::weights::SubstrateWeight; } @@ -251,64 +269,43 @@ parameter_types! { /// The type used to represent the kinds of proxying allowed. #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug)] +#[repr(u8)] pub enum ProxyType { Any = 0, NonTransfer = 1, Governance = 2, Staking = 3, - // Skip 4 as it is now removed (was SudoBalances) - IdentityJudgement = 5, } -impl Default for ProxyType { fn default() -> Self { Self::Any } } +impl MaxEncodedLen for ProxyType { + fn max_encoded_len() -> usize { + 1 // one byte + } +} + +impl Default for ProxyType { + fn default() -> Self { + Self::Any + } +} impl InstanceFilter for ProxyType { fn filter(&self, c: &Call) -> bool { match self { ProxyType::Any => true, - ProxyType::NonTransfer => matches!(c, - Call::System(..) | - Call::Scheduler(..) | - Call::Timestamp(..) | - Call::Indices(pallet_indices::Call::claim(..)) | - Call::Indices(pallet_indices::Call::free(..)) | - Call::Indices(pallet_indices::Call::freeze(..)) | - // Specifically omitting Indices `transfer`, `force_transfer` - // Specifically omitting the entire Balances pallet - Call::Authorship(..) | - Call::Staking(..) | - Call::Offences(..) | - Call::Session(..) | - Call::Grandpa(..) | - Call::ImOnline(..) | - Call::AuthorityDiscovery(..) | - Call::Democracy(..) | - Call::Council(..) | - Call::Treasury(..) | - Call::Vesting(pallet_vesting::Call::vest(..)) | - Call::Vesting(pallet_vesting::Call::vest_other(..)) | - // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` - Call::Utility(..) | - Call::Identity(..) | - Call::Proxy(..) | - Call::Multisig(..) - ), - ProxyType::Governance => matches!(c, - Call::Democracy(..) | - Call::Council(..) | - Call::Treasury(..) | - Call::Utility(..) + ProxyType::NonTransfer => !matches!( + c, + Call::Balances(..) + | Call::Vesting(pallet_vesting::Call::vested_transfer(..)) + | Call::Indices(pallet_indices::Call::transfer(..)) ), - ProxyType::Staking => matches!(c, - Call::Staking(..) | - Call::Session(..) | - Call::Utility(..) + ProxyType::Governance => matches!( + c, + Call::Democracy(..) | Call::Council(..) | Call::PhragmenElection(..) | Call::Treasury(..) ), - ProxyType::IdentityJudgement => matches!(c, - Call::Identity(pallet_identity::Call::provide_judgement(..)) | - Call::Utility(..) - ) + ProxyType::Staking => matches!(c, Call::Staking(..)), } } + fn is_superset(&self, o: &Self) -> bool { match (self, o) { (x, y) if x == y => true, @@ -321,18 +318,18 @@ impl InstanceFilter for ProxyType { } impl pallet_proxy::Config for Runtime { - type Event = Event; + type AnnouncementDepositBase = AnnouncementDepositBase; + type AnnouncementDepositFactor = AnnouncementDepositFactor; type Call = Call; + type CallHasher = BlakeTwo256; type Currency = Balances; - type ProxyType = ProxyType; + type Event = Event; + type MaxPending = MaxPending; + type MaxProxies = MaxProxies; type ProxyDepositBase = ProxyDepositBase; type ProxyDepositFactor = ProxyDepositFactor; - type MaxProxies = MaxProxies; + type ProxyType = ProxyType; type WeightInfo = pallet_proxy::weights::SubstrateWeight; - type MaxPending = MaxPending; - type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; } parameter_types! { @@ -341,13 +338,13 @@ parameter_types! { } impl pallet_scheduler::Config for Runtime { + type Call = Call; type Event = Event; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type MaximumWeight = MaximumSchedulerWeight; type Origin = Origin; type PalletsOrigin = OriginCaller; - type Call = Call; - type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; - type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = pallet_scheduler::weights::SubstrateWeight; } @@ -367,6 +364,15 @@ impl pallet_indices::Config for Runtime { type WeightInfo = pallet_indices::weights::SubstrateWeight; } +#[cfg(feature = "no-reaping")] +parameter_types! { + pub const ExistentialDeposit: Balance = 0; + // For weight estimation, we assume that the most locks on an individual account will be 50. + // This number may need to be adjusted in the future if this assumption no longer holds true. + pub const MaxLocks: u32 = 50; +} + +#[cfg(not(feature = "no-reaping"))] parameter_types! { pub const ExistentialDeposit: Balance = 1 * MILLICENTS; // For weight estimation, we assume that the most locks on an individual account will be 50. @@ -375,12 +381,12 @@ parameter_types! { } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; + type AccountStore = frame_system::Pallet; type Balance = Balance; type DustRemoval = (); type Event = Event; type ExistentialDeposit = ExistentialDeposit; - type AccountStore = frame_system::Module; + type MaxLocks = MaxLocks; type WeightInfo = pallet_balances::weights::SubstrateWeight; } @@ -392,11 +398,10 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { + type FeeMultiplierUpdate = TargetedFeeAdjustment; type OnChargeTransaction = CurrencyAdapter; type TransactionByteFee = TransactionByteFee; type WeightToFee = IdentityFee; - type FeeMultiplierUpdate = - TargetedFeeAdjustment; } parameter_types! { @@ -404,9 +409,9 @@ parameter_types! { } impl pallet_timestamp::Config for Runtime { + type MinimumPeriod = MinimumPeriod; type Moment = Moment; type OnTimestampSet = Aura; - type MinimumPeriod = MinimumPeriod; type WeightInfo = pallet_timestamp::weights::SubstrateWeight; } @@ -415,10 +420,10 @@ parameter_types! { } impl pallet_authorship::Config for Runtime { + type EventHandler = (Staking, ImOnline); + type FilterUncle = (); type FindAuthor = pallet_session::FindAccountFromAuthorIndex; type UncleGenerations = UncleGenerations; - type FilterUncle = (); - type EventHandler = (Staking, ImOnline); } impl_opaque_keys! { @@ -437,15 +442,15 @@ parameter_types! { } impl pallet_session::Config for Runtime { + type DisabledValidatorsThreshold = DisabledValidatorsThreshold; type Event = Event; - type ValidatorId = ::AccountId; - type ValidatorIdOf = pallet_staking::StashOf; - type ShouldEndSession = pallet_session::PeriodicSessions; + type Keys = SessionKeys; type NextSessionRotation = pallet_session::PeriodicSessions; - type SessionManager = pallet_session::historical::NoteHistoricalRoot; type SessionHandler = ::KeyTypeIdProviders; - type Keys = SessionKeys; - type DisabledValidatorsThreshold = DisabledValidatorsThreshold; + type SessionManager = pallet_session::historical::NoteHistoricalRoot; + type ShouldEndSession = pallet_session::PeriodicSessions; + type ValidatorId = ::AccountId; + type ValidatorIdOf = pallet_staking::StashOf; type WeightInfo = pallet_session::weights::SubstrateWeight; } @@ -477,41 +482,97 @@ parameter_types! { pub const MaxNominatorRewardedPerValidator: u32 = 128; pub const MaxIterations: u32 = 5; // 0.05%. The higher the value, the more strict solution acceptance becomes. - pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000); + pub MinSolutionScoreBump: Perbill = Perbill::from_rational(5u32, 10_000); pub OffchainSolutionWeightLimit: Weight = RuntimeBlockWeights::get() .get(DispatchClass::Normal) .max_extrinsic.expect("Normal extrinsics have a weight limit configured; qed") .saturating_sub(BlockExecutionWeight::get()); } +parameter_types! { + // phase durations. 1/4 of the last session for each. + pub const SignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; + pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; + + // fallback: no need to do on-chain phragmen initially. + pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = + pallet_election_provider_multi_phase::FallbackStrategy::OnChain; + + pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(1u32, 10_000); + + // miner configs + pub const MultiPhaseUnsignedPriority: TransactionPriority = StakingUnsignedPriority::get() - 1u64; + pub const MinerMaxIterations: u32 = 10; + pub MinerMaxWeight: Weight = RuntimeBlockWeights::get() + .get(DispatchClass::Normal) + .max_extrinsic.expect("Normal extrinsics have a weight limit configured; qed") + .saturating_sub(BlockExecutionWeight::get()); + // Solution can occupy 90% of normal block size + pub MinerMaxLength: u32 = Perbill::from_rational(9u32, 10) * + *RuntimeBlockLength::get() + .max + .get(DispatchClass::Normal); + + pub OffchainRepeat: BlockNumber = 5; +} + +sp_npos_elections::generate_solution_type!( + #[compact] + pub struct NposCompactSolution16::< + VoterIndex = u32, + TargetIndex = u16, + Accuracy = sp_runtime::PerU16, + >(16) +); + +pub const MAX_NOMINATIONS: u32 = ::LIMIT as u32; + +impl pallet_election_provider_multi_phase::Config for Runtime { + type BenchmarkingConfig = (); + type CompactSolution = NposCompactSolution16; + type Currency = Balances; + type DataProvider = Staking; + type Event = Event; + type Fallback = Fallback; + type MinerMaxIterations = MinerMaxIterations; + type MinerMaxLength = MinerMaxLength; + type MinerMaxWeight = MinerMaxWeight; + type MinerTxPriority = MultiPhaseUnsignedPriority; + type OffchainRepeat = OffchainRepeat; + type OnChainAccuracy = Perbill; + type SignedPhase = SignedPhase; + type SolutionImprovementThreshold = SolutionImprovementThreshold; + type UnsignedPhase = UnsignedPhase; + type WeightInfo = pallet_election_provider_multi_phase::weights::SubstrateWeight; +} + impl pallet_staking::Config for Runtime { + type BondingDuration = BondingDuration; type Currency = Balances; - type UnixTime = Timestamp; type CurrencyToVote = U128CurrencyToVote; - type RewardRemainder = Treasury; + type ElectionProvider = ElectionProviderMultiPhase; + type EraPayout = pallet_staking::ConvertCurve; type Event = Event; - type Slash = Treasury; // send the slashed funds to the treasury. - type Reward = (); // rewards are minted from the void + type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; + type NextNewSession = Session; + // send the slashed funds to the treasury. + type Reward = (); + type RewardRemainder = Treasury; + type SessionInterface = Self; + // rewards are minted from the void type SessionsPerEra = SessionsPerEra; - type BondingDuration = BondingDuration; - type SlashDeferDuration = SlashDeferDuration; + type Slash = Treasury; /// A super-majority of the council can cancel the slash. type SlashCancelOrigin = EnsureOneOf< AccountId, EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective> + pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>, >; - type SessionInterface = Self; - type RewardCurve = RewardCurve; - type NextNewSession = Session; - type ElectionLookahead = ElectionLookahead; - type Call = Call; - type MaxIterations = MaxIterations; - type MinSolutionScoreBump = MinSolutionScoreBump; - type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; - type UnsignedPriority = StakingUnsignedPriority; - type OffchainSolutionWeightLimit = OffchainSolutionWeightLimit; + type SlashDeferDuration = SlashDeferDuration; + type UnixTime = Timestamp; type WeightInfo = pallet_staking::weights::SubstrateWeight; + + const MAX_NOMINATIONS: u32 = MAX_NOMINATIONS; } parameter_types! { @@ -528,107 +589,117 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = Call; - type Event = Event; - type Currency = Balances; - type EnactmentPeriod = EnactmentPeriod; - type LaunchPeriod = LaunchPeriod; - type VotingPeriod = VotingPeriod; - type MinimumDeposit = MinimumDeposit; - /// A straight majority of the council can decide what their next motion is. - type ExternalOrigin = pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; - /// A 60% super-majority can have the next scheduled referendum be a straight majority-carries vote. - type ExternalMajorityOrigin = frame_system::EnsureOneOf, - frame_system::EnsureRoot, + type BlacklistOrigin = EnsureRoot; + // To cancel a proposal before it has been passed, the technical committee must + // be unanimous or Root must agree. + type CancelProposalOrigin = EnsureOneOf< + AccountId, + EnsureRoot, + pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>, >; - /// Three fourths of the committee can have an ExternalMajority/ExternalDefault vote - /// be tabled immediately and with a shorter voting/enactment period. - type FastTrackOrigin = frame_system::EnsureOneOf, + // To cancel a proposal which has been passed, 2/3 of the council must agree to + // it. + type CancellationOrigin = frame_system::EnsureOneOf< + AccountId, + pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>, frame_system::EnsureRoot, >; - type InstantOrigin = frame_system::EnsureNever; - type InstantAllowed = InstantAllowed; - type FastTrackVotingPeriod = FastTrackVotingPeriod; - /// A unanimous council can have the next scheduled referendum be a straight default-carries - /// (NTB) vote. - type ExternalDefaultOrigin = frame_system::EnsureOneOf, frame_system::EnsureRoot, >; - // To cancel a proposal which has been passed, 2/3 of the council must agree to it. - type CancellationOrigin = frame_system::EnsureOneOf, + /// A 60% super-majority can have the next scheduled referendum be a + /// straight majority-carries vote. + type ExternalMajorityOrigin = frame_system::EnsureOneOf< + AccountId, + pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, frame_system::EnsureRoot, >; - // To cancel a proposal before it has been passed, the technical committee must be unanimous or - // Root must agree. - type CancelProposalOrigin = EnsureOneOf< + /// A straight majority of the council can decide what their next motion is. + type ExternalOrigin = pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; + /// Three fourths of the committee can have an + /// ExternalMajority/ExternalDefault vote be tabled immediately and with a + /// shorter voting/enactment period. + type FastTrackOrigin = frame_system::EnsureOneOf< AccountId, - EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>, + pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>, + frame_system::EnsureRoot, >; - type BlacklistOrigin = EnsureRoot; - // No vetoing - type VetoOrigin = frame_system::EnsureNever; - type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; + type FastTrackVotingPeriod = FastTrackVotingPeriod; + type InstantAllowed = InstantAllowed; + type InstantOrigin = frame_system::EnsureNever; + type LaunchPeriod = LaunchPeriod; + type MaxProposals = MaxProposals; + type MaxVotes = MaxVotes; + type MinimumDeposit = MinimumDeposit; type OperationalPreimageOrigin = pallet_collective::EnsureMember; - type Slash = Treasury; - type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; - type MaxVotes = MaxVotes; + type PreimageByteDeposit = PreimageByteDeposit; + type Proposal = Call; + type Scheduler = Scheduler; + type Slash = Treasury; + // No vetoing + type VetoOrigin = frame_system::EnsureNever; + type VotingPeriod = VotingPeriod; type WeightInfo = pallet_democracy::weights::SubstrateWeight; - type MaxProposals = MaxProposals; } parameter_types! { pub const CouncilMotionDuration: BlockNumber = 14 * DAYS; pub const CouncilMaxProposals: u32 = 100; + pub const CouncilMaxMembers: u32 = 100; } type CouncilCollective = pallet_collective::Instance1; impl pallet_collective::Config for Runtime { - type Origin = Origin; - type Proposal = Call; + type DefaultVote = pallet_collective::PrimeDefaultVote; type Event = Event; - type MotionDuration = CouncilMotionDuration; - type MaxProposals = CouncilMaxProposals; type MaxMembers = CouncilMaxMembers; - type DefaultVote = pallet_collective::PrimeDefaultVote; + type MaxProposals = CouncilMaxProposals; + type MotionDuration = CouncilMotionDuration; + type Origin = Origin; + type Proposal = Call; type WeightInfo = pallet_collective::weights::SubstrateWeight; } parameter_types! { pub const CandidacyBond: Balance = 1_000 * DOLLARS; - pub const VotingBond: Balance = 10 * DOLLARS; + // 1 storage item created, key size is 32 bytes, value size is 16+16. + pub const VotingBondBase: Balance = deposit(1, 64); + // additional data per vote is 32 bytes (account id). + pub const VotingBondFactor: Balance = deposit(0, 32); pub const TermDuration: BlockNumber = 28 * DAYS; pub const DesiredMembers: u32 = 13; pub const DesiredRunnersUp: u32 = 7; - pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect"; - pub const CouncilMaxMembers: u32 = 100; + pub const ElectionsPhragmenPalletId: LockIdentifier = *b"phrelect"; } const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get()); impl pallet_elections_phragmen::Config for Runtime { - type Event = Event; - type ModuleId = ElectionsPhragmenModuleId; - type Currency = Balances; + type CandidacyBond = CandidacyBond; type ChangeMembers = Council; - // NOTE: this implies that council's genesis members cannot be set directly and must come from - // this module. - type InitializeMembers = Council; + type Currency = Balances; type CurrencyToVote = U128CurrencyToVote; - type CandidacyBond = CandidacyBond; - type VotingBond = VotingBond; - type LoserCandidate = (); - type BadReport = (); - type KickedMember = (); type DesiredMembers = DesiredMembers; type DesiredRunnersUp = DesiredRunnersUp; + type Event = Event; + // NOTE: this implies that council's genesis members cannot be set directly and + // must come from this module. + type InitializeMembers = Council; + type KickedMember = (); + type LoserCandidate = (); + type PalletId = ElectionsPhragmenPalletId; type TermDuration = TermDuration; + type VotingBondBase = VotingBondBase; + type VotingBondFactor = VotingBondFactor; type WeightInfo = pallet_elections_phragmen::weights::SubstrateWeight; } @@ -643,53 +714,55 @@ parameter_types! { pub const DataDepositPerByte: Balance = 1 * CENTS; pub const BountyDepositBase: Balance = 10 * DOLLARS; pub const BountyDepositPayoutDelay: BlockNumber = 7 * DAYS; - pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry"); - pub const BountyUpdatePeriod: BlockNumber = 3 * DAYS; + pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); + pub const BountyUpdatePeriod: BlockNumber = 30 * DAYS; pub const MaximumReasonLength: u32 = 16384; pub const BountyCuratorDeposit: Permill = Permill::from_percent(50); pub const BountyValueMinimum: Balance = 100 * DOLLARS; + pub const MaxApprovals: u32 = 100; } impl pallet_treasury::Config for Runtime { - type ModuleId = TreasuryModuleId; - type Currency = Balances; type ApproveOrigin = EnsureOneOf< AccountId, EnsureRoot, - pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective> + pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>, >; - type RejectOrigin = EnsureRootOrHalfCouncil; + type Burn = Burn; + type BurnDestination = (); + type Currency = Balances; type Event = Event; + type MaxApprovals = MaxApprovals; type OnSlash = (); + type PalletId = TreasuryPalletId; type ProposalBond = ProposalBond; type ProposalBondMinimum = ProposalBondMinimum; - type SpendPeriod = SpendPeriod; - type Burn = Burn; - type BurnDestination = (); + type RejectOrigin = EnsureRootOrHalfCouncil; type SpendFunds = Bounties; + type SpendPeriod = SpendPeriod; type WeightInfo = pallet_treasury::weights::SubstrateWeight; } impl pallet_bounties::Config for Runtime { - type Event = Event; + type BountyCuratorDeposit = BountyCuratorDeposit; type BountyDepositBase = BountyDepositBase; type BountyDepositPayoutDelay = BountyDepositPayoutDelay; type BountyUpdatePeriod = BountyUpdatePeriod; - type BountyCuratorDeposit = BountyCuratorDeposit; type BountyValueMinimum = BountyValueMinimum; type DataDepositPerByte = DataDepositPerByte; + type Event = Event; type MaximumReasonLength = MaximumReasonLength; type WeightInfo = pallet_bounties::weights::SubstrateWeight; } impl pallet_tips::Config for Runtime { - type Event = Event; type DataDepositPerByte = DataDepositPerByte; + type Event = Event; type MaximumReasonLength = MaximumReasonLength; - type Tippers = Elections; type TipCountdown = TipCountdown; type TipFindersFee = TipFindersFee; type TipReportDepositBase = TipReportDepositBase; + type Tippers = PhragmenElection; type WeightInfo = pallet_tips::weights::SubstrateWeight; } @@ -700,11 +773,11 @@ parameter_types! { pub const StakingUnsignedPriority: TransactionPriority = TransactionPriority::max_value() / 2; } -/// Submits a transaction with the node's public and signature type. Adheres to the signed extension -/// format of the chain. +/// Submits a transaction with the node's public and signature type. Adheres to +/// the signed extension format of the chain. impl frame_system::offchain::CreateSignedTransaction for Runtime - where - Call: From, +where + Call: From, { fn create_transaction>( call: Call, @@ -735,13 +808,10 @@ impl frame_system::offchain::CreateSignedTransaction for R ); let raw_payload = SignedPayload::new(call, extra) .map_err(|e| { - debug::warn!("Unable to create signed payload: {:?}", e); + log::warn!("Unable to create signed payload: {:?}", e); }) .ok()?; - let signature = raw_payload - .using_encoded(|payload| { - C::sign(payload, public) - })?; + let signature = raw_payload.using_encoded(|payload| C::sign(payload, public))?; let address = Indices::unlookup(account); let (call, extra, _) = raw_payload.deconstruct(); Some((call, (address, signature.into(), extra))) @@ -753,7 +823,8 @@ impl frame_system::offchain::SigningTypes for Runtime { type Signature = Signature; } -impl frame_system::offchain::SendTransactionTypes for Runtime where +impl frame_system::offchain::SendTransactionTypes for Runtime +where Call: From, { type Extrinsic = UncheckedExtrinsic; @@ -763,9 +834,10 @@ impl frame_system::offchain::SendTransactionTypes for Runtime where impl pallet_im_online::Config for Runtime { type AuthorityId = ImOnlineId; type Event = Event; - type SessionDuration = SessionDuration; + type NextSessionRotation = pallet_session::PeriodicSessions; type ReportUnresponsiveness = Offences; type UnsignedPriority = ImOnlineUnsignedPriority; + type ValidatorSet = Historical; type WeightInfo = pallet_im_online::weights::SubstrateWeight; } @@ -778,28 +850,28 @@ impl pallet_offences::Config for Runtime { type Event = Event; type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = Staking; - type WeightSoftLimit = OffencesWeightSoftLimit; } impl pallet_authority_discovery::Config for Runtime {} +parameter_types! { + // NOTE: Currently it is not possible to change the epoch duration after the chain has started. + // Attempting to do so will brick block production. + pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS; + pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; + pub const ReportLongevity: u64 = + BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); +} + impl pallet_grandpa::Config for Runtime { - type Event = Event; type Call = Call; - - type KeyOwnerProofSystem = Historical; - - type KeyOwnerProof = - >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - + type Event = Event; type HandleEquivocation = - pallet_grandpa::EquivocationHandler; - + pallet_grandpa::EquivocationHandler; + type KeyOwnerIdentification = + >::IdentificationTuple; + type KeyOwnerProof = >::Proof; + type KeyOwnerProofSystem = Historical; type WeightInfo = (); } @@ -815,21 +887,21 @@ parameter_types! { type EnsureRootOrHalfCouncil = EnsureOneOf< AccountId, EnsureRoot, - pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective> + pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>, >; impl pallet_identity::Config for Runtime { - type Event = Event; - type Currency = Balances; type BasicDeposit = BasicDeposit; + type Currency = Balances; + type Event = Event; type FieldDeposit = FieldDeposit; - type SubAccountDeposit = SubAccountDeposit; - type MaxSubAccounts = MaxSubAccounts; + type ForceOrigin = EnsureRootOrHalfCouncil; type MaxAdditionalFields = MaxAdditionalFields; type MaxRegistrars = MaxRegistrars; - type Slashed = Treasury; - type ForceOrigin = EnsureRootOrHalfCouncil; + type MaxSubAccounts = MaxSubAccounts; type RegistrarOrigin = EnsureRootOrHalfCouncil; + type Slashed = Treasury; + type SubAccountDeposit = SubAccountDeposit; type WeightInfo = pallet_identity::weights::SubstrateWeight; } @@ -841,44 +913,67 @@ parameter_types! { } impl pallet_recovery::Config for Runtime { - type Event = Event; type Call = Call; - type Currency = Balances; type ConfigDepositBase = ConfigDepositBase; + type Currency = Balances; + type Event = Event; type FriendDepositFactor = FriendDepositFactor; type MaxFriends = MaxFriends; type RecoveryDeposit = RecoveryDeposit; } +parameter_types! { + pub const AssetDeposit: Balance = 100 * DOLLARS; + pub const ApprovalDeposit: Balance = 1 * DOLLARS; + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: Balance = 10 * DOLLARS; + pub const MetadataDepositPerByte: Balance = 1 * DOLLARS; +} + +impl pallet_assets::Config for Runtime { + type ApprovalDeposit = ApprovalDeposit; + type AssetDeposit = AssetDeposit; + type AssetId = u32; + type Balance = u64; + type Currency = Balances; + type Event = Event; + type Extra = (); + type ForceOrigin = EnsureRoot; + type Freezer = (); + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type StringLimit = StringLimit; + type WeightInfo = pallet_assets::weights::SubstrateWeight; +} + parameter_types! { pub const MinVestedTransfer: Balance = 100 * DOLLARS; } impl pallet_vesting::Config for Runtime { - type Event = Event; - type Currency = Balances; type BlockNumberToBalance = ConvertInto; + type Currency = Balances; + type Event = Event; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = pallet_vesting::weights::SubstrateWeight; } impl pallet_sudo::Config for Runtime { - type Event = Event; type Call = Call; + type Event = Event; } parameter_types! { - pub const TombstoneDeposit: Balance = deposit( + pub TombstoneDeposit: Balance = deposit( 1, - sp_std::mem::size_of::>() as u32 + >::contract_info_size(), ); - pub const DepositPerContract: Balance = TombstoneDeposit::get(); + pub DepositPerContract: Balance = TombstoneDeposit::get(); pub const DepositPerStorageByte: Balance = deposit(0, 1); pub const DepositPerStorageItem: Balance = deposit(1, 0); - pub RentFraction: Perbill = Perbill::from_rational_approximation(1u32, 30 * DAYS); + pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS); pub const SurchargeReward: Balance = 150 * MILLICENTS; pub const SignedClaimHandicap: u32 = 2; - pub const MaxDepth: u32 = 32; pub const MaxValueSize: u32 = 16 * 1024; // The lazy deletion runs inside on_initialize. pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO * @@ -889,28 +984,29 @@ parameter_types! { ::WeightInfo::on_initialize_per_queue_item(1) - ::WeightInfo::on_initialize_per_queue_item(0) )) / 5) as u32; + pub Schedule: pallet_contracts::Schedule = Default::default(); } impl pallet_contracts::Config for Runtime { - type Time = Timestamp; - type Randomness = RandomnessCollectiveFlip; + type CallStack = [pallet_contracts::Frame; 31]; + type ChainExtension = (); type Currency = Balances; - type Event = Event; - type RentPayment = (); - type SignedClaimHandicap = SignedClaimHandicap; - type TombstoneDeposit = TombstoneDeposit; + type DeletionQueueDepth = DeletionQueueDepth; + type DeletionWeightLimit = DeletionWeightLimit; type DepositPerContract = DepositPerContract; type DepositPerStorageByte = DepositPerStorageByte; type DepositPerStorageItem = DepositPerStorageItem; + type Event = Event; + type Randomness = RandomnessCollectiveFlip; type RentFraction = RentFraction; + type RentPayment = (); + type Schedule = Schedule; + type SignedClaimHandicap = SignedClaimHandicap; type SurchargeReward = SurchargeReward; - type MaxDepth = MaxDepth; - type MaxValueSize = MaxValueSize; - type WeightPrice = pallet_transaction_payment::Module; + type Time = Timestamp; + type TombstoneDeposit = TombstoneDeposit; type WeightInfo = pallet_contracts::weights::SubstrateWeight; - type ChainExtension = (); - type DeletionQueueDepth = DeletionQueueDepth; - type DeletionWeightLimit = DeletionWeightLimit; + type WeightPrice = pallet_transaction_payment::Module; } parameter_types! { @@ -961,7 +1057,8 @@ static EVM_CONFIG: EvmConfig = EvmConfig { pub const GAS_PER_SECOND: u64 = 8_000_000; /// Approximate ratio of the amount of Weight per Gas. -/// u64 works for approximations because Weight is a very small unit compared to gas. +/// u64 works for approximations because Weight is a very small unit compared to +/// gas. pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND / GAS_PER_SECOND; pub struct EdgewareGasWeightMapping; @@ -970,39 +1067,29 @@ impl pallet_evm::GasWeightMapping for EdgewareGasWeightMapping { fn gas_to_weight(gas: u64) -> Weight { Weight::try_from(gas.saturating_mul(WEIGHT_PER_GAS)).unwrap_or(Weight::MAX) } + fn weight_to_gas(weight: Weight) -> u64 { weight.wrapping_div(WEIGHT_PER_GAS) } } -/// Fixed gas price of `1`. -pub struct FixedGasPrice; - -impl pallet_evm::FeeCalculator for FixedGasPrice { - fn min_gas_price() -> U256 { - // Gas price is always one token per gas. - 1.into() - } +parameter_types! { + pub BlockGasLimit: U256 = U256::from(u32::max_value()); } impl pallet_evm::Config for Runtime { - type FeeCalculator = FixedGasPrice; // TODO: permit validators to set minimum gas prices - type CallOrigin = EnsureAddressTruncated; - type WithdrawOrigin = EnsureAddressTruncated; type AddressMapping = HashedAddressMapping; + type BlockGasLimit = BlockGasLimit; + type CallOrigin = EnsureAddressTruncated; + type ChainId = EthChainId; type Currency = Balances; type Event = Event; - type Runner = pallet_evm::runner::stack::Runner; - type Precompiles = ( - pallet_evm_precompile_simple::ECRecover, - pallet_evm_precompile_simple::Sha256, - pallet_evm_precompile_simple::Ripemd160, - pallet_evm_precompile_simple::Identity, - pallet_evm_precompile_modexp::Modexp, - pallet_evm_precompile_ed25519::Ed25519Verify, - ); - type ChainId = EthChainId; + type FeeCalculator = pallet_dynamic_fee::Pallet; type GasWeightMapping = EdgewareGasWeightMapping; + type OnChargeTransaction = (); + type Precompiles = EdgewarePrecompiles; + type Runner = pallet_evm::runner::stack::Runner; + type WithdrawOrigin = EnsureAddressTruncated; /// EVM config used in the module. fn config() -> &'static EvmConfig { @@ -1011,10 +1098,10 @@ impl pallet_evm::Config for Runtime { } pub struct EthereumFindAuthor(PhantomData); -impl> FindAuthor for EthereumFindAuthor -{ - fn find_author<'a, I>(digests: I) -> Option where - I: 'a + IntoIterator +impl> FindAuthor for EthereumFindAuthor { + fn find_author<'a, I>(digests: I) -> Option + where + I: 'a + IntoIterator, { if let Some(author_index) = F::find_author(digests) { let authority_id = Aura::authorities()[author_index as usize].clone(); @@ -1024,72 +1111,114 @@ impl> FindAuthor for EthereumFindAuthor } } -parameter_types! { - pub BlockGasLimit: U256 = U256::from(u32::max_value()); -} - impl pallet_ethereum::Config for Runtime { type Event = Event; type FindAuthor = EthereumFindAuthor; type StateRoot = pallet_ethereum::IntermediateStateRoot; - type BlockGasLimit = BlockGasLimit; } -impl treasury_reward::Config for Runtime { +parameter_types! { + pub BoundDivision: U256 = U256::from(1024); +} + +impl pallet_dynamic_fee::Config for Runtime { type Event = Event; + type MinGasPriceBoundDivisor = BoundDivision; +} + +impl treasury_reward::Config for Runtime { type Currency = Balances; + type Event = Event; } parameter_types! { - pub const ChainId: u8 = 5; - pub const ProposalLifetime: u32 = 100; + pub const MaxTreeDepth: u8 = 32; + pub const CacheBlockLength: BlockNumber = 100; } -impl chainbridge::Config for Runtime { - type Event = Event; - // Allow 2/3 council to approve proposals - type AdminOrigin = frame_system::EnsureOneOf, - frame_system::EnsureRoot, - >; - type Proposal = Call; - type ChainId = ChainId; - type ProposalLifetime = ProposalLifetime; +impl merkle::Config for Runtime { + type CacheBlockLength = CacheBlockLength; + type Event = Event; + type MaxTreeDepth = MaxTreeDepth; + type TreeId = u32; + type WeightInfo = MerkleWeights; } parameter_types! { - pub NativeTokenId: chainbridge::ResourceId = chainbridge::derive_resource_id(1, &blake2_128(b"EDG")); - pub const NativeTransferFee: Balance = 1 * DOLLARS; + pub const TokensPalletId: PalletId = PalletId(*b"py/token"); + pub const NativeCurrencyId: CurrencyId = 0; + pub const CurrencyDeposit: Balance = 100 * DOLLARS; } -impl edge_chainbridge::Config for Runtime { - type Event = Event; - type BridgeOrigin = chainbridge::EnsureBridge; - type Currency = Balances; - type NativeTokenId = NativeTokenId; - type NativeTransferFee = NativeTransferFee; +impl webb_tokens::Config for Runtime { + type Amount = Amount; + type ApprovalDeposit = ApprovalDeposit; + type Balance = Balance; + type CurrencyDeposit = CurrencyDeposit; + type CurrencyId = CurrencyId; + type DustAccount = (); + type Event = Event; + type Extra = (); + type ForceOrigin = frame_system::EnsureRoot; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type NativeCurrency = BasicCurrencyAdapter; + type PalletId = TokensPalletId; + type StringLimit = StringLimit; + type WeightInfo = (); +} + +impl webb_currencies::Config for Runtime { + type Event = Event; + type GetNativeCurrencyId = NativeCurrencyId; + type MultiCurrency = Tokens; + type NativeCurrency = BasicCurrencyAdapter; + type WeightInfo = (); } parameter_types! { - pub const AssetDepositBase: u64 = 1; - pub const AssetDepositPerZombie: u64 = 1; - pub const AllowFreezing: bool = true; - pub const AllowBurning: bool = true; - pub const AllowMinting: bool = true; + pub const MixerPalletId: PalletId = PalletId(*b"py/mixer"); + pub const MinimumDepositLength: BlockNumber = 10 * 60 * 24 * 28; + pub const DefaultAdminKey: AccountId = AccountId::new([0; 32]); + pub MixerSizes: Vec = [ + DOLLARS * 1_000, + DOLLARS * 10_000, + DOLLARS * 100_000, + DOLLARS * 1_000_000 + ].to_vec(); +} + +impl mixer::Config for Runtime { + type Currency = Currencies; + type DefaultAdmin = DefaultAdminKey; + type DepositLength = MinimumDepositLength; + type Event = Event; + type MixerSizes = MixerSizes; + type NativeCurrencyId = NativeCurrencyId; + type PalletId = MixerPalletId; + type Tree = Merkle; + type WeightInfo = MixerWeights; } -impl edge_assets::Config for Runtime { - type Currency = Balances; +parameter_types! { + pub const NftPalletId: PalletId = PalletId(*b"edge/NFT"); + pub CreateClassDeposit: Balance = 500 * MILLICENTS; + pub CreateTokenDeposit: Balance = 100 * MILLICENTS; +} + +impl nft::Config for Runtime { + type CreateClassDeposit = CreateClassDeposit; + type CreateTokenDeposit = CreateTokenDeposit; type Event = Event; - type Balance = Balance; - type AssetId = constants::currency::AssetId; - type ForceOrigin = frame_system::EnsureRoot; - type AssetDepositBase = AssetDepositBase; - type AssetDepositPerZombie = AssetDepositPerZombie; - type AllowFreezing = AllowFreezing; - type AllowBurning = AllowBurning; - type AllowMinting = AllowMinting; - type WeightInfo = edge_assets::weights::SubstrateWeight; + type PalletId = NftPalletId; + type WeightInfo = (); +} + +impl orml_nft::Config for Runtime { + type ClassData = nft::ClassData; + type ClassId = u32; + type TokenData = nft::TokenData; + type TokenId = u64; } construct_runtime!( @@ -1098,48 +1227,60 @@ construct_runtime!( NodeBlock = edgeware_primitives::Block, UncheckedExtrinsic = UncheckedExtrinsic { - System: frame_system::{Module, Call, Config, Storage, Event} = 0, - Utility: pallet_utility::{Module, Call, Event} = 1, - Aura: pallet_aura::{Module, Config, Inherent} = 2, - - Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent} = 3, - Authorship: pallet_authorship::{Module, Call, Storage, Inherent} = 4, - Indices: pallet_indices::{Module, Call, Storage, Config, Event} = 5, - Balances: pallet_balances::{Module, Call, Storage, Config, Event} = 6, - TransactionPayment: pallet_transaction_payment::{Module, Storage} = 7, - - Staking: pallet_staking::{Module, Call, Config, Storage, Event, ValidateUnsigned} = 8, - Session: pallet_session::{Module, Call, Storage, Event, Config} = 9, - Democracy: pallet_democracy::{Module, Call, Storage, Config, Event} = 10, - Council: pallet_collective::::{Module, Call, Storage, Origin, Event, Config} = 11, - Elections: pallet_elections_phragmen::{Module, Call, Storage, Event, Config} = 12, - - Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned} = 14, - Treasury: pallet_treasury::{Module, Call, Storage, Config, Event} = 15, - Contracts: pallet_contracts::{Module, Call, Config, Storage, Event} = 16, - Sudo: pallet_sudo::{Module, Call, Config, Storage, Event} = 17, - ImOnline: pallet_im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config} = 18, - AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config} = 19, - Offences: pallet_offences::{Module, Call, Storage, Event} = 20, - Historical: pallet_session_historical::{Module} = 21, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage} = 22, - Identity: pallet_identity::{Module, Call, Storage, Event} = 23, - - Recovery: pallet_recovery::{Module, Call, Storage, Event} = 24, - Vesting: pallet_vesting::{Module, Call, Storage, Event, Config} = 25, - Scheduler: pallet_scheduler::{Module, Call, Storage, Event} = 26, - Proxy: pallet_proxy::{Module, Call, Storage, Event} = 27, - Multisig: pallet_multisig::{Module, Call, Storage, Event} = 28, - Assets: edge_assets::{Module, Call, Storage, Event} = 29, - - TreasuryReward: treasury_reward::{Module, Call, Storage, Config, Event} = 32, - Ethereum: pallet_ethereum::{Module, Call, Storage, Event, Config, ValidateUnsigned} = 33, - EVM: pallet_evm::{Module, Config, Call, Storage, Event} = 34, - ChainBridge: chainbridge::{Module, Call, Storage, Event} = 35, - EdgeBridge: edge_chainbridge::{Module, Call, Event} = 36, - - Bounties: pallet_bounties::{Module, Call, Storage, Event} = 37, - Tips: pallet_tips::{Module, Call, Storage, Event} = 38, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + Utility: pallet_utility::{Pallet, Call, Event} = 1, + Aura: pallet_aura::{Pallet, Config} = 2, + + Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, + Authorship: pallet_authorship::{Pallet, Call, Storage, Inherent} = 4, + Indices: pallet_indices::{Pallet, Call, Storage, Config, Event} = 5, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 6, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 7, + + Staking: pallet_staking::{Pallet, Call, Config, Storage, Event} = 8, + Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 9, + Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event} = 10, + Council: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 11, + PhragmenElection: pallet_elections_phragmen::{Pallet, Call, Storage, Event, Config} = 12, + ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Pallet, Call, Storage, Event, ValidateUnsigned} = 39, + + Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event, ValidateUnsigned} = 14, + Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event} = 15, + Contracts: pallet_contracts::{Pallet, Call, Storage, Event} = 16, + Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event} = 17, + ImOnline: pallet_im_online::{Pallet, Call, Storage, Event, ValidateUnsigned, Config} = 18, + AuthorityDiscovery: pallet_authority_discovery::{Pallet, Call, Config} = 19, + Offences: pallet_offences::{Pallet, Call, Storage, Event} = 20, + Historical: pallet_session_historical::{Pallet} = 21, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage} = 22, + Identity: pallet_identity::{Pallet, Call, Storage, Event} = 23, + + Recovery: pallet_recovery::{Pallet, Call, Storage, Event} = 24, + Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 25, + Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 26, + Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 27, + Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 28, + Assets: pallet_assets::{Pallet, Call, Storage, Event} = 29, + + TreasuryReward: treasury_reward::{Pallet, Call, Storage, Config, Event} = 32, + Ethereum: pallet_ethereum::{Pallet, Call, Storage, Event, Config, ValidateUnsigned} = 33, + EVM: pallet_evm::{Pallet, Config, Call, Storage, Event} = 34, + // TODO: Find if reusing old index is bad + DynamicFee: pallet_dynamic_fee::{Pallet, Call, Storage, Event, Inherent} = 35, + // REMOVED: ChainBridge: chainbridge::{Pallet, Call, Storage, Event} = 35, + // REMOVED: EdgeBridge: edge_chainbridge::{Pallet, Call, Event} = 36, + + Bounties: pallet_bounties::{Pallet, Call, Storage, Event} = 37, + Tips: pallet_tips::{Pallet, Call, Storage, Event} = 38, + + Tokens: webb_tokens::{Pallet, Storage, Event} = 40, + Currencies: webb_currencies::{Pallet, Storage, Event} = 41, + Mixer: mixer::{Pallet, Call, Storage, Event} = 42, + Merkle: merkle::{Pallet, Call, Storage, Event} = 43, + + NonFungibleTokenModule: orml_nft::{Pallet, Storage, Config} = 44, + NFT: nft::{Pallet, Call, Event} = 45, + } ); @@ -1153,7 +1294,8 @@ impl fp_rpc::ConvertTransaction for TransactionConverter { impl fp_rpc::ConvertTransaction for TransactionConverter { fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> sp_runtime::OpaqueExtrinsic { - let extrinsic = UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()); + let extrinsic = + UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()); let encoded = extrinsic.encode(); sp_runtime::OpaqueExtrinsic::decode(&mut &encoded[..]).expect("Encoded extrinsic is always valid") } @@ -1171,7 +1313,8 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. /// -/// When you change this, you **MUST** modify [`sign`] in `bin/node/testing/src/keyring.rs`! +/// When you change this, you **MUST** modify [`sign`] in +/// `bin/node/testing/src/keyring.rs`! /// /// [`sign`]: <../../testing/src/keyring.rs.html> pub type SignedExtra = ( @@ -1190,10 +1333,56 @@ pub type SignedPayload = generic::SignedPayload; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive, Runtime, AllModules>; +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPallets, + ( + custom_migration::Upgrade, + // custom_migration::GrandpaStoragePrefixMigration + ), +>; pub type Extrinsic = ::Extrinsic; +/// Custom runtime upgrade to execute the balances migration before the account +/// migration. +mod custom_migration { + use super::*; + use frame_support::{traits::OnRuntimeUpgrade, weights::Weight}; + + pub struct Upgrade; + impl pallet_elections_phragmen::migrations::v3::V2ToV3 for Upgrade { + type AccountId = AccountId; + type Balance = Balance; + type Module = PhragmenElection; + } + + impl OnRuntimeUpgrade for Upgrade { + fn on_runtime_upgrade() -> Weight { + let mut weight = 0; + // custom migration for edgeware. + weight += frame_system::migrations::migrate_for_edgeware::(); + // old VotingBond + let old_voter_bond: Balance = 10 * DOLLARS; + // old CandidacyBond + let old_candidacy_bond: Balance = 1_000 * DOLLARS; + // elections migrations. + pallet_elections_phragmen::migrations::v3::migrate_voters_to_recorded_deposit::(old_voter_bond); + pallet_elections_phragmen::migrations::v3::migrate_candidates_to_recorded_deposit::( + old_candidacy_bond, + ); + pallet_elections_phragmen::migrations::v3::migrate_runners_up_to_recorded_deposit::( + old_candidacy_bond, + ); + pallet_elections_phragmen::migrations::v3::migrate_members_to_recorded_deposit::(old_candidacy_bond); + weight + } + } +} + impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { @@ -1231,10 +1420,6 @@ impl_runtime_apis! { fn check_inherents(block: Block, data: InherentData) -> CheckInherentsResult { data.check_extrinsics(&block) } - - fn random_seed() -> ::Hash { - RandomnessCollectiveFlip::random_seed() - } } impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { @@ -1285,8 +1470,8 @@ impl_runtime_apis! { } impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> u64 { - Aura::slot_duration() + fn slot_duration() -> sp_consensus_aura::SlotDuration { + sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) } fn authorities() -> Vec { @@ -1306,7 +1491,9 @@ impl_runtime_apis! { } } - impl pallet_contracts_rpc_runtime_api::ContractsApi + impl pallet_contracts_rpc_runtime_api::ContractsApi< + Block, AccountId, Balance, BlockNumber, Hash, + > for Runtime { fn call( @@ -1316,7 +1503,19 @@ impl_runtime_apis! { gas_limit: u64, input_data: Vec, ) -> pallet_contracts_primitives::ContractExecResult { - Contracts::bare_call(origin, dest, value, gas_limit, input_data) + Contracts::bare_call(origin, dest, value, gas_limit, input_data, true) + } + + fn instantiate( + origin: AccountId, + endowment: Balance, + gas_limit: u64, + code: pallet_contracts_primitives::Code, + data: Vec, + salt: Vec, + ) -> pallet_contracts_primitives::ContractInstantiateResult + { + Contracts::bare_instantiate(origin, endowment, gas_limit, code, data, salt, true, true) } fn get_storage( @@ -1340,6 +1539,9 @@ impl_runtime_apis! { fn query_info(uxt: ::Extrinsic, len: u32) -> RuntimeDispatchInfo { TransactionPayment::query_info(uxt, len) } + fn query_fee_details(uxt: ::Extrinsic, len: u32) -> FeeDetails { + TransactionPayment::query_fee_details(uxt, len) + } } impl sp_session::SessionKeys for Runtime { @@ -1372,7 +1574,7 @@ impl_runtime_apis! { } fn author() -> H160 { - >::find_author() + >::find_author() } fn storage_at(address: H160, index: U256) -> H256 { @@ -1404,7 +1606,7 @@ impl_runtime_apis! { to, data, value, - gas_limit.low_u32(), + gas_limit.low_u64(), gas_price, nonce, config.as_ref().unwrap_or(::config()), @@ -1432,7 +1634,7 @@ impl_runtime_apis! { from, data, value, - gas_limit.low_u32(), + gas_limit.low_u64(), gas_price, nonce, config.as_ref().unwrap_or(::config()), @@ -1440,15 +1642,24 @@ impl_runtime_apis! { } fn current_transaction_statuses() -> Option> { - Ethereum::current_transaction_statuses() + match Ethereum::current_transaction_statuses() { + Some(elt) => Some(elt.into()), + None => None, + } } fn current_block() -> Option { - Ethereum::current_block() + match Ethereum::current_block() { + Some(elt) => Some(elt.into()), + None => None, + } } fn current_receipts() -> Option> { - Ethereum::current_receipts() + match Ethereum::current_receipts() { + Some(elt) => Some(elt.into()), + None => None, + } } fn current_all() -> ( @@ -1457,13 +1668,236 @@ impl_runtime_apis! { Option> ) { ( - Ethereum::current_block(), - Ethereum::current_receipts(), - Ethereum::current_transaction_statuses() + Self::current_block(), + Self::current_receipts(), + Self::current_transaction_statuses(), ) } } + impl merkle::MerkleApi for Runtime { + fn get_leaf(tree_id: u32, index: u32) -> Option { + let v = Merkle::leaves(tree_id, index); + if v == ScalarData::default() { + None + } else { + Some(v) + } + } + } + + impl edgeware_rpc_primitives_debug::DebugRuntimeApi for Runtime { + fn trace_transaction( + extrinsics: Vec<::Extrinsic>, + transaction: &EthereumTransaction, + trace_type: edgeware_rpc_primitives_debug::single::TraceType, + ) -> Result< + edgeware_rpc_primitives_debug::single::TransactionTrace, + sp_runtime::DispatchError + > { + use edgeware_rpc_primitives_debug::single::TraceType; + use edgeware_evm_tracer::{RawTracer, CallListTracer}; + + // Apply the a subset of extrinsics: all the substrate-specific or ethereum transactions + // that preceded the requested transaction. + for ext in extrinsics.into_iter() { + let _ = match &ext.function { + Call::Ethereum(transact(t)) => { + if t == transaction { + return match trace_type { + TraceType::Raw { + disable_storage, + disable_memory, + disable_stack, + } => { + Ok(RawTracer::new(disable_storage, + disable_memory, + disable_stack,) + .trace(|| Executive::apply_extrinsic(ext)) + .0 + .into_tx_trace() + ) + }, + TraceType::CallList => { + Ok(CallListTracer::new() + .trace(|| Executive::apply_extrinsic(ext)) + .0 + .into_tx_trace() + ) + } + } + + } else { + Executive::apply_extrinsic(ext) + } + }, + _ => Executive::apply_extrinsic(ext) + }; + } + + Err(sp_runtime::DispatchError::Other( + "Failed to find Ethereum transaction among the extrinsics." + )) + } + + fn trace_block( + extrinsics: Vec<::Extrinsic>, + ) -> Result< + Vec< + edgeware_rpc_primitives_debug::block::TransactionTrace>, + sp_runtime::DispatchError + > { + use edgeware_rpc_primitives_debug::{single, block, CallResult, CreateResult, CreateType}; + use edgeware_evm_tracer::CallListTracer; + + let mut config = ::config().clone(); + config.estimate = true; + + let mut traces = vec![]; + let mut eth_tx_index = 0; + + // Apply all extrinsics. Ethereum extrinsics are traced. + for ext in extrinsics.into_iter() { + match &ext.function { + Call::Ethereum(transact(_transaction)) => { + let tx_traces = CallListTracer::new() + .trace(|| Executive::apply_extrinsic(ext)) + .0 + .into_tx_trace(); + + let tx_traces = match tx_traces { + single::TransactionTrace::CallList(t) => t, + _ => return Err(sp_runtime::DispatchError::Other("Runtime API error")), + }; + + // Convert traces from "single" format to "block" format. + let mut tx_traces: Vec<_> = tx_traces.into_iter().map(|trace| + match trace.inner { + single::CallInner::Call { + input, to, res, call_type + } => block::TransactionTrace { + action: block::TransactionTraceAction::Call { + call_type, + from: trace.from, + gas: trace.gas, + input, + to, + value: trace.value, + }, + // Can't be known here, must be inserted upstream. + block_hash: H256::default(), + // Can't be known here, must be inserted upstream. + block_number: 0, + output: match res { + CallResult::Output(output) => { + block::TransactionTraceOutput::Result( + block::TransactionTraceResult::Call { + gas_used: trace.gas_used, + output + }) + }, + CallResult::Error(error) => + block::TransactionTraceOutput::Error(error), + }, + subtraces: trace.subtraces, + trace_address: trace.trace_address, + // Can't be known here, must be inserted upstream. + transaction_hash: H256::default(), + transaction_position: eth_tx_index, + }, + single::CallInner::Create { init, res } => block::TransactionTrace { + action: block::TransactionTraceAction::Create { + creation_method: CreateType::Create, + from: trace.from, + gas: trace.gas, + init, + value: trace.value, + }, + // Can't be known here, must be inserted upstream. + block_hash: H256::default(), + // Can't be known here, must be inserted upstream. + block_number: 0, + output: match res { + CreateResult::Success { + created_contract_address_hash, + created_contract_code + } => { + block::TransactionTraceOutput::Result( + block::TransactionTraceResult::Create { + gas_used: trace.gas_used, + code: created_contract_code, + address: created_contract_address_hash, + } + ) + }, + CreateResult::Error { + error + } => block::TransactionTraceOutput::Error(error), + }, + subtraces: trace.subtraces, + trace_address: trace.trace_address, + // Can't be known here, must be inserted upstream. + transaction_hash: H256::default(), + transaction_position: eth_tx_index, + + }, + single::CallInner::SelfDestruct { + balance, + refund_address + } => block::TransactionTrace { + action: block::TransactionTraceAction::Suicide { + address: trace.from, + balance, + refund_address, + }, + // Can't be known here, must be inserted upstream. + block_hash: H256::default(), + // Can't be known here, must be inserted upstream. + block_number: 0, + output: block::TransactionTraceOutput::Result( + block::TransactionTraceResult::Suicide + ), + subtraces: trace.subtraces, + trace_address: trace.trace_address, + // Can't be known here, must be inserted upstream. + transaction_hash: H256::default(), + transaction_position: eth_tx_index, + + }, + } + ).collect(); + + traces.append(&mut tx_traces); + + eth_tx_index += 1; + }, + _ => {let _ = Executive::apply_extrinsic(ext); } + }; + } + + Ok(traces) + } + } + + + impl edgeware_rpc_primitives_txpool::TxPoolRuntimeApi for Runtime { + fn extrinsic_filter( + xts_ready: Vec<::Extrinsic>, + xts_future: Vec<::Extrinsic> + ) -> TxPoolResponse { + TxPoolResponse { + ready: xts_ready.into_iter().filter_map(|xt| match xt.function { + Call::Ethereum(transact(t)) => Some(t), + _ => None + }).collect(), + future: xts_future.into_iter().filter_map(|xt| match xt.function { + Call::Ethereum(transact(t)) => Some(t), + _ => None + }).collect(), + } + } + } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn dispatch_benchmark( diff --git a/node/runtime/src/precompiles.rs b/node/runtime/src/precompiles.rs new file mode 100644 index 00000000..bf481c05 --- /dev/null +++ b/node/runtime/src/precompiles.rs @@ -0,0 +1,73 @@ +use codec::Decode; +use evm::{executor::PrecompileOutput, Context, ExitError}; +use frame_support::dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}; +use pallet_evm::{Precompile, PrecompileSet}; +use pallet_evm_precompile_blake2::Blake2F; +use pallet_evm_precompile_bn128::{Bn128Add, Bn128Mul, Bn128Pairing}; +use pallet_evm_precompile_curve25519::{Curve25519Add, Curve25519ScalarMul}; +use pallet_evm_precompile_dispatch::Dispatch; +use pallet_evm_precompile_ed25519::Ed25519Verify; +use pallet_evm_precompile_modexp::Modexp; +use pallet_evm_precompile_sha3fips::Sha3FIPS256; +use pallet_evm_precompile_simple::{ECRecover, ECRecoverPublicKey, Identity, Ripemd160, Sha256}; +use sp_core::H160; + +use sp_std::{fmt::Debug, marker::PhantomData}; + +#[derive(Debug, Clone, Copy)] +pub struct EdgewarePrecompiles(PhantomData); + +impl EdgewarePrecompiles { + /// Return all addresses that contain precompiles. This can be used to + /// populate dummy code under the precompile, and potentially in the future + /// to prevent using accounts that have precompiles at their addresses + /// explicitly using something like SignedExtra. + #[allow(dead_code)] + fn used_addresses() -> impl Iterator { + sp_std::vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 1024, 1025, 1026, 1027, 1028, 1029] + .into_iter() + .map(|x| hash(x).into()) + } +} + +/// The following distribution has been decided for the precompiles +/// 0-1023: Ethereum Mainnet Precompiles +/// 1024-2047 Precompiles that are not in Ethereum Mainnet but are neither +/// Moonbeam specific +impl PrecompileSet for EdgewarePrecompiles +where + R::Call: Dispatchable + GetDispatchInfo + Decode, + ::Origin: From>, +{ + fn execute( + address: H160, + input: &[u8], + target_gas: Option, + context: &Context, + ) -> Option> { + match address { + // Ethereum precompiles + a if a == hash(1) => Some(ECRecover::execute(input, target_gas, context)), + a if a == hash(2) => Some(Sha256::execute(input, target_gas, context)), + a if a == hash(3) => Some(Ripemd160::execute(input, target_gas, context)), + a if a == hash(4) => Some(Identity::execute(input, target_gas, context)), + a if a == hash(5) => Some(Modexp::execute(input, target_gas, context)), + a if a == hash(6) => Some(Bn128Add::execute(input, target_gas, context)), + a if a == hash(7) => Some(Bn128Mul::execute(input, target_gas, context)), + a if a == hash(8) => Some(Bn128Pairing::execute(input, target_gas, context)), + a if a == hash(9) => Some(Blake2F::execute(input, target_gas, context)), + // Non-Edgeware specific nor Ethereum precompiles : + a if a == hash(1024) => Some(Sha3FIPS256::execute(input, target_gas, context)), + a if a == hash(1025) => Some(Dispatch::::execute(input, target_gas, context)), + a if a == hash(1026) => Some(ECRecoverPublicKey::execute(input, target_gas, context)), + a if a == hash(1027) => Some(Ed25519Verify::execute(input, target_gas, context)), + a if a == hash(1028) => Some(Curve25519Add::execute(input, target_gas, context)), + a if a == hash(1029) => Some(Curve25519ScalarMul::execute(input, target_gas, context)), + _ => None, + } + } +} + +fn hash(a: u64) -> H160 { + H160::from_low_u64_be(a) +} diff --git a/node/testing/Cargo.toml b/node/testing/Cargo.toml deleted file mode 100644 index 17f035ce..00000000 --- a/node/testing/Cargo.toml +++ /dev/null @@ -1,54 +0,0 @@ -[package] -name = "edgeware-testing" -version = "3.2.0" -authors = ["Commonwealth Labs "] -description = "Test utilities for Edgeware." -edition = "2018" -license = "GPL-3.0-or-later WITH Classpath-exception-2.0" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -pallet-balances = { version = "2.0" } -sc-service = { version = "0.8", features = ["test-helpers", "db"] } -sc-client-db = { version = "0.8", features = ["kvdb-rocksdb", "parity-db"] } -sc-client-api = { version = "2.0" } -codec = { package = "parity-scale-codec", version = "1.3.4" } -pallet-contracts = { version = "2.0" } -pallet-grandpa = { version = "2.0" } -pallet-indices = { version = "2.0" } -sp-keyring = { version = "2.0" } -sp-core = { version = "2.0" } -sp-io = { version = "2.0" } -frame-support = { version = "2.0" } -pallet-session = { version = "2.0" } -sp-runtime = { version = "2.0" } -pallet-staking = { version = "2.0" } -sc-executor = { version = "0.8" } -sp-consensus = { version = "0.8" } -frame-system = { version = "2.0" } -substrate-test-client = { version = "2.0" } -pallet-timestamp = { version = "2.0" } -pallet-transaction-payment = { version = "2.0" } -pallet-treasury = { version = "2.0" } -sp-api = { version = "2.0" } -sp-timestamp = { version = "2.0", default-features = false } -sp-block-builder = { version = "2.0" } -sc-block-builder = { version = "0.8" } -sp-inherents = { version = "2.0" } -sp-blockchain = { version = "2.0" } -log = "0.4.8" -tempfile = "3.1.0" -fs_extra = "1" -futures = "0.3.1" - -edgeware-executor = { path = "../executor" } -edgeware-primitives = { path = "../primitives" } -edgeware-runtime = { path = "../runtime" } -treasury-reward = { package = "edge-treasury-reward", path = "../../modules/edge-treasury-reward" } - -[dev-dependencies] -criterion = "0.3.0" -sc-cli = { version = "0.8" } - diff --git a/node/testing/src/client.rs b/node/testing/src/client.rs deleted file mode 100644 index 9dcc5fca..00000000 --- a/node/testing/src/client.rs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2018-2020 Commonwealth Labs, Inc. -// This file is part of Edgeware. - -// Edgeware 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. - -// Edgeware 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 Edgeware. If not, see . - -//! Utilites to build a `TestClient` for `node-runtime`. - -use sp_runtime::Storage; -use sp_runtime::BuildStorage; -use sc_service::client; -/// Re-export test-client utilities. -pub use substrate_test_client::*; - -/// Call executor for `node-runtime` `TestClient`. -pub type Executor = sc_executor::NativeExecutor; - -/// Default backend type. -pub type Backend = sc_client_db::Backend; - -/// Test client type. -pub type Client = client::Client< - Backend, - client::LocalCallExecutor, - edgeware_primitives::Block, - edgeware_runtime::RuntimeApi, ->; - -/// Transaction for node-runtime. -pub type Transaction = sc_client_api::backend::TransactionFor; - -/// Genesis configuration parameters for `TestClient`. -#[derive(Default)] -pub struct GenesisParameters { - support_changes_trie: bool, -} - -impl substrate_test_client::GenesisInit for GenesisParameters { - fn genesis_storage(&self) -> Storage { - crate::genesis::config(self.support_changes_trie, None).build_storage().unwrap() - } -} - -/// A `test-runtime` extensions to `TestClientBuilder`. -pub trait TestClientBuilderExt: Sized { - /// Create test client builder. - fn new() -> Self; - - /// Build the test client. - fn build(self) -> Client; -} - -impl TestClientBuilderExt for substrate_test_client::TestClientBuilder< - edgeware_primitives::Block, - client::LocalCallExecutor, - Backend, - GenesisParameters, -> { - fn new() -> Self{ - Self::default() - } - - fn build(self) -> Client { - self.build_with_native_executor(None).0 - } -} diff --git a/node/testing/src/genesis.rs b/node/testing/src/genesis.rs deleted file mode 100644 index 41ca8c04..00000000 --- a/node/testing/src/genesis.rs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2018-2020 Commonwealth Labs, Inc. -// This file is part of Edgeware. - -// Edgeware 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. - -// Edgeware 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 Edgeware. If not, see . - -//! Genesis Configuration. - -use crate::keyring::*; -use edgeware_runtime::constants::currency::*; -use edgeware_runtime::{ - BalancesConfig, GenesisConfig, GrandpaConfig, IndicesConfig, SessionConfig, - StakingConfig, SystemConfig, wasm_binary_unwrap, -}; -use sp_core::ChangesTrieConfiguration; -use sp_keyring::{Ed25519Keyring, Sr25519Keyring}; -use sp_runtime::Perbill; - -/// Create genesis runtime configuration for tests. -pub fn config(support_changes_trie: bool, code: Option<&[u8]>) -> GenesisConfig { - let endowed = vec![ - (alice(), 111 * DOLLARS), - (bob(), 100 * DOLLARS), - (charlie(), 100_000_000 * DOLLARS), - (dave(), 111 * DOLLARS), - (eve(), 101 * DOLLARS), - (ferdie(), 100 * DOLLARS), - ]; - - GenesisConfig { - frame_system: Some(SystemConfig { - changes_trie_config: if support_changes_trie { Some(ChangesTrieConfiguration { - digest_interval: 2, - digest_levels: 2, - }) } else { None }, - code: code.map(|x| x.to_vec()).unwrap_or_else(|| wasm_binary_unwrap().to_vec()), - }), - pallet_indices: Some(IndicesConfig { indices: vec![] }), - pallet_balances: Some(BalancesConfig { balances: endowed }), - pallet_session: Some(SessionConfig { - keys: vec![ - ( - dave(), - alice(), - to_session_keys(&Ed25519Keyring::Alice, &Sr25519Keyring::Alice), - ), - ( - eve(), - bob(), - to_session_keys(&Ed25519Keyring::Bob, &Sr25519Keyring::Bob), - ), - ( - ferdie(), - charlie(), - to_session_keys(&Ed25519Keyring::Charlie, &Sr25519Keyring::Charlie), - ), - ], - }), - pallet_staking: Some(StakingConfig { - stakers: vec![ - ( - dave(), - alice(), - 111 * DOLLARS, - pallet_staking::StakerStatus::Validator, - ), - ( - eve(), - bob(), - 100 * DOLLARS, - pallet_staking::StakerStatus::Validator, - ), - ( - ferdie(), - charlie(), - 100 * DOLLARS, - pallet_staking::StakerStatus::Validator, - ), - ], - validator_count: 3, - minimum_validator_count: 0, - slash_reward_fraction: Perbill::from_percent(10), - invulnerables: vec![alice(), bob(), charlie()], - ..Default::default() - }), - pallet_aura: Some(Default::default()), - pallet_grandpa: Some(GrandpaConfig { - authorities: vec![], - }), - pallet_im_online: Some(Default::default()), - pallet_authority_discovery: Some(Default::default()), - pallet_democracy: Some(Default::default()), - pallet_collective_Instance1: Some(Default::default()), - pallet_treasury: Some(Default::default()), - pallet_elections_phragmen: Some(Default::default()), - pallet_sudo: Some(Default::default()), - pallet_vesting: Some(Default::default()), - pallet_evm: Some(Default::default()), - pallet_ethereum: Some(Default::default()), - pallet_contracts: Some(Default::default()), - treasury_reward: Some(Default::default()), - } -} diff --git a/node/testing/src/keyring.rs b/node/testing/src/keyring.rs deleted file mode 100644 index f0740ad1..00000000 --- a/node/testing/src/keyring.rs +++ /dev/null @@ -1,107 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program 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. - -// This program 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 this program. If not, see . - -//! Test accounts. - -use sp_keyring::{AccountKeyring, Sr25519Keyring, Ed25519Keyring}; -use edgeware_primitives::{AccountId, Balance, Index}; -use edgeware_runtime::{CheckedExtrinsic, UncheckedExtrinsic, SessionKeys, SignedExtra}; -use sp_runtime::generic::Era; -use codec::Encode; - -/// Alice's account id. -pub fn alice() -> AccountId { - AccountKeyring::Alice.into() -} - -/// Bob's account id. -pub fn bob() -> AccountId { - AccountKeyring::Bob.into() -} - -/// Charlie's account id. -pub fn charlie() -> AccountId { - AccountKeyring::Charlie.into() -} - -/// Dave's account id. -pub fn dave() -> AccountId { - AccountKeyring::Dave.into() -} - -/// Eve's account id. -pub fn eve() -> AccountId { - AccountKeyring::Eve.into() -} - -/// Ferdie's account id. -pub fn ferdie() -> AccountId { - AccountKeyring::Ferdie.into() -} - -/// Convert keyrings into `SessionKeys`. -pub fn to_session_keys( - ed25519_keyring: &Ed25519Keyring, - sr25519_keyring: &Sr25519Keyring, -) -> SessionKeys { - SessionKeys { - grandpa: ed25519_keyring.to_owned().public().into(), - aura: ed25519_keyring.to_owned().public().into(), - im_online: ed25519_keyring.to_owned().public().into(), - authority_discovery: sr25519_keyring.to_owned().public().into(), - } -} - -/// Returns transaction extra. -pub fn signed_extra(nonce: Index, extra_fee: Balance) -> SignedExtra { - ( - frame_system::CheckSpecVersion::new(), - frame_system::CheckTxVersion::new(), - frame_system::CheckGenesis::new(), - frame_system::CheckEra::from(Era::mortal(256, 0)), - frame_system::CheckNonce::from(nonce), - frame_system::CheckWeight::new(), - pallet_transaction_payment::ChargeTransactionPayment::from(extra_fee), - ) -} - -/// Sign given `CheckedExtrinsic`. -pub fn sign(xt: CheckedExtrinsic, spec_version: u32, tx_version: u32, genesis_hash: [u8; 32]) -> UncheckedExtrinsic { - match xt.signed { - Some((signed, extra)) => { - let payload = (xt.function, extra.clone(), spec_version, tx_version, genesis_hash, genesis_hash); - let key = AccountKeyring::from_account_id(&signed).unwrap(); - let signature = payload.using_encoded(|b| { - if b.len() > 256 { - key.sign(&sp_io::hashing::blake2_256(b)) - } else { - key.sign(b) - } - }).into(); - UncheckedExtrinsic { - signature: Some((sp_runtime::MultiAddress::Id(signed), signature, extra)), - function: payload.0, - } - } - None => UncheckedExtrinsic { - signature: None, - function: xt.function, - }, - } -} - \ No newline at end of file diff --git a/node/testing/src/lib.rs b/node/testing/src/lib.rs deleted file mode 100644 index 78005fb4..00000000 --- a/node/testing/src/lib.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2018-2020 Commonwealth Labs, Inc. -// This file is part of Edgeware. - -// Edgeware 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. - -// Edgeware 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 Edgeware. If not, see . - -//! A set of testing utilities for Substrate Node. - -#![warn(missing_docs)] - -pub mod client; -pub mod genesis; -pub mod keyring; diff --git a/node/txpool/Cargo.toml b/node/txpool/Cargo.toml new file mode 100644 index 00000000..d6db9099 --- /dev/null +++ b/node/txpool/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "edgeware-rpc-primitives-txpool" +version = '0.1.0' +authors = ['PureStake'] +edition = '2018' +homepage = 'https://edgewa.re' +license = 'GPL-3.0-only' +repository = 'https://github.com/hicommonwealth/edgeware-node/' + +[dependencies] +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } +ethereum = { version = "0.7.1", default-features = false, features = ["with-codec"] } +sp-runtime = { version = "3.0", default-features = false } +sp-api = { version = "3.0", default-features = false } +sp-io = { version = "3.0", default-features = false } +sp-std = { version = "3.0", default-features = false } + +[features] +default = ["std"] +std = [ + "sp-api/std", + "sp-runtime/std", + "sp-io/std", + "sp-std/std", + "ethereum/std", +] diff --git a/node/txpool/src/lib.rs b/node/txpool/src/lib.rs new file mode 100644 index 00000000..b685e602 --- /dev/null +++ b/node/txpool/src/lib.rs @@ -0,0 +1,40 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam 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. + +// Moonbeam 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 Moonbeam. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] +// These clippy lints are disabled because the macro-generated code triggers them. +#![allow(clippy::unnecessary_mut_passed)] +#![allow(clippy::too_many_arguments)] + +use codec::{Decode, Encode}; +use ethereum::Transaction; +use sp_runtime::traits::Block as BlockT; +use sp_std::vec::Vec; + +#[derive(Eq, PartialEq, Clone, Encode, Decode, sp_runtime::RuntimeDebug)] +pub struct TxPoolResponse { + pub ready: Vec, + pub future: Vec, +} + +sp_api::decl_runtime_apis! { + pub trait TxPoolRuntimeApi { + fn extrinsic_filter( + xt_ready: Vec<::Extrinsic>, + xt_future: Vec<::Extrinsic>, + ) -> TxPoolResponse; + } +} diff --git a/pallets/edge-treasury-reward/Cargo.toml b/pallets/edge-treasury-reward/Cargo.toml new file mode 100644 index 00000000..7196b09d --- /dev/null +++ b/pallets/edge-treasury-reward/Cargo.toml @@ -0,0 +1,47 @@ +[package] +name = "edge-treasury-reward" +version = "1.0.0" +authors = ["drewstone "] +edition = "2018" +license = "GPL-3.0-or-later WITH Classpath-exception-2.0" +description = "Edgeware treasury reward module" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +serde = { version = "1.0", default-features = false, optional = true } +safe-mix = { version = "1.0", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +sp-std = { version = "3.0", default-features = false } +sp-runtime = { version = "3.0", default-features = false } +frame-support = { version = "3.0", default-features = false } +frame-system = { version = "3.0", default-features = false } +pallet-authorship = { version = "3.0", default-features = false } +pallet-staking = { version = "3.0", default-features = false } +pallet-balances = { version = "3.0", default-features = false } +pallet-treasury = { version = "3.0", default-features = false } + +[dev-dependencies] +sp-io = { version = "3.0", default-features = false } +sp-staking = { version = "3.0", default-features = false } +sp-core = { version = "3.0", default-features = false } +pallet-staking-reward-curve = { version = "3.0", default-features = false } +pallet-session = { version = "3.0", default-features = false } +pallet-timestamp = { version = "3.0", default-features = false } + +[features] +default = ["std"] +std = [ + "serde", + "safe-mix/std", + "codec/std", + "sp-std/std", + "sp-runtime/std", + "pallet-authorship/std", + "pallet-balances/std", + "frame-support/std", + "frame-system/std", + "pallet-staking/std", + "pallet-treasury/std", +] diff --git a/pallets/edge-treasury-reward/src/lib.rs b/pallets/edge-treasury-reward/src/lib.rs new file mode 100644 index 00000000..2a8f1dcb --- /dev/null +++ b/pallets/edge-treasury-reward/src/lib.rs @@ -0,0 +1,132 @@ +// Copyright 2018-2020 Commonwealth Labs, Inc. +// This file is part of Edgeware. + +// Edgeware 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. + +// Edgeware 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 Edgeware. If not, see . + +#![recursion_limit = "128"] +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(test)] +pub mod mock; + +#[cfg(test)] +pub mod tests; + +use frame_support::traits::Currency; +pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; + +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + use sp_runtime::traits::Zero; + + /// The pallet's configuration trait. + #[pallet::config] + pub trait Config: frame_system::Config + pallet_balances::Config + pallet_treasury::Config { + /// The overarching event type. + type Event: From> + IsType<::Event>; + + /// The account balance + type Currency: Currency; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pallet::metadata(T::Balance = "Balance", T::BlockNumber = "BlockNumber", T::AccountId = "AccountId")] + pub enum Event { + /// Treasury minting event + TreasuryMinting(T::Balance, T::BlockNumber, T::AccountId), + } + + /// The next tree identifier up for grabs + #[pallet::storage] + #[pallet::getter(fn minting_interval)] + pub type MintingInterval = StorageValue<_, T::BlockNumber, ValueQuery>; + + /// The next tree identifier up for grabs + #[pallet::storage] + #[pallet::getter(fn current_payout)] + pub type CurrentPayout = StorageValue<_, BalanceOf, ValueQuery>; + + #[pallet::pallet] + pub struct Pallet(PhantomData); + + #[pallet::genesis_config] + pub struct GenesisConfig { + // tokens to create + min_balance for that token + pub minting_interval: T::BlockNumber, + // endowed accounts for a token + their balances + pub current_payout: BalanceOf, + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + GenesisConfig { + minting_interval: Zero::zero(), + current_payout: Zero::zero(), + } + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + MintingInterval::::put(self.minting_interval); + CurrentPayout::::put(self.current_payout); + } + } + + #[pallet::hooks] + impl Hooks for Pallet { + fn on_finalize(_n: T::BlockNumber) { + if >::block_number() % Self::minting_interval() == Zero::zero() { + let reward = Self::current_payout(); + if reward.is_zero() { return; } + ::Currency::deposit_creating(&>::account_id(), reward); + Self::deposit_event(Event::TreasuryMinting( + >::free_balance(>::account_id()), + >::block_number(), + >::account_id(), + )); + } + } + } + + #[pallet::call] + impl Pallet { + /// Sets the fixed treasury payout per minting interval. + #[pallet::weight(5_000_000)] + pub(super) fn set_current_payout(origin: OriginFor, payout: BalanceOf) -> DispatchResultWithPostInfo { + ensure_root(origin)?; + >::put(payout); + Ok(().into()) + } + + /// Sets the treasury minting interval. + #[pallet::weight(5_000_000)] + pub(super) fn set_minting_interval( + origin: OriginFor, + interval: T::BlockNumber, + ) -> DispatchResultWithPostInfo { + ensure_root(origin)?; + >::put(interval); + Ok(().into()) + } + } +} diff --git a/pallets/edge-treasury-reward/src/mock.rs b/pallets/edge-treasury-reward/src/mock.rs new file mode 100644 index 00000000..efd5e0d3 --- /dev/null +++ b/pallets/edge-treasury-reward/src/mock.rs @@ -0,0 +1,157 @@ +use super::*; +use crate as treasury_reward; +use frame_support::{construct_runtime, parameter_types, traits::GenesisBuild, weights::Weight, PalletId}; +use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; +use sp_runtime::{traits::One, Permill}; + +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + AccountId32, Perbill, +}; + +pub(crate) type Balance = u64; +pub type Amount = i128; +pub type CurrencyId = u64; +pub type AccountId = AccountId32; +pub type BlockNumber = u64; + +// Configure a mock runtime to test the pallet. +type UncheckedExtrinsic = MockUncheckedExtrinsic; +type Block = MockBlock; + +construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, + TreasuryReward: treasury_reward::{Pallet, Call, Storage, Config, Event}, + } +); + +parameter_types! { + pub Prefix: u8 = 100; + pub const BlockHashCount: u64 = 250; + pub const MaximumBlockWeight: Weight = 1024; + pub const MaximumBlockLength: u32 = 2 * 1024; + pub const AvailableBlockRatio: Perbill = Perbill::one(); +} + +impl frame_system::Config for Test { + type AccountData = pallet_balances::AccountData; + type AccountId = AccountId; + type BaseCallFilter = (); + type BlockHashCount = BlockHashCount; + type BlockLength = (); + type BlockNumber = BlockNumber; + type BlockWeights = (); + type Call = Call; + type DbWeight = (); + type Event = Event; + type Hash = H256; + type Hashing = BlakeTwo256; + type Header = Header; + type Index = u64; + type Lookup = IdentityLookup; + type OnKilledAccount = (); + type OnNewAccount = (); + type OnSetCode = (); + type Origin = Origin; + type PalletInfo = PalletInfo; + type SS58Prefix = Prefix; + type SystemWeightInfo = (); + type Version = (); +} + +parameter_types! { + pub const ExistentialDeposit: Balance = 0; + pub const MaxLocks: u32 = 50; + pub const MaxTreeDepth: u8 = 32; + pub const CacheBlockLength: u64 = 5; + // Minimum deposit length is 1 month w/ 6 second blocks + pub const MinimumDepositLength: u64 = 10 * 60 * 24 * 28; +} + +impl pallet_balances::Config for Test { + type AccountStore = System; + type Balance = Balance; + type DustRemoval = (); + type Event = Event; + type ExistentialDeposit = ExistentialDeposit; + type MaxLocks = MaxLocks; + type WeightInfo = (); +} + +parameter_types! { + pub const ProposalBond: Permill = Permill::from_percent(5); + pub const ProposalBondMinimum: u64 = 1; + pub const SpendPeriod: u64 = 2; + pub const Burn: Permill = Permill::from_percent(50); + pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); + pub const MaxApprovals: u32 = 100; +} + +impl pallet_treasury::Config for Test { + type ApproveOrigin = frame_system::EnsureRoot; + type Burn = Burn; + type BurnDestination = (); + type Currency = Balances; + type Event = Event; + type MaxApprovals = MaxApprovals; + type OnSlash = (); + type PalletId = TreasuryPalletId; + type ProposalBond = ProposalBond; + type ProposalBondMinimum = ProposalBondMinimum; + type RejectOrigin = frame_system::EnsureRoot; + type SpendFunds = (); + type SpendPeriod = SpendPeriod; + type WeightInfo = (); +} + +impl Config for Test { + type Currency = Balances; + type Event = Event; +} + +pub type TreasuryCurrencyAdapter = ::Currency; + +pub const ALICE: AccountId = AccountId32::new([0u8; 32]); +pub const BOB: AccountId = AccountId32::new([1u8; 32]); +pub const TREASURY_ACCOUNT: AccountId = AccountId32::new([2u8; 32]); +// Build genesis storage according to the mock runtime. +pub fn new_test_ext() -> sp_io::TestExternalities { + use pallet_balances::GenesisConfig as BalancesConfig; + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + + BalancesConfig:: { + // Total issuance will be 200 with treasury account initialized at ED. + balances: vec![ + (ALICE, 1_000_000_000_000_000_000), + (BOB, 1_000_000_000_000_000_000), + (TREASURY_ACCOUNT, 1_000_000_000_000_000_000), + ], + } + .assimilate_storage(&mut t) + .unwrap(); + + treasury_reward::GenesisConfig:: { + current_payout: 9500000, + minting_interval: One::one(), + } + .assimilate_storage(&mut t) + .unwrap(); + + t.into() +} + +pub fn last_event() -> Event { + frame_system::Pallet::::events() + .pop() + .expect("Event expected") + .event +} diff --git a/pallets/edge-treasury-reward/src/tests.rs b/pallets/edge-treasury-reward/src/tests.rs new file mode 100644 index 00000000..9a480f62 --- /dev/null +++ b/pallets/edge-treasury-reward/src/tests.rs @@ -0,0 +1,147 @@ +// Copyright 2018-2020 Commonwealth Labs, Inc. +// This file is part of Edgeware. + +// Edgeware 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. + +// Edgeware 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 Edgeware. If not, see . + +use super::*; +use crate::mock::*; +use mock::{Event, last_event}; + +use frame_support::traits::OnFinalize; + +#[test] +fn basic_setup_works() { + // Verifies initial conditions of mock + new_test_ext().execute_with(|| { + // Initial Era and session + let treasury_address = Treasury::account_id(); + System::set_block_number(1); + >::on_finalize(1); + System::set_block_number(2); + >::on_finalize(2); + System::set_block_number(100); + >::on_finalize(101); + System::set_block_number(101); + >::on_finalize(102); + System::set_block_number(102); + >::on_finalize(103); + System::set_block_number(103); + >::on_finalize(104); + assert_eq!(Balances::free_balance(treasury_address.clone()) > 0, true); + }); +} + +#[test] +fn setting_treasury_block_reward() { + new_test_ext().execute_with(|| { + // Initial Era and session + // Minting interval is 1 + let treasury_address = Treasury::account_id(); + + // 95 EDG to block 1 + System::set_block_number(1); + >::on_finalize(1); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 9500000, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(9500000, 1, treasury_address.clone()) + )); + + // 95 EDG to block 2 + System::set_block_number(2); + >::on_finalize(2); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 19000000, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(19000000, 2, treasury_address.clone()) + )); + + // Reduce minting interval to 2 + ::set_current_payout(frame_system::RawOrigin::Root.into(), 95).unwrap(); + ::set_minting_interval(frame_system::RawOrigin::Root.into(), 2).unwrap(); + + // 0 EDG to block 3 + System::set_block_number(3); + >::on_finalize(3); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 19000000, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(19000000, 2, treasury_address.clone()) + )); + + // 95 EDG to block 4 + System::set_block_number(4); + >::on_finalize(4); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 19000095, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(19000095, 4, treasury_address.clone()) + )); + + // Reduce payout to 0 + ::set_current_payout(frame_system::RawOrigin::Root.into(), 0).unwrap(); + + // 0 EDG to block 5 + System::set_block_number(5); + >::on_finalize(5); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 19000095, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(19000095, 4, treasury_address.clone()) + )); + + // 0 EDG to block 6 + System::set_block_number(6); + >::on_finalize(6); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 19000095, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(19000095, 4, treasury_address.clone()) + )); + + // Increase payout to 105 + ::set_current_payout(frame_system::RawOrigin::Root.into(), 105).unwrap(); + + // 0 EDG to block 7 + System::set_block_number(7); + >::on_finalize(7); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 19000095, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(19000095, 4, treasury_address.clone()) + )); + + // 105 EDG to block 8 + System::set_block_number(8); + >::on_finalize(8); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 19000200, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(19000200, 8, treasury_address.clone()) + )); + + // Reduce payout to 10 + // Set minting interval to every block + ::set_minting_interval(frame_system::RawOrigin::Root.into(), 1).unwrap(); + ::set_current_payout(frame_system::RawOrigin::Root.into(), 10).unwrap(); + + // 10 EDG to block 9 + System::set_block_number(9); + >::on_finalize(9); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 19000210, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(19000210, 9, treasury_address.clone()) + )); + + // 10 EDG to block 10 + System::set_block_number(10); + >::on_finalize(10); + assert_eq!(Balances::free_balance(treasury_address.clone()) == 19000220, true); + assert_eq!(last_event(), Event::treasury_reward( + crate::Event::TreasuryMinting(19000220, 10, treasury_address.clone()) + )); + }); +} diff --git a/pallets/nft/Cargo.toml b/pallets/nft/Cargo.toml new file mode 100644 index 00000000..6670bd65 --- /dev/null +++ b/pallets/nft/Cargo.toml @@ -0,0 +1,53 @@ +[package] +name = "module-nft" +version = "1.0.0" +authors = ["Acala Developers"] +edition = "2018" + +[dependencies] +serde = { version = "1.0.124", optional = true } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } +enumflags2 = { version = "0.6.3" } + +frame-benchmarking = { version = "3.0", default-features = false, optional = true} +frame-support = { version = "3.0", default-features = false } +frame-system = { version = "3.0", default-features = false } +pallet-proxy = { version = "3.0", default-features = false } +primitives = { package = "edgeware-primitives", path = "../../node/primitives", default-features = false } +sp-runtime = { version = "3.0", default-features = false } +sp-std = { version = "3.0", default-features = false } + +orml-nft = { path = "../orml-nft", default-features = false } +orml-traits = { package = "webb-traits", git = "https://github.com/webb-tools/anon", branch = "erup-4", default-features = false } + +[dev-dependencies] +sp-core = { version = "3.0", default-features = false } +sp-io = { version = "3.0", default-features = false } +pallet-balances = { version = "3.0", default-features = false } +pallet-utility = { version = "3.0", default-features = false } + +orml-tokens = { package = "webb-tokens", git = "https://github.com/webb-tools/anon", branch = "erup-4" } +currencies = { package = "webb-currencies", git = "https://github.com/webb-tools/anon", branch = "erup-4" } + +[features] +default = ["std"] +std = [ + "serde", + "codec/std", + "enumflags2/serde", + "sp-std/std", + "sp-runtime/std", + "frame-support/std", + "frame-system/std", + "pallet-proxy/std", + "primitives/std", + "orml-traits/std", + "orml-nft/std", + "enumflags2/serde", +] +runtime-benchmarks = [ + "frame-benchmarking", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", +] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/nft/src/benchmarking.rs b/pallets/nft/src/benchmarking.rs new file mode 100644 index 00000000..5ae1c8c9 --- /dev/null +++ b/pallets/nft/src/benchmarking.rs @@ -0,0 +1,355 @@ +// This file is part of Acala. + +// Copyright (C) 2020-2021 Acala Foundation. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Benchmarks for the nft module. + +#![cfg(feature = "runtime-benchmarks")] + +use sp_std::prelude::*; +use sp_std::vec; + +use frame_benchmarking::{account, benchmarks}; +use frame_support::{traits::Get, weights::DispatchClass}; +use frame_system::RawOrigin; +use sp_runtime::traits::{AccountIdConversion, StaticLookup, UniqueSaturatedInto}; + +pub use crate::*; +use primitives::Balance; + +pub struct Module(crate::Pallet); + +const SEED: u32 = 0; + +fn dollar(d: u32) -> Balance { + let d: Balance = d.into(); + d.saturating_mul(1_000_000_000_000_000_000) +} + +benchmarks! { + // create NFT class + create_class { + let caller: T::AccountId = account("caller", 0, SEED); + let base_currency_amount = dollar(1000); + + T::Currency::make_free_balance_be(&caller, base_currency_amount.unique_saturated_into()); + }: _(RawOrigin::Signed(caller), vec![1], Properties(ClassProperty::Transferable | ClassProperty::Burnable)) + + // mint NFT token + mint { + let i in 1 .. 1000; + + let caller: T::AccountId = account("caller", 0, SEED); + let to: T::AccountId = account("to", 0, SEED); + let to_lookup = T::Lookup::unlookup(to); + + let base_currency_amount = dollar(1000); + T::Currency::make_free_balance_be(&caller, base_currency_amount.unique_saturated_into()); + + let module_account: T::AccountId = T::PalletId::get().into_sub_account(orml_nft::Pallet::::next_class_id()); + crate::Pallet::::create_class(RawOrigin::Signed(caller).into(), vec![1], Properties(ClassProperty::Transferable | ClassProperty::Burnable))?; + T::Currency::make_free_balance_be(&module_account, base_currency_amount.unique_saturated_into()); + }: _(RawOrigin::Signed(module_account), to_lookup, 0u32.into(), vec![1], i) + + // transfer NFT token to another account + transfer { + let caller: T::AccountId = account("caller", 0, SEED); + let caller_lookup = T::Lookup::unlookup(caller.clone()); + let to: T::AccountId = account("to", 0, SEED); + let to_lookup = T::Lookup::unlookup(to.clone()); + + let base_currency_amount = dollar(1000); + T::Currency::make_free_balance_be(&caller, base_currency_amount.unique_saturated_into()); + + let module_account: T::AccountId = T::PalletId::get().into_sub_account(orml_nft::Pallet::::next_class_id()); + crate::Pallet::::create_class(RawOrigin::Signed(caller).into(), vec![1], Properties(ClassProperty::Transferable | ClassProperty::Burnable))?; + T::Currency::make_free_balance_be(&module_account, base_currency_amount.unique_saturated_into()); + crate::Pallet::::mint(RawOrigin::Signed(module_account).into(), to_lookup, 0u32.into(), vec![1], 1)?; + }: _(RawOrigin::Signed(to), caller_lookup, (0u32.into(), 0u32.into())) + + // burn NFT token + burn { + let caller: T::AccountId = account("caller", 0, SEED); + let to: T::AccountId = account("to", 0, SEED); + let to_lookup = T::Lookup::unlookup(to.clone()); + + let base_currency_amount = dollar(1000); + T::Currency::make_free_balance_be(&caller, base_currency_amount.unique_saturated_into()); + + let module_account: T::AccountId = T::PalletId::get().into_sub_account(orml_nft::Pallet::::next_class_id()); + crate::Pallet::::create_class(RawOrigin::Signed(caller).into(), vec![1], Properties(ClassProperty::Transferable | ClassProperty::Burnable))?; + T::Currency::make_free_balance_be(&module_account, base_currency_amount.unique_saturated_into()); + crate::Pallet::::mint(RawOrigin::Signed(module_account).into(), to_lookup, 0u32.into(), vec![1], 1)?; + }: _(RawOrigin::Signed(to), (0u32.into(), 0u32.into())) + + // burn NFT token with remark + burn_with_remark { + let b in 0 .. *T::BlockLength::get().max.get(DispatchClass::Normal) as u32; + let remark_message = vec![1; b as usize]; + let caller: T::AccountId = account("caller", 0, SEED); + let to: T::AccountId = account("to", 0, SEED); + let to_lookup = T::Lookup::unlookup(to.clone()); + + let base_currency_amount = dollar(1000); + T::Currency::make_free_balance_be(&caller, base_currency_amount.unique_saturated_into()); + + let module_account: T::AccountId = T::PalletId::get().into_sub_account(orml_nft::Pallet::::next_class_id()); + crate::Pallet::::create_class(RawOrigin::Signed(caller).into(), vec![1], Properties(ClassProperty::Transferable | ClassProperty::Burnable))?; + T::Currency::make_free_balance_be(&module_account, base_currency_amount.unique_saturated_into()); + crate::Pallet::::mint(RawOrigin::Signed(module_account).into(), to_lookup, 0u32.into(), vec![1], 1)?; + }: _(RawOrigin::Signed(to), (0u32.into(), 0u32.into()), remark_message) + + // destroy NFT class + destroy_class { + let caller: T::AccountId = account("caller", 0, SEED); + let caller_lookup = T::Lookup::unlookup(caller.clone()); + + let base_currency_amount = dollar(1000); + + T::Currency::make_free_balance_be(&caller, base_currency_amount.unique_saturated_into()); + + let module_account: T::AccountId = T::PalletId::get().into_sub_account(orml_nft::Pallet::::next_class_id()); + crate::Pallet::::create_class(RawOrigin::Signed(caller).into(), vec![1], Properties(ClassProperty::Transferable | ClassProperty::Burnable))?; + }: _(RawOrigin::Signed(module_account), 0u32.into(), caller_lookup) +} + +#[cfg(test)] +mod mock { + use super::*; + use crate as nft; + + use codec::{Decode, Encode}; + use frame_support::{ + parameter_types, + traits::{Filter, InstanceFilter}, + weights::Weight, + PalletId, RuntimeDebug, + }; + use sp_core::{crypto::AccountId32, H256}; + use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + Perbill, + }; + + parameter_types! { + pub const BlockHashCount: u64 = 250; + pub const MaximumBlockWeight: Weight = 1024; + pub const MaximumBlockLength: u32 = 2 * 1024; + pub const AvailableBlockRatio: Perbill = Perbill::one(); + } + + pub type AccountId = AccountId32; + + impl frame_system::Config for Runtime { + type BaseCallFilter = BaseFilter; + type Origin = Origin; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Call = Call; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type Header = Header; + type Event = (); + type BlockHashCount = BlockHashCount; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + } + parameter_types! { + pub const ExistentialDeposit: u64 = 1; + } + impl pallet_balances::Config for Runtime { + type Balance = Balance; + type Event = (); + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = frame_system::Pallet; + type MaxLocks = (); + type WeightInfo = (); + } + impl pallet_utility::Config for Runtime { + type Event = (); + type Call = Call; + type WeightInfo = (); + } + parameter_types! { + pub const ProxyDepositBase: u64 = 1; + pub const ProxyDepositFactor: u64 = 1; + pub const MaxProxies: u16 = 4; + pub const MaxPending: u32 = 2; + pub const AnnouncementDepositBase: u64 = 1; + pub const AnnouncementDepositFactor: u64 = 1; + } + #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug)] + pub enum ProxyType { + Any, + JustTransfer, + JustUtility, + } + impl Default for ProxyType { + fn default() -> Self { + Self::Any + } + } + impl InstanceFilter for ProxyType { + fn filter(&self, c: &Call) -> bool { + match self { + ProxyType::Any => true, + ProxyType::JustTransfer => matches!(c, Call::Balances(pallet_balances::Call::transfer(..))), + ProxyType::JustUtility => matches!(c, Call::Utility(..)), + } + } + fn is_superset(&self, o: &Self) -> bool { + self == &ProxyType::Any || self == o + } + } + pub struct BaseFilter; + impl Filter for BaseFilter { + fn filter(c: &Call) -> bool { + match *c { + // Remark is used as a no-op call in the benchmarking + Call::System(SystemCall::remark(_)) => true, + Call::System(_) => false, + _ => true, + } + } + } + impl pallet_proxy::Config for Runtime { + type Event = (); + type Call = Call; + type Currency = Balances; + type ProxyType = ProxyType; + type ProxyDepositBase = ProxyDepositBase; + type ProxyDepositFactor = ProxyDepositFactor; + type MaxProxies = MaxProxies; + type WeightInfo = (); + type CallHasher = BlakeTwo256; + type MaxPending = MaxPending; + type AnnouncementDepositBase = AnnouncementDepositBase; + type AnnouncementDepositFactor = AnnouncementDepositFactor; + } + + parameter_types! { + pub const CreateClassDeposit: Balance = 200; + pub const CreateTokenDeposit: Balance = 100; + pub const NftPalletId: PalletId = PalletId(*b"aca/aNFT"); + } + impl crate::Config for Runtime { + type Event = (); + type CreateClassDeposit = CreateClassDeposit; + type CreateTokenDeposit = CreateTokenDeposit; + type PalletId = NftPalletId; + type WeightInfo = (); + } + + impl orml_nft::Config for Runtime { + type ClassId = u32; + type TokenId = u64; + type ClassData = ClassData; + type TokenData = TokenData; + } + + type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; + type Block = frame_system::mocking::MockBlock; + + frame_support::construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Utility: pallet_utility::{Pallet, Call, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, + OrmlNFT: orml_nft::{Pallet, Storage, Config}, + NFT: nft::{Pallet, Call, Event}, + } + ); + + use frame_system::Call as SystemCall; + + pub fn new_test_ext() -> sp_io::TestExternalities { + let t = frame_system::GenesisConfig::default() + .build_storage::() + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} + +#[cfg(test)] +mod tests { + use super::*; + use frame_support::assert_ok; + use mock::{new_test_ext, Runtime}; + + #[test] + fn test_create_class() { + new_test_ext().execute_with(|| { + assert_ok!(test_benchmark_create_class::()); + }); + } + + #[test] + fn test_mint() { + new_test_ext().execute_with(|| { + assert_ok!(test_benchmark_mint::()); + }); + } + + #[test] + fn test_transfer() { + new_test_ext().execute_with(|| { + assert_ok!(test_benchmark_transfer::()); + }); + } + + #[test] + fn test_burn() { + new_test_ext().execute_with(|| { + assert_ok!(test_benchmark_burn::()); + }); + } + + #[test] + fn test_burn_with_remark() { + new_test_ext().execute_with(|| { + assert_ok!(test_benchmark_burn_with_remark::()); + }); + } + + #[test] + fn test_destroy_class() { + new_test_ext().execute_with(|| { + assert_ok!(test_benchmark_destroy_class::()); + }); + } +} diff --git a/pallets/nft/src/lib.rs b/pallets/nft/src/lib.rs new file mode 100644 index 00000000..b6b8d80c --- /dev/null +++ b/pallets/nft/src/lib.rs @@ -0,0 +1,390 @@ +// This file is part of Acala. + +// Copyright (C) 2020-2021 Acala Foundation. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +#![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::unnecessary_cast)] +#![allow(clippy::unused_unit)] +#![allow(clippy::upper_case_acronyms)] + +use enumflags2::BitFlags; +use frame_support::{ + pallet_prelude::*, + traits::{ + Currency, + ExistenceRequirement::{AllowDeath, KeepAlive}, + ReservableCurrency, + }, + transactional, PalletId, +}; +use frame_system::pallet_prelude::*; +use orml_traits::NFT; +use primitives::NFTBalance; +#[cfg(feature = "std")] +use serde::{Deserialize, Serialize}; +use sp_runtime::{ + traits::{AccountIdConversion, Hash, Saturating, StaticLookup, Zero}, + DispatchResult, RuntimeDebug, +}; +use sp_std::vec::Vec; + +pub mod benchmarking; +mod mock; +mod tests; +pub mod weights; + +pub use module::*; +pub use weights::WeightInfo; + +pub type CID = Vec; + +#[repr(u8)] +#[derive(Encode, Decode, Clone, Copy, BitFlags, RuntimeDebug, PartialEq, Eq)] +pub enum ClassProperty { + /// Token can be transferred + Transferable = 0b00000001, + /// Token can be burned + Burnable = 0b00000010, +} + +#[derive(Clone, Copy, PartialEq, Default, RuntimeDebug)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub struct Properties(pub BitFlags); + +impl Eq for Properties {} +impl Encode for Properties { + fn using_encoded R>(&self, f: F) -> R { + self.0.bits().using_encoded(f) + } +} +impl Decode for Properties { + fn decode(input: &mut I) -> sp_std::result::Result { + let field = u8::decode(input)?; + Ok(Self( + >::from_bits(field as u8).map_err(|_| "invalid value")?, + )) + } +} + +#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub struct ClassData { + /// The minimum balance to create class + pub deposit: Balance, + /// Property of token + pub properties: Properties, +} + +#[derive(Encode, Decode, Clone, RuntimeDebug, PartialEq, Eq)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +pub struct TokenData { + /// The minimum balance to create token + pub deposit: Balance, +} + +pub type TokenIdOf = ::TokenId; +pub type ClassIdOf = ::ClassId; +pub type BalanceOf = + <::Currency as Currency<::AccountId>>::Balance; + +#[frame_support::pallet] +pub mod module { + use super::*; + + #[pallet::config] + pub trait Config: + frame_system::Config + + orml_nft::Config>, TokenData = TokenData>> + + pallet_proxy::Config + { + type Event: From> + IsType<::Event>; + + /// The minimum balance to create class + #[pallet::constant] + type CreateClassDeposit: Get>; + + /// The minimum balance to create token + #[pallet::constant] + type CreateTokenDeposit: Get>; + + /// The NFT's module id + #[pallet::constant] + type PalletId: Get; + + /// Weight information for the extrinsics in this module. + type WeightInfo: WeightInfo; + } + + #[pallet::error] + pub enum Error { + /// ClassId not found + ClassIdNotFound, + /// TokenId not found + TokenIdNotFound, + /// The operator is not the owner of the token and has no permission + NoPermission, + /// Quantity is invalid. need >= 1 + InvalidQuantity, + /// Property of class don't support transfer + NonTransferable, + /// Property of class don't support burn + NonBurnable, + /// Can not destroy class + /// Total issuance is not 0 + CannotDestroyClass, + } + + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + pub enum Event { + /// Created NFT class. \[owner, class_id\] + CreatedClass(T::AccountId, ClassIdOf), + /// Minted NFT token. \[from, to, class_id, quantity\] + MintedToken(T::AccountId, T::AccountId, ClassIdOf, u32), + /// Transferred NFT token. \[from, to, class_id, token_id\] + TransferredToken(T::AccountId, T::AccountId, ClassIdOf, TokenIdOf), + /// Burned NFT token. \[owner, class_id, token_id\] + BurnedToken(T::AccountId, ClassIdOf, TokenIdOf), + /// Burned NFT token with remark. \[owner, class_id, token_id, remark_hash\] + BurnedTokenWithRemark(T::AccountId, ClassIdOf, TokenIdOf, T::Hash), + /// Destroyed NFT class. \[owner, class_id\] + DestroyedClass(T::AccountId, ClassIdOf), + } + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::hooks] + impl Hooks for Pallet {} + + #[pallet::call] + impl Pallet { + /// Create NFT class, tokens belong to the class. + /// + /// - `metadata`: external metadata + /// - `properties`: class property, include `Transferable` `Burnable` + #[pallet::weight(::WeightInfo::create_class())] + #[transactional] + pub fn create_class(origin: OriginFor, metadata: CID, properties: Properties) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + let next_id = orml_nft::Pallet::::next_class_id(); + let owner: T::AccountId = T::PalletId::get().into_sub_account(next_id); + let class_deposit = T::CreateClassDeposit::get(); + + let proxy_deposit = >::deposit(1u32); + let total_deposit = proxy_deposit.saturating_add(class_deposit); + + // ensure enough token for proxy deposit + class deposit + T::Currency::transfer(&who, &owner, total_deposit, KeepAlive)?; + + T::Currency::reserve(&owner, class_deposit)?; + + // owner add proxy delegate to origin + >::add_proxy_delegate(&owner, who, Default::default(), Zero::zero())?; + + let data = ClassData { + deposit: class_deposit, + properties, + }; + orml_nft::Pallet::::create_class(&owner, metadata, data)?; + + Self::deposit_event(Event::CreatedClass(owner, next_id)); + Ok(().into()) + } + + /// Mint NFT token + /// + /// - `to`: the token owner's account + /// - `class_id`: token belong to the class id + /// - `metadata`: external metadata + /// - `quantity`: token quantity + #[pallet::weight(::WeightInfo::mint(*quantity))] + #[transactional] + pub fn mint( + origin: OriginFor, + to: ::Source, + class_id: ClassIdOf, + metadata: CID, + quantity: u32, + ) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + let to = T::Lookup::lookup(to)?; + ensure!(quantity >= 1, Error::::InvalidQuantity); + let class_info = orml_nft::Pallet::::classes(class_id).ok_or(Error::::ClassIdNotFound)?; + ensure!(who == class_info.owner, Error::::NoPermission); + let deposit = T::CreateTokenDeposit::get(); + let total_deposit = deposit.saturating_mul(quantity.into()); + + // `repatriate_reserved` will check `to` account exist and may return + // `DeadAccount`. + T::Currency::transfer(&who, &to, total_deposit, KeepAlive)?; + T::Currency::reserve(&to, total_deposit)?; + + let data = TokenData { deposit }; + for _ in 0..quantity { + orml_nft::Pallet::::mint(&to, class_id, metadata.clone(), data.clone())?; + } + + Self::deposit_event(Event::MintedToken(who, to, class_id, quantity)); + Ok(().into()) + } + + /// Transfer NFT token to another account + /// + /// - `to`: the token owner's account + /// - `token`: (class_id, token_id) + #[pallet::weight(::WeightInfo::transfer())] + #[transactional] + pub fn transfer( + origin: OriginFor, + to: ::Source, + token: (ClassIdOf, TokenIdOf), + ) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + let to = T::Lookup::lookup(to)?; + Self::do_transfer(&who, &to, token)?; + Ok(().into()) + } + + /// Burn NFT token + /// + /// - `token`: (class_id, token_id) + #[pallet::weight(::WeightInfo::burn())] + #[transactional] + pub fn burn(origin: OriginFor, token: (ClassIdOf, TokenIdOf)) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + Self::do_burn(&who, token)?; + Self::deposit_event(Event::BurnedToken(who, token.0, token.1)); + Ok(().into()) + } + + /// Burn NFT token + /// + /// - `token`: (class_id, token_id) + /// - `remark`: Vec + #[pallet::weight(::WeightInfo::burn_with_remark(remark.len() as u32))] + #[transactional] + pub fn burn_with_remark( + origin: OriginFor, + token: (ClassIdOf, TokenIdOf), + remark: Vec, + ) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + Self::do_burn(&who, token)?; + let hash = T::Hashing::hash(&remark[..]); + Self::deposit_event(Event::BurnedTokenWithRemark(who, token.0, token.1, hash)); + Ok(().into()) + } + + /// Destroy NFT class, remove dest from proxy, and send all the free + /// balance to dest + /// + /// - `class_id`: The class ID to destroy + /// - `dest`: The proxy account that will receive free balance + #[pallet::weight(::WeightInfo::destroy_class())] + #[transactional] + pub fn destroy_class( + origin: OriginFor, + class_id: ClassIdOf, + dest: ::Source, + ) -> DispatchResultWithPostInfo { + let who = ensure_signed(origin)?; + let dest = T::Lookup::lookup(dest)?; + let class_info = orml_nft::Pallet::::classes(class_id).ok_or(Error::::ClassIdNotFound)?; + ensure!(who == class_info.owner, Error::::NoPermission); + ensure!( + class_info.total_issuance == Zero::zero(), + Error::::CannotDestroyClass + ); + + let data = class_info.data; + + T::Currency::unreserve(&who, data.deposit); + + orml_nft::Pallet::::destroy_class(&who, class_id)?; + + // this should unresere proxy deposit + pallet_proxy::Pallet::::remove_proxy_delegate(&who, dest.clone(), Default::default(), Zero::zero())?; + + T::Currency::transfer(&who, &dest, T::Currency::free_balance(&who), AllowDeath)?; + + Self::deposit_event(Event::DestroyedClass(who, class_id)); + Ok(().into()) + } + } +} + +impl Pallet { + /// Ensured atomic. + #[transactional] + fn do_transfer(from: &T::AccountId, to: &T::AccountId, token: (ClassIdOf, TokenIdOf)) -> DispatchResult { + let class_info = orml_nft::Pallet::::classes(token.0).ok_or(Error::::ClassIdNotFound)?; + let data = class_info.data; + ensure!( + data.properties.0.contains(ClassProperty::Transferable), + Error::::NonTransferable + ); + + let token_info = orml_nft::Pallet::::tokens(token.0, token.1).ok_or(Error::::TokenIdNotFound)?; + + orml_nft::Pallet::::transfer(from, to, token)?; + + T::Currency::unreserve(&from, token_info.data.deposit); + T::Currency::transfer(&from, &to, token_info.data.deposit, AllowDeath)?; + T::Currency::reserve(&to, token_info.data.deposit)?; + + Self::deposit_event(Event::TransferredToken(from.clone(), to.clone(), token.0, token.1)); + Ok(()) + } + + /// Ensured atomic. + #[transactional] + fn do_burn(who: &T::AccountId, token: (ClassIdOf, TokenIdOf)) -> DispatchResult { + let class_info = orml_nft::Pallet::::classes(token.0).ok_or(Error::::ClassIdNotFound)?; + let data = class_info.data; + ensure!( + data.properties.0.contains(ClassProperty::Burnable), + Error::::NonBurnable + ); + + let token_info = orml_nft::Pallet::::tokens(token.0, token.1).ok_or(Error::::TokenIdNotFound)?; + ensure!(*who == token_info.owner, Error::::NoPermission); + + orml_nft::Pallet::::burn(&who, token)?; + + T::Currency::unreserve(&who, token_info.data.deposit); + Ok(()) + } +} + +impl NFT for Pallet { + type ClassId = ClassIdOf; + type TokenId = TokenIdOf; + type Balance = NFTBalance; + + fn balance(who: &T::AccountId) -> Self::Balance { + orml_nft::TokensByOwner::::iter_prefix(who).count() as u128 + } + + fn owner(token: (Self::ClassId, Self::TokenId)) -> Option { + orml_nft::Pallet::::tokens(token.0, token.1).map(|t| t.owner) + } + + fn transfer(from: &T::AccountId, to: &T::AccountId, token: (Self::ClassId, Self::TokenId)) -> DispatchResult { + Self::do_transfer(from, to, token) + } +} diff --git a/pallets/nft/src/mock.rs b/pallets/nft/src/mock.rs new file mode 100644 index 00000000..dac22c77 --- /dev/null +++ b/pallets/nft/src/mock.rs @@ -0,0 +1,269 @@ +// This file is part of Acala. + +// Copyright (C) 2020-2021 Acala Foundation. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +#![cfg(test)] + +use super::*; + +use crate as nft; +use codec::{Decode, Encode}; +use frame_support::{ + construct_runtime, parameter_types, + traits::{Filter, InstanceFilter}, + RuntimeDebug, +}; +use orml_traits::parameter_type_with_key; +use primitives::{Amount, Balance, BlockNumber, CurrencyId}; +use sp_core::{crypto::AccountId32, H256}; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, +}; +use currencies::BasicCurrencyAdapter; + +parameter_types! { + pub const BlockHashCount: u64 = 250; +} + +pub type AccountId = AccountId32; + +impl frame_system::Config for Runtime { + type BaseCallFilter = BaseFilter; + type Origin = Origin; + type Index = u64; + type BlockNumber = u64; + type Hash = H256; + type Call = Call; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type Header = Header; + type Event = Event; + type BlockHashCount = BlockHashCount; + type DbWeight = (); + type BlockWeights = (); + type BlockLength = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); +} +parameter_types! { + pub const ExistentialDeposit: u64 = 1; +} +impl pallet_balances::Config for Runtime { + type Balance = Balance; + type Event = Event; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = frame_system::Pallet; + type MaxLocks = (); + type WeightInfo = (); +} +impl pallet_utility::Config for Runtime { + type Event = Event; + type Call = Call; + type WeightInfo = (); +} +parameter_types! { + pub const ProxyDepositBase: u64 = 1; + pub const ProxyDepositFactor: u64 = 1; + pub const MaxProxies: u16 = 4; + pub const MaxPending: u32 = 2; + pub const AnnouncementDepositBase: u64 = 1; + pub const AnnouncementDepositFactor: u64 = 1; +} +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug)] +pub enum ProxyType { + Any, + JustTransfer, + JustUtility, +} +impl Default for ProxyType { + fn default() -> Self { + Self::Any + } +} +impl InstanceFilter for ProxyType { + fn filter(&self, c: &Call) -> bool { + match self { + ProxyType::Any => true, + ProxyType::JustTransfer => matches!(c, Call::Balances(pallet_balances::Call::transfer(..))), + ProxyType::JustUtility => matches!(c, Call::Utility(..)), + } + } + fn is_superset(&self, o: &Self) -> bool { + self == &ProxyType::Any || self == o + } +} +pub struct BaseFilter; +impl Filter for BaseFilter { + fn filter(c: &Call) -> bool { + match *c { + // Remark is used as a no-op call in the benchmarking + Call::System(SystemCall::remark(_)) => true, + Call::System(_) => false, + _ => true, + } + } +} +impl pallet_proxy::Config for Runtime { + type Event = Event; + type Call = Call; + type Currency = Balances; + type ProxyType = ProxyType; + type ProxyDepositBase = ProxyDepositBase; + type ProxyDepositFactor = ProxyDepositFactor; + type MaxProxies = MaxProxies; + type WeightInfo = (); + type CallHasher = BlakeTwo256; + type MaxPending = MaxPending; + type AnnouncementDepositBase = AnnouncementDepositBase; + type AnnouncementDepositFactor = AnnouncementDepositFactor; +} + +parameter_type_with_key! { + pub ExistentialDeposits: |_currency_id: CurrencyId| -> Balance { + Default::default() + }; +} + +parameter_types! { + pub const TokensPalletId: PalletId = PalletId(*b"py/token"); + pub const NativeCurrencyId: CurrencyId = 0; + pub const CurrencyDeposit: Balance = 1; + pub const ApprovalDeposit: Balance = 1; + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: Balance = 1; + pub const MetadataDepositPerByte: Balance = 1; +} + +impl orml_tokens::Config for Runtime { + type Amount = Amount; + type ApprovalDeposit = ApprovalDeposit; + type Balance = Balance; + type CurrencyDeposit = CurrencyDeposit; + type CurrencyId = CurrencyId; + type DustAccount = (); + type Event = Event; + type Extra = (); + type ForceOrigin = frame_system::EnsureRoot; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type NativeCurrency = BasicCurrencyAdapter; + type PalletId = TokensPalletId; + type StringLimit = StringLimit; + type WeightInfo = (); +} + +parameter_types! { + pub const GetNativeCurrencyId: CurrencyId = 0; +} + +impl currencies::Config for Runtime { + type Event = Event; + type GetNativeCurrencyId = NativeCurrencyId; + type MultiCurrency = Tokens; + type NativeCurrency = BasicCurrencyAdapter; + type WeightInfo = (); +} + +parameter_types! { + pub const CreateClassDeposit: Balance = 200; + pub const CreateTokenDeposit: Balance = 100; + pub const NftPalletId: PalletId = PalletId(*b"aca/aNFT"); +} +impl Config for Runtime { + type Event = Event; + type CreateClassDeposit = CreateClassDeposit; + type CreateTokenDeposit = CreateTokenDeposit; + type PalletId = NftPalletId; + type WeightInfo = (); +} + +impl orml_nft::Config for Runtime { + type ClassId = u32; + type TokenId = u64; + type ClassData = ClassData; + type TokenData = TokenData; +} + +use frame_system::Call as SystemCall; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + NFTModule: nft::{Pallet, Call, Event}, + OrmlNFT: orml_nft::{Pallet, Storage, Config}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, + Utility: pallet_utility::{Pallet, Call, Event}, + Tokens: orml_tokens::{Pallet, Storage, Event, Config}, + Currency: currencies::{Pallet, Call, Event}, + } +); + +pub const ALICE: AccountId = AccountId::new([1u8; 32]); +pub const BOB: AccountId = AccountId::new([2u8; 32]); +pub const CLASS_ID: ::ClassId = 0; +pub const CLASS_ID_NOT_EXIST: ::ClassId = 1; +pub const TOKEN_ID: ::TokenId = 0; +pub const TOKEN_ID_NOT_EXIST: ::TokenId = 1; + +pub struct ExtBuilder; +impl Default for ExtBuilder { + fn default() -> Self { + ExtBuilder + } +} + +impl ExtBuilder { + pub fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::default() + .build_storage::() + .unwrap(); + + pallet_balances::GenesisConfig:: { + balances: vec![(ALICE, 100000)], + } + .assimilate_storage(&mut t) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} + +pub fn last_event() -> Event { + frame_system::Pallet::::events() + .pop() + .expect("Event expected") + .event +} diff --git a/pallets/nft/src/tests.rs b/pallets/nft/src/tests.rs new file mode 100644 index 00000000..ccfd3aef --- /dev/null +++ b/pallets/nft/src/tests.rs @@ -0,0 +1,504 @@ +// This file is part of Acala. + +// Copyright (C) 2020-2021 Acala Foundation. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + +//! Unit tests for the non-fungible-token module. + +#![cfg(test)] + +use super::*; +use frame_support::traits::Currency; +use frame_support::{assert_noop, assert_ok}; +use mock::{Event, *}; +use orml_nft::TokenInfo; +use primitives::Balance; +use sp_runtime::traits::BlakeTwo256; + +fn free_balance(who: &AccountId) -> Balance { + ::Currency::free_balance(who) +} + +fn reserved_balance(who: &AccountId) -> Balance { + ::Currency::reserved_balance(who) +} + +fn class_id_account() -> AccountId { + ::PalletId::get().into_sub_account(CLASS_ID) +} + +#[test] +fn create_class_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Default::default() + )); + let event = Event::nft(crate::Event::CreatedClass(class_id_account(), CLASS_ID)); + assert_eq!(last_event(), event); + + assert_eq!( + reserved_balance(&class_id_account()), + ::CreateClassDeposit::get() + Proxy::deposit(1u32) + ); + }); +} + +#[test] +fn create_class_should_fail() { + ExtBuilder::default().build().execute_with(|| { + assert_noop!( + NFTModule::create_class( + Origin::signed(BOB), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + ), + pallet_balances::Error::::InsufficientBalance + ); + }); +} + +#[test] +fn mint_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + )); + let event = Event::nft(crate::Event::CreatedClass(class_id_account(), CLASS_ID)); + assert_eq!(last_event(), event); + + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 2 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![2], + 2 + )); + let event = Event::nft(crate::Event::MintedToken(class_id_account(), BOB, CLASS_ID, 2)); + assert_eq!(last_event(), event); + + assert_eq!( + reserved_balance(&class_id_account()), + ::CreateClassDeposit::get() + Proxy::deposit(1u32) + ); + + assert_eq!( + reserved_balance(&BOB), + 2 * ::CreateTokenDeposit::get() + ); + + assert_eq!( + orml_nft::Pallet::::tokens(0, 0).unwrap(), + TokenInfo { + metadata: vec![2], + owner: BOB, + data: TokenData { + deposit: ::CreateTokenDeposit::get() + } + } + ); + + assert_eq!( + orml_nft::Pallet::::tokens(0, 1).unwrap(), + TokenInfo { + metadata: vec![2], + owner: BOB, + data: TokenData { + deposit: ::CreateTokenDeposit::get() + } + } + ); + }); +} + +#[test] +fn mint_should_fail() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + )); + assert_noop!( + NFTModule::mint(Origin::signed(ALICE), BOB, CLASS_ID_NOT_EXIST, vec![1], 2), + Error::::ClassIdNotFound + ); + + assert_noop!( + NFTModule::mint(Origin::signed(BOB), BOB, CLASS_ID, vec![1], 0), + Error::::InvalidQuantity + ); + + assert_noop!( + NFTModule::mint(Origin::signed(BOB), BOB, CLASS_ID, vec![1], 2), + Error::::NoPermission + ); + + orml_nft::NextTokenId::::mutate(CLASS_ID, |id| { + *id = ::TokenId::max_value() + }); + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 2 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_noop!( + NFTModule::mint(Origin::signed(class_id_account()), BOB, CLASS_ID, vec![1], 2), + orml_nft::Error::::NoAvailableTokenId + ); + }); +} + +#[test] +fn transfer_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + )); + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 2 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![1], + 2 + )); + + assert_eq!( + reserved_balance(&BOB), + 2 * ::CreateTokenDeposit::get() + ); + + assert_ok!(NFTModule::transfer(Origin::signed(BOB), ALICE, (CLASS_ID, TOKEN_ID))); + let event = Event::nft(crate::Event::TransferredToken(BOB, ALICE, CLASS_ID, TOKEN_ID)); + assert_eq!(last_event(), event); + + assert_eq!( + reserved_balance(&BOB), + 1 * ::CreateTokenDeposit::get() + ); + assert_eq!( + reserved_balance(&ALICE), + 1 * ::CreateTokenDeposit::get() + ); + + assert_ok!(NFTModule::transfer(Origin::signed(ALICE), BOB, (CLASS_ID, TOKEN_ID))); + let event = Event::nft(crate::Event::TransferredToken(ALICE, BOB, CLASS_ID, TOKEN_ID)); + assert_eq!(last_event(), event); + + assert_eq!( + reserved_balance(&BOB), + 2 * ::CreateTokenDeposit::get() + ); + assert_eq!(reserved_balance(&ALICE), 0); + }); +} + +#[test] +fn transfer_should_fail() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + )); + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 1 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![1], + 1 + )); + assert_noop!( + NFTModule::transfer(Origin::signed(BOB), ALICE, (CLASS_ID_NOT_EXIST, TOKEN_ID)), + Error::::ClassIdNotFound + ); + assert_noop!( + NFTModule::transfer(Origin::signed(BOB), ALICE, (CLASS_ID, TOKEN_ID_NOT_EXIST)), + Error::::TokenIdNotFound + ); + assert_noop!( + NFTModule::transfer(Origin::signed(ALICE), BOB, (CLASS_ID, TOKEN_ID)), + orml_nft::Error::::NoPermission + ); + }); + + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Default::default() + )); + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 1 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![1], + 1 + )); + assert_noop!( + NFTModule::transfer(Origin::signed(BOB), ALICE, (CLASS_ID, TOKEN_ID)), + Error::::NonTransferable + ); + }); +} + +#[test] +fn burn_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + )); + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 1 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![1], + 1 + )); + assert_ok!(NFTModule::burn(Origin::signed(BOB), (CLASS_ID, TOKEN_ID))); + let event = Event::nft(crate::Event::BurnedToken(BOB, CLASS_ID, TOKEN_ID)); + assert_eq!(last_event(), event); + + assert_eq!( + reserved_balance(&class_id_account()), + ::CreateClassDeposit::get() + Proxy::deposit(1u32) + ); + }); +} + +#[test] +fn burn_should_fail() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + )); + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 1 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![1], + 1 + )); + assert_noop!( + NFTModule::burn(Origin::signed(BOB), (CLASS_ID, TOKEN_ID_NOT_EXIST)), + Error::::TokenIdNotFound + ); + + assert_noop!( + NFTModule::burn(Origin::signed(ALICE), (CLASS_ID, TOKEN_ID)), + Error::::NoPermission + ); + + orml_nft::Classes::::mutate(CLASS_ID, |class_info| { + class_info.as_mut().unwrap().total_issuance = 0; + }); + assert_noop!( + NFTModule::burn(Origin::signed(BOB), (CLASS_ID, TOKEN_ID)), + orml_nft::Error::::NumOverflow + ); + }); + + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Default::default() + )); + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 1 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![1], + 1 + )); + assert_noop!( + NFTModule::burn(Origin::signed(BOB), (CLASS_ID, TOKEN_ID)), + Error::::NonBurnable + ); + }); +} + +#[test] +fn burn_with_remark_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + )); + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 1 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![1], + 1 + )); + + let remark = "remark info".as_bytes().to_vec(); + let remark_hash = BlakeTwo256::hash(&remark[..]); + assert_ok!(NFTModule::burn_with_remark( + Origin::signed(BOB), + (CLASS_ID, TOKEN_ID), + remark + )); + let event = Event::nft(crate::Event::BurnedTokenWithRemark( + BOB, + CLASS_ID, + TOKEN_ID, + remark_hash, + )); + assert_eq!(last_event(), event); + + assert_eq!( + reserved_balance(&class_id_account()), + ::CreateClassDeposit::get() + Proxy::deposit(1u32) + ); + }); +} + +#[test] +fn destroy_class_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + )); + assert_ok!(Balances::deposit_into_existing( + &class_id_account(), + 1 * ::CreateTokenDeposit::get() + )); // + 100 + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![1], + 1 + )); + assert_ok!(NFTModule::burn(Origin::signed(BOB), (CLASS_ID, TOKEN_ID))); + assert_ok!(NFTModule::destroy_class( + Origin::signed(class_id_account()), + CLASS_ID, + ALICE + )); + let event = Event::nft(crate::Event::DestroyedClass(class_id_account(), CLASS_ID)); + assert_eq!(last_event(), event); + + assert_eq!(free_balance(&class_id_account()), 0); + assert_eq!(reserved_balance(&class_id_account()), 0); + assert_eq!(free_balance(&ALICE), 100000); + assert_eq!(free_balance(&BOB), ::CreateTokenDeposit::get()); + }); +} + +#[test] +fn destroy_class_should_fail() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NFTModule::create_class( + Origin::signed(ALICE), + vec![1], + Properties(ClassProperty::Transferable | ClassProperty::Burnable) + )); + assert_eq!( + Balances::deposit_into_existing(&class_id_account(), 1 * ::CreateTokenDeposit::get()) + .is_ok(), + true + ); + assert_ok!(NFTModule::mint( + Origin::signed(class_id_account()), + BOB, + CLASS_ID, + vec![1], + 1 + )); + assert_noop!( + NFTModule::destroy_class(Origin::signed(class_id_account()), CLASS_ID_NOT_EXIST, BOB), + Error::::ClassIdNotFound + ); + + assert_noop!( + NFTModule::destroy_class(Origin::signed(BOB), CLASS_ID, BOB), + Error::::NoPermission + ); + + assert_noop!( + NFTModule::destroy_class(Origin::signed(class_id_account()), CLASS_ID, BOB), + Error::::CannotDestroyClass + ); + + assert_ok!(NFTModule::burn(Origin::signed(BOB), (CLASS_ID, TOKEN_ID))); + + assert_noop!( + NFTModule::destroy_class(Origin::signed(class_id_account()), CLASS_ID, BOB), + pallet_proxy::Error::::NotFound + ); + + assert_ok!(NFTModule::destroy_class( + Origin::signed(class_id_account()), + CLASS_ID, + ALICE + )); + }); +} diff --git a/pallets/nft/src/weights.rs b/pallets/nft/src/weights.rs new file mode 100644 index 00000000..eac4b9ac --- /dev/null +++ b/pallets/nft/src/weights.rs @@ -0,0 +1,133 @@ +// This file is part of Acala. + +// Copyright (C) 2020-2021 Acala Foundation. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program 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. + +// This program 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 this program. If not, see . + + +//! Autogenerated weights for module_nft +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-02-24, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// target/release/acala +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=module_nft +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./modules/nft/src/weights.rs +// --template=../../module-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for module_nft. +pub trait WeightInfo { + fn create_class() -> Weight; + fn mint(i: u32, ) -> Weight; + fn transfer() -> Weight; + fn burn() -> Weight; + fn burn_with_remark(b: u32, ) -> Weight; + fn destroy_class() -> Weight; +} + +/// Weights for module_nft using the Acala node and recommended hardware. +pub struct AcalaWeight(PhantomData); +impl WeightInfo for AcalaWeight { + fn create_class() -> Weight { + (200_357_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn mint(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 5_000 + .saturating_add((17_893_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(i as Weight))) + } + fn transfer() -> Weight { + (54_749_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + fn burn() -> Weight { + (154_177_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + fn burn_with_remark(b: u32, ) -> Weight { + (154_177_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) + } + fn destroy_class() -> Weight { + (137_255_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn create_class() -> Weight { + (200_357_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn mint(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 5_000 + .saturating_add((17_893_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(i as Weight))) + } + fn transfer() -> Weight { + (54_749_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(3 as Weight)) + } + fn burn() -> Weight { + (154_177_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + } + fn burn_with_remark(b: u32, ) -> Weight { + (154_177_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) + } + fn destroy_class() -> Weight { + (137_255_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } +} diff --git a/pallets/orml-nft/Cargo.toml b/pallets/orml-nft/Cargo.toml new file mode 100644 index 00000000..5ade5832 --- /dev/null +++ b/pallets/orml-nft/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "orml-nft" +description = "Non-fungible token pallet provides basic functions to create and manager NFT" +repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/nft" +license = "Apache-2.0" +version = "0.4.1-dev" +authors = ["Acala Developers"] +edition = "2018" + +[dependencies] +serde = { version = "1.0.124", optional = true } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } +sp-std = { version = "3.0", default-features = false } +sp-runtime = { version = "3.0", default-features = false } + +frame-support = { version = "3.0", default-features = false } +frame-system = { version = "3.0", default-features = false } + +[dev-dependencies] +sp-io = { version = "3.0", default-features = false } +sp-core = { version = "3.0", default-features = false } + +[features] +default = ["std"] +std = [ + "serde", + "codec/std", + "sp-std/std", + "sp-runtime/std", + "frame-support/std", + "frame-system/std", +] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/orml-nft/README.md b/pallets/orml-nft/README.md new file mode 100644 index 00000000..54fe2525 --- /dev/null +++ b/pallets/orml-nft/README.md @@ -0,0 +1,11 @@ +# Non-fungible-token module + +### Overview + +Non-fungible-token module provides basic functions to create and manager NFT(non fungible token) such as `create_class`, `transfer`, `mint`, `burn`, `destroy_class`. + +- `create_class` create NFT(non fungible token) class +- `transfer` transfer NFT(non fungible token) to another account. +- `mint` mint NFT(non fungible token) +- `burn` burn NFT(non fungible token) +- `destroy_class` destroy NFT(non fungible token) class diff --git a/pallets/orml-nft/src/lib.rs b/pallets/orml-nft/src/lib.rs new file mode 100644 index 00000000..ba6b831e --- /dev/null +++ b/pallets/orml-nft/src/lib.rs @@ -0,0 +1,292 @@ +//! # Non Fungible Token +//! The module provides implementations for non-fungible-token. +//! +//! - [`Config`](./trait.Config.html) +//! - [`Call`](./enum.Call.html) +//! - [`Module`](./struct.Module.html) +//! +//! ## Overview +//! +//! This module provides basic functions to create and manager +//! NFT(non fungible token) such as `create_class`, `transfer`, `mint`, `burn`. + +//! ### Module Functions +//! +//! - `create_class` - Create NFT(non fungible token) class +//! - `transfer` - Transfer NFT(non fungible token) to another account. +//! - `mint` - Mint NFT(non fungible token) +//! - `burn` - Burn NFT(non fungible token) +//! - `destroy_class` - Destroy NFT(non fungible token) class + +#![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::unused_unit)] + +use codec::{Decode, Encode}; +use frame_support::{ensure, pallet_prelude::*, Parameter}; +use sp_runtime::{ + traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, One, Zero}, + DispatchError, DispatchResult, RuntimeDebug, +}; +use sp_std::vec::Vec; + +mod mock; +mod tests; + +/// Class info +#[derive(Encode, Decode, Clone, Eq, PartialEq, RuntimeDebug)] +pub struct ClassInfo { + /// Class metadata + pub metadata: Vec, + /// Total issuance for the class + pub total_issuance: TokenId, + /// Class owner + pub owner: AccountId, + /// Class Properties + pub data: Data, +} + +/// Token info +#[derive(Encode, Decode, Clone, Eq, PartialEq, RuntimeDebug)] +pub struct TokenInfo { + /// Token metadata + pub metadata: Vec, + /// Token owner + pub owner: AccountId, + /// Token Properties + pub data: Data, +} + +pub use module::*; + +#[frame_support::pallet] +pub mod module { + use super::*; + + #[pallet::config] + pub trait Config: frame_system::Config { + /// The class ID type + type ClassId: Parameter + Member + AtLeast32BitUnsigned + Default + Copy; + /// The token ID type + type TokenId: Parameter + Member + AtLeast32BitUnsigned + Default + Copy; + /// The class properties type + type ClassData: Parameter + Member + MaybeSerializeDeserialize; + /// The token properties type + type TokenData: Parameter + Member + MaybeSerializeDeserialize; + } + + pub type ClassInfoOf = + ClassInfo<::TokenId, ::AccountId, ::ClassData>; + pub type TokenInfoOf = TokenInfo<::AccountId, ::TokenData>; + + pub type GenesisTokenData = ( + ::AccountId, // Token owner + Vec, // Token metadata + ::TokenData, + ); + pub type GenesisTokens = ( + ::AccountId, // Token class owner + Vec, // Token class metadata + ::ClassData, + Vec>, // Vector of tokens belonging to this class + ); + + /// Error for non-fungible-token module. + #[pallet::error] + pub enum Error { + /// No available class ID + NoAvailableClassId, + /// No available token ID + NoAvailableTokenId, + /// Token(ClassId, TokenId) not found + TokenNotFound, + /// Class not found + ClassNotFound, + /// The operator is not the owner of the token and has no permission + NoPermission, + /// Arithmetic calculation overflow + NumOverflow, + /// Can not destroy class + /// Total issuance is not 0 + CannotDestroyClass, + } + + /// Next available class ID. + #[pallet::storage] + #[pallet::getter(fn next_class_id)] + pub type NextClassId = StorageValue<_, T::ClassId, ValueQuery>; + + /// Next available token ID. + #[pallet::storage] + #[pallet::getter(fn next_token_id)] + pub type NextTokenId = StorageMap<_, Twox64Concat, T::ClassId, T::TokenId, ValueQuery>; + + /// Store class info. + /// + /// Returns `None` if class info not set or removed. + #[pallet::storage] + #[pallet::getter(fn classes)] + pub type Classes = StorageMap<_, Twox64Concat, T::ClassId, ClassInfoOf>; + + /// Store token info. + /// + /// Returns `None` if token info not set or removed. + #[pallet::storage] + #[pallet::getter(fn tokens)] + pub type Tokens = + StorageDoubleMap<_, Twox64Concat, T::ClassId, Twox64Concat, T::TokenId, TokenInfoOf>; + + /// Token existence check by owner and class ID. + #[pallet::storage] + #[pallet::getter(fn tokens_by_owner)] + pub type TokensByOwner = + StorageDoubleMap<_, Twox64Concat, T::AccountId, Twox64Concat, (T::ClassId, T::TokenId), (), ValueQuery>; + + #[pallet::genesis_config] + pub struct GenesisConfig { + pub tokens: Vec>, + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + GenesisConfig { tokens: vec![] } + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + self.tokens.iter().for_each(|token_class| { + let class_id = Pallet::::create_class(&token_class.0, token_class.1.to_vec(), token_class.2.clone()) + .expect("Create class cannot fail while building genesis"); + for (account_id, token_metadata, token_data) in &token_class.3 { + Pallet::::mint(&account_id, class_id, token_metadata.to_vec(), token_data.clone()) + .expect("Token mint cannot fail during genesis"); + } + }) + } + } + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::hooks] + impl Hooks for Pallet {} + + #[pallet::call] + impl Pallet {} +} + +impl Pallet { + /// Create NFT(non fungible token) class + pub fn create_class( + owner: &T::AccountId, + metadata: Vec, + data: T::ClassData, + ) -> Result { + let class_id = NextClassId::::try_mutate(|id| -> Result { + let current_id = *id; + *id = id.checked_add(&One::one()).ok_or(Error::::NoAvailableClassId)?; + Ok(current_id) + })?; + + let info = ClassInfo { + metadata, + total_issuance: Default::default(), + owner: owner.clone(), + data, + }; + Classes::::insert(class_id, info); + + Ok(class_id) + } + + /// Transfer NFT(non fungible token) from `from` account to `to` account + pub fn transfer(from: &T::AccountId, to: &T::AccountId, token: (T::ClassId, T::TokenId)) -> DispatchResult { + Tokens::::try_mutate(token.0, token.1, |token_info| -> DispatchResult { + let mut info = token_info.as_mut().ok_or(Error::::TokenNotFound)?; + ensure!(info.owner == *from, Error::::NoPermission); + if from == to { + // no change needed + return Ok(()); + } + + info.owner = to.clone(); + + TokensByOwner::::remove(from, token); + TokensByOwner::::insert(to, token, ()); + + Ok(()) + }) + } + + /// Mint NFT(non fungible token) to `owner` + pub fn mint( + owner: &T::AccountId, + class_id: T::ClassId, + metadata: Vec, + data: T::TokenData, + ) -> Result { + NextTokenId::::try_mutate(class_id, |id| -> Result { + let token_id = *id; + *id = id.checked_add(&One::one()).ok_or(Error::::NoAvailableTokenId)?; + + Classes::::try_mutate(class_id, |class_info| -> DispatchResult { + let info = class_info.as_mut().ok_or(Error::::ClassNotFound)?; + info.total_issuance = info + .total_issuance + .checked_add(&One::one()) + .ok_or(Error::::NumOverflow)?; + Ok(()) + })?; + + let token_info = TokenInfo { + metadata, + owner: owner.clone(), + data, + }; + Tokens::::insert(class_id, token_id, token_info); + TokensByOwner::::insert(owner, (class_id, token_id), ()); + + Ok(token_id) + }) + } + + /// Burn NFT(non fungible token) from `owner` + pub fn burn(owner: &T::AccountId, token: (T::ClassId, T::TokenId)) -> DispatchResult { + Tokens::::try_mutate_exists(token.0, token.1, |token_info| -> DispatchResult { + let t = token_info.take().ok_or(Error::::TokenNotFound)?; + ensure!(t.owner == *owner, Error::::NoPermission); + + Classes::::try_mutate(token.0, |class_info| -> DispatchResult { + let info = class_info.as_mut().ok_or(Error::::ClassNotFound)?; + info.total_issuance = info + .total_issuance + .checked_sub(&One::one()) + .ok_or(Error::::NumOverflow)?; + Ok(()) + })?; + + TokensByOwner::::remove(owner, token); + + Ok(()) + }) + } + + /// Destroy NFT(non fungible token) class + pub fn destroy_class(owner: &T::AccountId, class_id: T::ClassId) -> DispatchResult { + Classes::::try_mutate_exists(class_id, |class_info| -> DispatchResult { + let info = class_info.take().ok_or(Error::::ClassNotFound)?; + ensure!(info.owner == *owner, Error::::NoPermission); + ensure!(info.total_issuance == Zero::zero(), Error::::CannotDestroyClass); + + NextTokenId::::remove(class_id); + + Ok(()) + }) + } + + pub fn is_owner(account: &T::AccountId, token: (T::ClassId, T::TokenId)) -> bool { + TokensByOwner::::contains_key(account, token) + } +} diff --git a/pallets/orml-nft/src/mock.rs b/pallets/orml-nft/src/mock.rs new file mode 100644 index 00000000..915f6756 --- /dev/null +++ b/pallets/orml-nft/src/mock.rs @@ -0,0 +1,92 @@ +//! Mocks for the gradually-update module. + +#![cfg(test)] + +use frame_support::{construct_runtime, parameter_types}; +use sp_core::H256; +use sp_runtime::{testing::Header, traits::IdentityLookup}; + +use super::*; + +use crate as nft; + +parameter_types! { + pub const BlockHashCount: u64 = 250; +} + +pub type AccountId = u128; +pub type BlockNumber = u64; + +impl frame_system::Config for Runtime { + type Origin = Origin; + type Index = u64; + type BlockNumber = BlockNumber; + type Call = Call; + type Hash = H256; + type Hashing = ::sp_runtime::traits::BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type Header = Header; + type Event = Event; + type BlockHashCount = BlockHashCount; + type BlockWeights = (); + type BlockLength = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type DbWeight = (); + type BaseCallFilter = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); +} + +impl Config for Runtime { + type ClassId = u64; + type TokenId = u64; + type ClassData = (); + type TokenData = (); +} + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Storage, Config, Event}, + NonFungibleTokenModule: nft::{Pallet, Storage, Config}, + } +); + +pub const ALICE: AccountId = 1; +pub const BOB: AccountId = 2; +pub const CLASS_ID: ::ClassId = 0; +pub const CLASS_ID_NOT_EXIST: ::ClassId = 100; +pub const TOKEN_ID: ::TokenId = 0; +pub const TOKEN_ID_NOT_EXIST: ::TokenId = 100; + +pub struct ExtBuilder; + +impl Default for ExtBuilder { + fn default() -> Self { + ExtBuilder + } +} + +impl ExtBuilder { + pub fn build(self) -> sp_io::TestExternalities { + let t = frame_system::GenesisConfig::default() + .build_storage::() + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} diff --git a/pallets/orml-nft/src/tests.rs b/pallets/orml-nft/src/tests.rs new file mode 100644 index 00000000..bc2bf5b4 --- /dev/null +++ b/pallets/orml-nft/src/tests.rs @@ -0,0 +1,180 @@ +//! Unit tests for the non-fungible-token module. + +#![cfg(test)] + +use super::*; +use frame_support::{assert_noop, assert_ok}; +use mock::*; + +#[test] +fn create_class_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + }); +} + +#[test] +fn create_class_should_fail() { + ExtBuilder::default().build().execute_with(|| { + NextClassId::::mutate(|id| *id = ::ClassId::max_value()); + assert_noop!( + NonFungibleTokenModule::create_class(&ALICE, vec![1], ()), + Error::::NoAvailableClassId + ); + }); +} + +#[test] +fn mint_should_work() { + ExtBuilder::default().build().execute_with(|| { + let next_class_id = NonFungibleTokenModule::next_class_id(); + assert_eq!(next_class_id, CLASS_ID); + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + assert_eq!(NonFungibleTokenModule::next_token_id(CLASS_ID), 0); + assert_ok!(NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ())); + assert_eq!(NonFungibleTokenModule::next_token_id(CLASS_ID), 1); + assert_ok!(NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ())); + assert_eq!(NonFungibleTokenModule::next_token_id(CLASS_ID), 2); + + let next_class_id = NonFungibleTokenModule::next_class_id(); + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + assert_eq!(NonFungibleTokenModule::next_token_id(next_class_id), 0); + assert_ok!(NonFungibleTokenModule::mint(&BOB, next_class_id, vec![1], ())); + assert_eq!(NonFungibleTokenModule::next_token_id(next_class_id), 1); + + assert_eq!(NonFungibleTokenModule::next_token_id(CLASS_ID), 2); + }); +} + +#[test] +fn mint_should_fail() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + Classes::::mutate(CLASS_ID, |class_info| { + class_info.as_mut().unwrap().total_issuance = ::TokenId::max_value(); + }); + assert_noop!( + NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ()), + Error::::NumOverflow + ); + + NextTokenId::::mutate(CLASS_ID, |id| *id = ::TokenId::max_value()); + assert_noop!( + NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ()), + Error::::NoAvailableTokenId + ); + }); +} + +#[test] +fn transfer_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + assert_ok!(NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ())); + assert_ok!(NonFungibleTokenModule::transfer(&BOB, &BOB, (CLASS_ID, TOKEN_ID))); + assert_ok!(NonFungibleTokenModule::transfer(&BOB, &ALICE, (CLASS_ID, TOKEN_ID))); + assert_ok!(NonFungibleTokenModule::transfer(&ALICE, &BOB, (CLASS_ID, TOKEN_ID))); + assert!(NonFungibleTokenModule::is_owner(&BOB, (CLASS_ID, TOKEN_ID))); + }); +} + +#[test] +fn transfer_should_fail() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + assert_ok!(NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ())); + assert_noop!( + NonFungibleTokenModule::transfer(&BOB, &ALICE, (CLASS_ID, TOKEN_ID_NOT_EXIST)), + Error::::TokenNotFound + ); + assert_noop!( + NonFungibleTokenModule::transfer(&ALICE, &BOB, (CLASS_ID, TOKEN_ID)), + Error::::NoPermission + ); + assert_noop!( + NonFungibleTokenModule::mint(&BOB, CLASS_ID_NOT_EXIST, vec![1], ()), + Error::::ClassNotFound + ); + assert_noop!( + NonFungibleTokenModule::transfer(&ALICE, &ALICE, (CLASS_ID, TOKEN_ID)), + Error::::NoPermission + ); + }); +} + +#[test] +fn burn_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + assert_ok!(NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ())); + assert_ok!(NonFungibleTokenModule::burn(&BOB, (CLASS_ID, TOKEN_ID))); + }); +} + +#[test] +fn burn_should_fail() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + assert_ok!(NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ())); + assert_noop!( + NonFungibleTokenModule::burn(&BOB, (CLASS_ID, TOKEN_ID_NOT_EXIST)), + Error::::TokenNotFound + ); + + assert_noop!( + NonFungibleTokenModule::burn(&ALICE, (CLASS_ID, TOKEN_ID)), + Error::::NoPermission + ); + }); + + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + assert_ok!(NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ())); + + Classes::::mutate(CLASS_ID, |class_info| { + class_info.as_mut().unwrap().total_issuance = 0; + }); + assert_noop!( + NonFungibleTokenModule::burn(&BOB, (CLASS_ID, TOKEN_ID)), + Error::::NumOverflow + ); + }); +} + +#[test] +fn destroy_class_should_work() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + assert_ok!(NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ())); + assert_ok!(NonFungibleTokenModule::burn(&BOB, (CLASS_ID, TOKEN_ID))); + assert_ok!(NonFungibleTokenModule::destroy_class(&ALICE, CLASS_ID)); + assert_eq!(Classes::::contains_key(CLASS_ID), false); + assert_eq!(NextTokenId::::contains_key(CLASS_ID), false); + }); +} + +#[test] +fn destroy_class_should_fail() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(NonFungibleTokenModule::create_class(&ALICE, vec![1], ())); + assert_ok!(NonFungibleTokenModule::mint(&BOB, CLASS_ID, vec![1], ())); + assert_noop!( + NonFungibleTokenModule::destroy_class(&ALICE, CLASS_ID_NOT_EXIST), + Error::::ClassNotFound + ); + + assert_noop!( + NonFungibleTokenModule::destroy_class(&BOB, CLASS_ID), + Error::::NoPermission + ); + + assert_noop!( + NonFungibleTokenModule::destroy_class(&ALICE, CLASS_ID), + Error::::CannotDestroyClass + ); + + assert_ok!(NonFungibleTokenModule::burn(&BOB, (CLASS_ID, TOKEN_ID))); + assert_ok!(NonFungibleTokenModule::destroy_class(&ALICE, CLASS_ID)); + assert_eq!(Classes::::contains_key(CLASS_ID), false); + }); +} diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 00000000..3a7d8de1 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1,5 @@ +[toolchain] +channel = "nightly-2021-03-24" +components = ["rustfmt", "clippy"] +targets = ["wasm32-unknown-unknown"] + diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 00000000..135fbb5d --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,9 @@ +condense_wildcard_suffixes = true +format_code_in_doc_comments = true +max_width = 120 +hard_tabs = true +imports_granularity="Crate" +overflow_delimited_expr = true +reorder_impl_items = true +use_field_init_shorthand = true +wrap_comments = true \ No newline at end of file diff --git a/scripts/init-ci.sh b/scripts/init-ci.sh new file mode 100755 index 00000000..54ef3853 --- /dev/null +++ b/scripts/init-ci.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +if [[ "$OSTYPE" == "linux-gnu" ]]; then + echo "Found linux" + # check for root + SUDO_PREFIX='' + if [[ $EUID -ne 0 ]]; then + echo "Running apt as sudo" + SUDO_PREFIX='sudo' + fi + $SUDO_PREFIX apt update + $SUDO_PREFIX apt install -y curl build-essential cmake pkg-config libssl-dev openssl git clang libclang-dev +elif [[ "$OSTYPE" == "darwin"* ]]; then + echo "Found macbook" + brew install cmake pkg-config openssl git llvm +fi + +if [[ $(cargo --version) ]]; then + echo "Found cargo" +else + curl https://sh.rustup.rs -sSf | sh -s -- -y + source $HOME/.cargo/env + export PATH=$HOME/.cargo/bin:$PATH +fi + +rustup toolchain add $WASM_BUILD_TOOLCHAIN +rustup default $WASM_BUILD_TOOLCHAIN +rustup target add wasm32-unknown-unknown --toolchain $WASM_BUILD_TOOLCHAIN diff --git a/scripts/init.sh b/scripts/init.sh index c477f40a..d51d2045 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -18,11 +18,11 @@ fi if [[ $(cargo --version) ]]; then echo "Found cargo" else - curl https://sh.rustup.rs -sSf | sh -s -- -y + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2021-03-15 source $HOME/.cargo/env export PATH=$HOME/.cargo/bin:$PATH fi rustup update stable rustup update nightly -rustup target add wasm32-unknown-unknown --toolchain nightly +rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-15 diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100755 index 00000000..6fe5e98b --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,2 @@ +./target/release/edgeware purge-chain --dev -y +./target/release/edgeware --dev diff --git a/ts-tests/frontier-tester/README.md b/ts-tests/frontier-tester/README.md deleted file mode 100644 index b0e148ad..00000000 --- a/ts-tests/frontier-tester/README.md +++ /dev/null @@ -1,33 +0,0 @@ -## Edgeware Frontier Tester - -Unit tests for Edgeware Frontier. You must have the node built to run these tests. The location of the binary is defined in the environment variable `BINARY_PATH`, whose default is set in [utils.js](contracts/utils.js) as `../../target/release/edgeware`. - -To run a single test, use: - -``` -yarn test tests/ -``` - -To run all included frontier tests, use the following: - -``` -yarn test-ci -``` - -The following functionality is tested: -- Adding Liquidity to a fresh Uniswap deployment -- Generating an ERC20 Token Allowance -- Create Factory Contract -- Create2 Factory Contract -- Calling a precompile (ECRecover) -- Event emission and subscription -- Fallback function -- Hashing (on chain and with web3 provider): keccak256, sha3, ripemd -- Identity, modexp, and ed25519 precompiles. -- Contract Interfaces -- Edgeware Lockdrop -- Modifiers -- Transferring balance into EVM pallet -- Timestamps -- Contract creation with non-zero contract balance -- Basic substrate-native functionality including democracy proposals, treasury proposals, and identity registration. \ No newline at end of file diff --git a/ts-tests/frontier-tester/contracts/ContractImpl.sol b/ts-tests/frontier-tester/contracts/ContractImpl.sol deleted file mode 100644 index d4875a60..00000000 --- a/ts-tests/frontier-tester/contracts/ContractImpl.sol +++ /dev/null @@ -1,9 +0,0 @@ -pragma solidity ^0.5.0; - -import './IContract.sol'; - -contract ContractImpl is IContract { - function doSomething() external view returns (bool) { - return true; - } -} diff --git a/ts-tests/frontier-tester/contracts/Create2Factory.sol b/ts-tests/frontier-tester/contracts/Create2Factory.sol deleted file mode 100644 index 709a26e3..00000000 --- a/ts-tests/frontier-tester/contracts/Create2Factory.sol +++ /dev/null @@ -1,25 +0,0 @@ -pragma solidity ^0.5.0; - -import './ValueContract.sol'; - -contract Create2Factory { - address addr; - - constructor() public { } - - function deploy(uint256 salt) public { - address addrLocal; - bytes memory bytecode = type(ValueContract).creationCode; - assembly { - addrLocal := create2(0, add(bytecode, 0x20), mload(bytecode), salt) - if iszero(extcodesize(addrLocal)) { - revert(0, 0) - } - } - addr = addrLocal; - } - - function viewAddr() public view returns (address) { - return addr; - } -} diff --git a/ts-tests/frontier-tester/contracts/CreateContract.sol b/ts-tests/frontier-tester/contracts/CreateContract.sol deleted file mode 100644 index d010dbe6..00000000 --- a/ts-tests/frontier-tester/contracts/CreateContract.sol +++ /dev/null @@ -1,30 +0,0 @@ -pragma solidity ^0.5.0; - -contract SubContract { - constructor() public payable { } - function getAddress() external view returns (address ownAddress) { - return address(this); - } - - function getValue() external view returns (uint) { - return address(this).balance; - } -} - -contract CreateContract { - address public deployed; - - constructor() public { } - - function spawn() external returns (SubContract subAddress) { - SubContract result = new SubContract(); - deployed = address(result); - return result; - } - - function spawnWithValue() external payable returns (SubContract subAddress) { - SubContract result = (new SubContract).value(msg.value)(); - deployed = address(result); - return result; - } -} diff --git a/ts-tests/frontier-tester/contracts/ECRecovery.sol b/ts-tests/frontier-tester/contracts/ECRecovery.sol deleted file mode 100644 index c7ce0dd2..00000000 --- a/ts-tests/frontier-tester/contracts/ECRecovery.sol +++ /dev/null @@ -1,39 +0,0 @@ -pragma solidity ^0.5.0; - -contract ECRecovery { - - /** - * @dev Recover signer address from a message by using his signature - * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. - * @param sig bytes signature, the signature is generated using web3.eth.sign() - */ - function recover(bytes32 hash, bytes memory sig) public pure returns (address) { - bytes32 r; - bytes32 s; - uint8 v; - - //Check the signature length - if (sig.length != 65) { - return (address(0)); - } - - // Divide the signature in r, s and v variables - assembly { - r := mload(add(sig, 32)) - s := mload(add(sig, 64)) - v := byte(0, mload(add(sig, 96))) - } - - // Version of signature should be 27 or 28, but 0 and 1 are also possible versions - if (v < 27) { - v += 27; - } - - // If the version is correct return the signer address - if (v != 27 && v != 28) { - return (address(0)); - } else { - return ecrecover(hash, v, r, s); - } - } -} \ No newline at end of file diff --git a/ts-tests/frontier-tester/contracts/EventContract.sol b/ts-tests/frontier-tester/contracts/EventContract.sol deleted file mode 100644 index 4debd8c7..00000000 --- a/ts-tests/frontier-tester/contracts/EventContract.sol +++ /dev/null @@ -1,9 +0,0 @@ -pragma solidity ^0.5.0; - -contract EventContract { - event e(address c); - - function emitEvent() public { - emit e(address(this)); - } -} diff --git a/ts-tests/frontier-tester/contracts/FallbackContract.sol b/ts-tests/frontier-tester/contracts/FallbackContract.sol deleted file mode 100644 index a95aa5da..00000000 --- a/ts-tests/frontier-tester/contracts/FallbackContract.sol +++ /dev/null @@ -1,9 +0,0 @@ -pragma solidity ^0.5.0; - -contract FallbackContract { - constructor() public { } - - function () external payable { - msg.sender.transfer(msg.value); - } -} \ No newline at end of file diff --git a/ts-tests/frontier-tester/contracts/Hashing.sol b/ts-tests/frontier-tester/contracts/Hashing.sol deleted file mode 100644 index e28475a5..00000000 --- a/ts-tests/frontier-tester/contracts/Hashing.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma solidity ^0.5.0; - -contract Hashing { - function callKeccak256(bytes memory input) public pure returns(bytes32 result) { - return keccak256(input); - } - - function callRipemd160(bytes memory input) public pure returns(bytes20 result) { - return ripemd160(input); - } - - function callSha256(bytes memory input) public pure returns(bytes32 result) { - return sha256(input); - } -} diff --git a/ts-tests/frontier-tester/contracts/IContract.sol b/ts-tests/frontier-tester/contracts/IContract.sol deleted file mode 100644 index 97da4318..00000000 --- a/ts-tests/frontier-tester/contracts/IContract.sol +++ /dev/null @@ -1,5 +0,0 @@ -pragma solidity ^0.5.0; - -interface IContract { - function doSomething() external view returns (bool); -} diff --git a/ts-tests/frontier-tester/contracts/IContractUser.sol b/ts-tests/frontier-tester/contracts/IContractUser.sol deleted file mode 100644 index 299448f0..00000000 --- a/ts-tests/frontier-tester/contracts/IContractUser.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity ^0.5.0; - -import './IContract.sol'; - -contract IContractUser { - IContract created; - - constructor() public { } - - function linkContract(address a) public returns (bool) { - created = IContract(a); - } - - function doTheThing() public view returns (bool) { - return created.doSomething(); - } -} diff --git a/ts-tests/frontier-tester/contracts/Lockdrop.sol b/ts-tests/frontier-tester/contracts/Lockdrop.sol deleted file mode 100644 index 95907403..00000000 --- a/ts-tests/frontier-tester/contracts/Lockdrop.sol +++ /dev/null @@ -1,137 +0,0 @@ -pragma solidity ^0.5.0; - -contract Lock { - // address owner; slot #0 - // address unlockTime; slot #1 - constructor (address owner, uint256 unlockTime) public payable { - assembly { - sstore(0x00, owner) - sstore(0x01, unlockTime) - } - } - - /** - * @dev Withdraw function once timestamp has passed unlock time - */ - function () external payable { // payable so solidity doesn't add unnecessary logic - assembly { - switch gt(timestamp, sload(0x01)) - case 0 { revert(0, 0) } - case 1 { - switch call(gas, sload(0x00), balance(address), 0, 0, 0, 0) - case 0 { revert(0, 0) } - } - } - } -} - -contract Lockdrop { - enum Term { - ThreeMo, - SixMo, - TwelveMo - } - // Time constants - uint256 constant public LOCK_DROP_PERIOD = 1 days * 92; // 3 months - uint256 public LOCK_START_TIME; - uint256 public LOCK_END_TIME; - // ETH locking events - event Locked(address indexed owner, uint256 eth, Lock lockAddr, Term term, bytes edgewareAddr, bool isValidator, uint time); - event Signaled(address indexed contractAddr, bytes edgewareAddr, uint time); - - constructor(uint startTime) public { - LOCK_START_TIME = startTime; - LOCK_END_TIME = startTime + LOCK_DROP_PERIOD; - } - - /** - * @dev Locks up the value sent to contract in a new Lock - * @param term The length of the lock up - * @param edgewareAddr The bytes representation of the target edgeware key - * @param isValidator Indicates if sender wishes to be a validator - */ - function lock(Term term, bytes calldata edgewareAddr, bool isValidator) - external - payable - // didStart - // didNotEnd - { - uint256 eth = msg.value; - address owner = msg.sender; - uint256 unlockTime = unlockTimeForTerm(term); - // Create ETH lock contract - Lock lockAddr = (new Lock).value(eth)(owner, unlockTime); - // ensure lock contract has at least all the ETH, or fail - assert(address(lockAddr).balance >= msg.value); - emit Locked(owner, eth, lockAddr, term, edgewareAddr, isValidator, now); - } - - /** - * @dev Signals a contract's (or address's) balance decided after lock period - * @param contractAddr The contract address from which to signal the balance of - * @param nonce The transaction nonce of the creator of the contract - * @param edgewareAddr The bytes representation of the target edgeware key - */ - function signal(address contractAddr, uint32 nonce, bytes calldata edgewareAddr) - external - didStart - didNotEnd - didCreate(contractAddr, msg.sender, nonce) - { - emit Signaled(contractAddr, edgewareAddr, now); - } - - function unlockTimeForTerm(Term term) internal view returns (uint256) { - if (term == Term.ThreeMo) return now + 92 days; - if (term == Term.SixMo) return now + 183 days; - if (term == Term.TwelveMo) return now + 365 days; - - revert(); - } - - /** - * @dev Ensures the lockdrop has started - */ - modifier didStart() { - require(now >= LOCK_START_TIME); - _; - } - - /** - * @dev Ensures the lockdrop has not ended - */ - modifier didNotEnd() { - require(now <= LOCK_END_TIME); - _; - } - - /** - * @dev Rebuilds the contract address from a normal address and transaction nonce - * @param _origin The non-contract address derived from a user's public key - * @param _nonce The transaction nonce from which to generate a contract address - */ - function addressFrom(address _origin, uint32 _nonce) public pure returns (address) { - if(_nonce == 0x00) return address(uint160(uint256(keccak256(abi.encodePacked(byte(0xd6), byte(0x94), _origin, byte(0x80)))))); - if(_nonce <= 0x7f) return address(uint160(uint256(keccak256(abi.encodePacked(byte(0xd6), byte(0x94), _origin, uint8(_nonce)))))); - if(_nonce <= 0xff) return address(uint160(uint256(keccak256(abi.encodePacked(byte(0xd7), byte(0x94), _origin, byte(0x81), uint8(_nonce)))))); - if(_nonce <= 0xffff) return address(uint160(uint256(keccak256(abi.encodePacked(byte(0xd8), byte(0x94), _origin, byte(0x82), uint16(_nonce)))))); - if(_nonce <= 0xffffff) return address(uint160(uint256(keccak256(abi.encodePacked(byte(0xd9), byte(0x94), _origin, byte(0x83), uint24(_nonce)))))); - return address(uint160(uint256(keccak256(abi.encodePacked(byte(0xda), byte(0x94), _origin, byte(0x84), uint32(_nonce)))))); // more than 2^32 nonces not realistic - } - - /** - * @dev Ensures the target address was created by a parent at some nonce - * @param target The target contract address (or trivially the parent) - * @param parent The creator of the alleged contract address - * @param nonce The creator's tx nonce at the time of the contract creation - */ - modifier didCreate(address target, address parent, uint32 nonce) { - // Trivially let senders "create" themselves - if (target == parent) { - _; - } else { - require(target == addressFrom(parent, nonce)); - _; - } - } -} \ No newline at end of file diff --git a/ts-tests/frontier-tester/contracts/Migrations.sol b/ts-tests/frontier-tester/contracts/Migrations.sol deleted file mode 100644 index be990a09..00000000 --- a/ts-tests/frontier-tester/contracts/Migrations.sol +++ /dev/null @@ -1,26 +0,0 @@ -pragma solidity ^0.5.0; - -contract Migrations { - address public owner; - - // A function with the signature `last_completed_migration()`, returning a uint, is required. - uint public last_completed_migration; - - modifier restricted() { - if (msg.sender == owner) _; - } - - constructor () public { - owner = msg.sender; - } - - // A function with the signature `setCompleted(uint)` is required. - function setCompleted(uint completed) public { - last_completed_migration = completed; - } - - function upgrade(address new_address) public { - Migrations upgraded = Migrations(new_address); - upgraded.setCompleted(last_completed_migration); - } -} diff --git a/ts-tests/frontier-tester/contracts/Multicall.sol b/ts-tests/frontier-tester/contracts/Multicall.sol deleted file mode 100644 index 7e6cd973..00000000 --- a/ts-tests/frontier-tester/contracts/Multicall.sol +++ /dev/null @@ -1,45 +0,0 @@ -pragma solidity >=0.5.0; -pragma experimental ABIEncoderV2; - -/// @title Multicall - Aggregate results from multiple read-only function calls -/// @author Michael Elliot -/// @author Joshua Levine -/// @author Nick Johnson - -contract Multicall { - struct Call { - address target; - bytes callData; - } - function aggregate(Call[] memory calls) public returns (uint256 blockNumber, bytes[] memory returnData) { - blockNumber = block.number; - returnData = new bytes[](calls.length); - for(uint256 i = 0; i < calls.length; i++) { - (bool success, bytes memory ret) = calls[i].target.call(calls[i].callData); - require(success); - returnData[i] = ret; - } - } - // Helper functions - function getEthBalance(address addr) public view returns (uint256 balance) { - balance = addr.balance; - } - function getBlockHash(uint256 blockNumber) public view returns (bytes32 blockHash) { - blockHash = blockhash(blockNumber); - } - function getLastBlockHash() public view returns (bytes32 blockHash) { - blockHash = blockhash(block.number - 1); - } - function getCurrentBlockTimestamp() public view returns (uint256 timestamp) { - timestamp = block.timestamp; - } - function getCurrentBlockDifficulty() public view returns (uint256 difficulty) { - difficulty = block.difficulty; - } - function getCurrentBlockGasLimit() public view returns (uint256 gaslimit) { - gaslimit = block.gaslimit; - } - function getCurrentBlockCoinbase() public view returns (address coinbase) { - coinbase = block.coinbase; - } -} diff --git a/ts-tests/frontier-tester/contracts/OwnerContract.sol b/ts-tests/frontier-tester/contracts/OwnerContract.sol deleted file mode 100644 index 3354ec6b..00000000 --- a/ts-tests/frontier-tester/contracts/OwnerContract.sol +++ /dev/null @@ -1,17 +0,0 @@ -pragma solidity ^0.5.0; - -contract OwnerContract { - address owner; - constructor() public { - owner = msg.sender; - } - - function makeCall() public view isOwner returns(bool) { - return true; - } - - modifier isOwner() { - require(msg.sender == owner, "only owner"); - _; - } -} diff --git a/ts-tests/frontier-tester/contracts/StoreNum.sol b/ts-tests/frontier-tester/contracts/StoreNum.sol deleted file mode 100644 index cfff179e..00000000 --- a/ts-tests/frontier-tester/contracts/StoreNum.sol +++ /dev/null @@ -1,13 +0,0 @@ -pragma solidity ^0.5.0; - -contract StoreNum { - uint8[] store; - - function addToStore(uint8 number) public { - store.push(number); - } - - function getStore() public view returns(uint8[] memory) { - return store; - } -} diff --git a/ts-tests/frontier-tester/contracts/TimeContract.sol b/ts-tests/frontier-tester/contracts/TimeContract.sol deleted file mode 100644 index ce41b412..00000000 --- a/ts-tests/frontier-tester/contracts/TimeContract.sol +++ /dev/null @@ -1,32 +0,0 @@ -pragma solidity ^0.5.0; - -contract TimeContract { - uint timeCreated; - uint lastChecked; - - constructor() public { - timeCreated = now; - } - - modifier didNotEnd() { - require(now <= (timeCreated + 1 days)); - _; - } - - function timeBeforeEnd() public didNotEnd returns (uint) { - lastChecked = now; - return lastChecked; - } - - function viewTimeCreated() public view returns (uint) { - return timeCreated; - } - - function viewNow() public view returns (uint) { - return now; - } - - function viewBlockTimestamp() public view returns (uint) { - return block.timestamp; - } -} diff --git a/ts-tests/frontier-tester/contracts/TokenA.sol b/ts-tests/frontier-tester/contracts/TokenA.sol deleted file mode 100644 index cab7bf90..00000000 --- a/ts-tests/frontier-tester/contracts/TokenA.sol +++ /dev/null @@ -1,14 +0,0 @@ -pragma solidity ^0.5.0; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol"; - -// This ERC-20 contract mints the specified amount of tokens to the contract creator. -contract TokenA is ERC20, ERC20Detailed { - constructor(uint256 initialSupply) - public - ERC20Detailed("TokenA", "TOKA", 18) - { - _mint(msg.sender, initialSupply); - } -} diff --git a/ts-tests/frontier-tester/contracts/TokenB.sol b/ts-tests/frontier-tester/contracts/TokenB.sol deleted file mode 100644 index c9ee3fdd..00000000 --- a/ts-tests/frontier-tester/contracts/TokenB.sol +++ /dev/null @@ -1,14 +0,0 @@ -pragma solidity ^0.5.0; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol"; - -// This ERC-20 contract mints the specified amount of tokens to the contract creator. -contract TokenB is ERC20, ERC20Detailed { - constructor(uint256 initialSupply) - public - ERC20Detailed("TokenB", "TOKB", 18) - { - _mint(msg.sender, initialSupply); - } -} diff --git a/ts-tests/frontier-tester/contracts/ValueContract.sol b/ts-tests/frontier-tester/contracts/ValueContract.sol deleted file mode 100644 index 26e1327e..00000000 --- a/ts-tests/frontier-tester/contracts/ValueContract.sol +++ /dev/null @@ -1,16 +0,0 @@ -pragma solidity ^0.5.0; - -contract ValueContract { - uint valueStored; - constructor() public payable { - valueStored = msg.value; - } - - function sendValue() public payable { - valueStored = valueStored + msg.value; - } - - function getValue() public view returns (uint) { - return valueStored; - } -} diff --git a/ts-tests/frontier-tester/helpers/deployUniswap.js b/ts-tests/frontier-tester/helpers/deployUniswap.js deleted file mode 100644 index b6125747..00000000 --- a/ts-tests/frontier-tester/helpers/deployUniswap.js +++ /dev/null @@ -1,36 +0,0 @@ -const contract = require("@truffle/contract"); - -// libraries -const Multicall = require('../build/contracts/Multicall.json'); -const WETH9 = require('@uniswap/v2-periphery/build/WETH9.json'); -const UniswapV2Factory = require('@uniswap/v2-core/build/UniswapV2Factory.json'); -const UniswapV2Router02 = require('@uniswap/v2-periphery/build/UniswapV2Router02.json'); - -// Initialization -const { account } = require('./utils'); - -const deploy = async (web3) => { - const d = async (name, Contract, args = []) => { - let c = contract({ - abi: Contract.abi, - unlinked_binary: Contract.bytecode, - }); - c.setProvider(web3.currentProvider); - let res = await c.new(...args, { from: account }); - console.log(`${name} deployed at address ${res.address}`); - return res; - }; - const multicall = await d("Multicall", Multicall); - const factory = await d("UniswapV2Factory", UniswapV2Factory, [ account ]); - const weth9 = await d("WETH9", WETH9); - const router = await d( - "UniswapV2Router02", - UniswapV2Router02, - [ factory.address, weth9.address ], - ); - return [factory.address, router.address]; -}; - -module.exports = { - deploy, -} \ No newline at end of file diff --git a/ts-tests/frontier-tester/helpers/flipper.json b/ts-tests/frontier-tester/helpers/flipper.json deleted file mode 100644 index 048997d4..00000000 --- a/ts-tests/frontier-tester/helpers/flipper.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "metadataVersion": "0.1.0", - "source": { - "hash": "0x11ba777b3457bf64cb99421786c90d421afde1c56579aa3dae336e58ccc8f783", - "language": "ink! 3.0.0-rc2", - "compiler": "rustc 1.47.0-nightly" - }, - "contract": { - "name": "flipper", - "version": "3.0.0-rc2", - "authors": [ - "Parity Technologies " - ] - }, - "spec": { - "constructors": [ - { - "args": [ - { - "name": "init_value", - "type": { - "displayName": [ - "bool" - ], - "type": 1 - } - } - ], - "docs": [ - " Creates a new flipper smart contract initialized with the given value." - ], - "name": [ - "new" - ], - "selector": "0xd183512b" - }, - { - "args": [], - "docs": [ - " Creates a new flipper smart contract initialized to `false`." - ], - "name": [ - "default" - ], - "selector": "0x6a3712e2" - } - ], - "docs": [], - "events": [], - "messages": [ - { - "args": [], - "docs": [ - " Flips the current value of the Flipper's bool." - ], - "mutates": true, - "name": [ - "flip" - ], - "payable": false, - "returnType": null, - "selector": "0xc096a5f3" - }, - { - "args": [], - "docs": [ - " Returns the current value of the Flipper's bool." - ], - "mutates": false, - "name": [ - "get" - ], - "payable": false, - "returnType": { - "displayName": [ - "bool" - ], - "type": 1 - }, - "selector": "0x1e5ca456" - } - ] - }, - "storage": { - "struct": { - "fields": [ - { - "layout": { - "cell": { - "key": "0x0000000000000000000000000000000000000000000000000000000000000000", - "ty": 1 - } - }, - "name": "value" - } - ] - } - }, - "types": [ - { - "def": { - "primitive": "bool" - } - } - ] -} \ No newline at end of file diff --git a/ts-tests/frontier-tester/helpers/flipper.wasm b/ts-tests/frontier-tester/helpers/flipper.wasm deleted file mode 100644 index 47b4bd920b1a1a3735810301fc0f1819447fdbae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2316 zcmb7GO>ZMb5Ur|iJF^*k-3bedh(PVxAUOg{mRQA6PVPvFK@nOGdruBabz*o;n})lWtzXXEF>;>?m0At3-a z#)_>Ou4jN8E-!7quq5@zqo>DbfUIXph5rNzHn?pJ1>-KQ`p3tl77!Iz%GO1W;R zZ*;z*b9X&=I?t}=+c?(o>?vNza3L#Q9mC}%Z^#3@{CH_Mq&HvL)Hx=brK7gm@0FfA zvgsCNkp5ua>@^7kAKf)X!a3#e!0V>hH=F5h7XIP$f`Sa2OmRO9j)0#64f6vwUn(Hq z2Ci-H8}H#MLM-Hq0t+~()2uL9mq#z+VwM(NAy_okqDzY_)w#Y|@sxkYRylJ=g{aSt z*tS*I8-k%D)UII`<0da4q-|sn0O2D$@Cg1P1~}H!#@9B48iEiIBu)cVU-XtM*C^j+ zsT?J7GLY{;Mwjj=d0ood02|K+2^<7|d3P1QXcad2d^P{>T3`h$DzK_r2`nnGTDY1+ zU=?vbPXfbBC9uW=fdvXCjn!t1^#NW$LC*_bAS<~=FJMD|tOL(cqWouOQw3#W#${z; z6KPiOBd$bfl{!k2Y*9-Fz7`U9q2dmSMGZ|4>=|4_>`JZrG+k}kTB^k)T;G(x%)PO^~3s@i=Lc|XO+W#J894tP-pP`(Muy3|N@k!xLaX|atuL$MS#ygh_j8-C$o(}1<_<0#>$I8yj4 zjvP9rCOp8SPUdeb^EX{k->!5>#YuX*6S9WQVe)qx0t1QxrnC@$BM6Do#w z^*@67lTtJilc;=5dwvG6+y(A8l?n@{M;ryq|NX;GNiBxeRNp_wyXn%Ki~}T zZedH4K*>^yA`iD=H(ja4;&n~RLtPo{X*>LZQw1U!DK`6x*Q;hriD{=v1Eg>bA+#ks zx1cXo57Q4^!AV|UiV`1<3WCTh#!Q-GvcqgRqxd&46XNy=Sx zAukW@47sXb0x#~KzSsf;eyFs0InuAro~DR5vEfuF(S1-PNUS`yoA+NWPMFd9jCQq1 zoq>s1U<;8nF!Ubom>If<*#!owsSgw-e!8TUf1_W#ndk4Y5@z$am|gO}M@|3$ diff --git a/ts-tests/frontier-tester/helpers/generalizedLocks.js b/ts-tests/frontier-tester/helpers/generalizedLocks.js deleted file mode 100644 index 9cbeab34..00000000 --- a/ts-tests/frontier-tester/helpers/generalizedLocks.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports.lockedContractAddresses = lockedContractAddresses = [ - "0x94bD4150e41c717B7E7564484693073239715376", - "0xdB0E7d784D6A7ca2CBDA6CE26ac3b1Bd348C06F8", - "0x3BfC20f0B9aFcAcE800D73D2191166FF16540258", -]; diff --git a/ts-tests/frontier-tester/helpers/initDefaultAccountBalance.ts b/ts-tests/frontier-tester/helpers/initDefaultAccountBalance.ts deleted file mode 100644 index 8541e478..00000000 --- a/ts-tests/frontier-tester/helpers/initDefaultAccountBalance.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { ApiPromise, WsProvider } from '@polkadot/api'; -import { createTestPairs } from '@polkadot/keyring/testingPairs'; -import { assert } from 'chai'; -const { account, convertToSubstrateAddress, describeWithEdgeware } = require('./utils.js'); -import { spec } from '@edgeware/node-types'; -import Web3 from 'web3'; - -let sendSubstrateBalance = async (web3: Web3): Promise => { - // initialize polkadot API - const polkadotUrl = 'ws://localhost:9944'; - const api = await ApiPromise.create({ - provider: new WsProvider(polkadotUrl), - ...spec, - }); - - // configure funded substrate account, target account, and balance to send - const keyring = createTestPairs().dave; - const balance = await api.query.system.account(keyring.address); - if (balance.data.free.eqn(0)) { - throw new Error(`Fetched no balance for address ${keyring.address}`); - } - const value = balance.data.free.divn(2); // only send half of Bob's balance - const target = convertToSubstrateAddress(account); - - // send funds from Bob to the target account - console.log(`Transferring ${value.toString()} from Bob to default account.`); - const tx = api.tx.balances.transfer(target, value); - await new Promise((resolve) => { - tx.signAndSend(keyring, (result) => { - if (result.isError) { - assert.fail('tx failure'); - } - if (result.isCompleted) { - resolve(); - } - }); - }); - - // ensure the account has funds via web3 - const web3Balance = await web3.eth.getBalance(account); - await api.disconnect(); - console.log(`Transfer complete, web3 fetched balance: ${web3Balance}`); -} - -describeWithEdgeware('init default account balance', (context) => { - it('should initialize default account balance', async () => { - const web3 = context.web3; - await sendSubstrateBalance(web3); - }); -}); diff --git a/ts-tests/frontier-tester/helpers/lockdropHelper.js b/ts-tests/frontier-tester/helpers/lockdropHelper.js deleted file mode 100644 index 198860c5..00000000 --- a/ts-tests/frontier-tester/helpers/lockdropHelper.js +++ /dev/null @@ -1,423 +0,0 @@ -const Promise = require('bluebird'); -const keyring = require('@polkadot/keyring'); -const { toBN, fromWei, hexToNumber } = require('web3').utils; -const bs58 = require('bs58'); -const schedule = require('./schedule'); -const generalizedLocks = require('./generalizedLocks'); - -function getEffectiveValue(ethAmount, term, lockTime, lockStart, totalETH) { - // multiplicative bonus starts at 100 / 100 = 1 - let bonus = toBN(100); - // get multiplicative bonus if calculating allocation of locks - if (lockTime && lockStart) { - bonus = schedule.getEarlyParticipationBonus(lockTime, lockStart); - } - - if (term == '0') { - // three month term yields no bonus - return toBN(ethAmount).mul(toBN(100).mul(bonus)).div(toBN(10000)); - } else if (term == '1') { - // six month term yields 30% bonus - return toBN(ethAmount).mul(toBN(130).mul(bonus)).div(toBN(10000)); - } else if (term == '2') { - // twelve month term yields 120% bonus - return toBN(ethAmount).mul(toBN(220).mul(bonus)).div(toBN(10000)); - } else if (term == 'signaling') { - // 80% deduction - return toBN(ethAmount).mul(toBN(20)).div(toBN(100)); - } else { - // invalid term - return toBN(0); - } -} - -const getLocks = async (lockdropContract, address) => { - // let events = await lockdropContract.events.allEvents(); - // console.log(events); - // return events; - console.log(address); - - await lockdropContract.getPastEvents('Locked', - { - fromBlock: 0, - toBlock: 'latest', - filter: { - // edgewareAddr: 0xa469e40f0a073be5b28e2df6e746ce6519260cdd764bc5f6b3fb3aac5cda3c35, - // // // transacationHash: 0x2d0120f7efc7d594e738cf68013d2c8d8b6bee3d92d69a8f58f30fe5186daa56, - owner: address, - } - }).then((events) => { - console.log(events); - return events; - }); -}; - -const getSignals = async (lockdropContract, address) => { - return await lockdropContract.getPastEvents('Signaled', { - fromBlock: 0, - toBlock: 'latest', - filter: { - contractAddr: address, - } - }); -}; - -const getTotalLockedBalance = async (lockdropContract) => { - let { totalETHLocked, totalEffectiveETHLocked } = await calculateEffectiveLocks(lockdropContract); - return { totalETHLocked, totalEffectiveETHLocked }; -}; - -const getTotalSignaledBalance = async (web3, lockdropContract) => { - let { totalETHSignaled, totalEffectiveETHSignaled } = await calculateEffectiveSignals(web3, lockdropContract); - return { totalETHSignaled, totalEffectiveETHSignaled }; -}; - -const calculateEffectiveLocks = async (lockdropContract) => { - let totalETHLocked = toBN(0); - let totalEffectiveETHLocked = toBN(0); - const locks = {}; - const validatingLocks = {}; - - let lockEvents = [] - let events = await lockdropContract.getPastEvents('Locked', { - fromBlock: 0, - toBlock: 'latest', - }); - - lockEvents = [ ...lockEvents, ...events ]; - - // For truffle tests - let lockdropStartTime; - if (typeof lockdropContract.LOCK_START_TIME === 'function') { - lockdropStartTime = (await lockdropContract.LOCK_START_TIME()); - } else { - lockdropStartTime = (await lockdropContract.methods.LOCK_START_TIME().call()); - } - - lockEvents.forEach((event) => { - const data = event.returnValues; - let value = getEffectiveValue(data.eth, data.term, data.time, lockdropStartTime, totalETHLocked); - totalETHLocked = totalETHLocked.add(toBN(data.eth)); - totalEffectiveETHLocked = totalEffectiveETHLocked.add(value); - - // Add all validators to a separate collection to do validator election over later - if (data.isValidator) { - if (data.edgewareAddr in validatingLocks) { - validatingLocks[data.edgewareAddr] = { - lockAmt: toBN(data.eth).add(toBN(validatingLocks[data.edgewareAddr].lockAmt)).toString(), - effectiveValue: toBN(validatingLocks[data.edgewareAddr].effectiveValue).add(value).toString(), - lockAddrs: [data.lockAddr, ...validatingLocks[data.edgewareAddr].lockAddrs], - }; - } else { - validatingLocks[data.edgewareAddr] = { - lockAmt: toBN(data.eth).toString(), - effectiveValue: value.toString(), - lockAddrs: [data.lockAddr], - }; - } - } - - - // Add all locks to collection, calculating/updating effective value of lock - if (data.edgewareAddr in locks) { - locks[data.edgewareAddr] = { - lockAmt: toBN(data.eth).add(toBN(locks[data.edgewareAddr].lockAmt)).toString(), - effectiveValue: toBN(locks[data.edgewareAddr].effectiveValue).add(value).toString(), - lockAddrs: [data.lockAddr, ...locks[data.edgewareAddr].lockAddrs], - }; - } else { - locks[data.edgewareAddr] = { - lockAmt: toBN(data.eth).toString(), - effectiveValue: value.toString(), - lockAddrs: [data.lockAddr], - }; - } - }); - // Return validating locks, locks, and total ETH locked - return { validatingLocks, locks, totalETHLocked, totalEffectiveETHLocked }; -}; - -const calculateEffectiveSignals = async (web3, lockdropContracts, blockNumber=8461046) => { - let totalETHSignaled = toBN(0); - let totalEffectiveETHSignaled = toBN(0); - let signals = {}; - let seenContracts = {}; - let signalEvents = []; - for (index in lockdropContracts) { - let events = await lockdropContracts[index].getPastEvents('Signaled', { - fromBlock: 0, - toBlock: 'latest', - }); - - signalEvents = [ ...signalEvents, ...events ]; - } - - const promises = signalEvents.map(async (event) => { - const data = event.returnValues; - // Get balance at block that lockdrop ends - let balance = -1; - while (balance == -1) { - try { - if (blockNumber) { - balance = await web3.eth.getBalance(data.contractAddr, blockNumber); - } else { - balance = await web3.eth.getBalance(data.contractAddr); - } - } catch(e) { - console.log(`${balance} Couldn't find: ${JSON.stringify(data)}`); - await Promise.delay(5000); - } - } - - return balance; - }); - // Resolve promises to ensure all inner async functions have finished - let balances = await Promise.all(promises); - let gLocks = {}; - signalEvents.forEach((event, index) => { - const data = event.returnValues; - // if contract address has been seen (it is in a previously processed signal) - // then we ignore it; this means that we only acknolwedge the first signal - // for a given address. - if (!(data.contractAddr in seenContracts)) { - seenContracts[data.contractAddr] = true; - // Get value for each signal event and add it to the collection - let value; - // Treat generalized locks as 3 month locks - if (generalizedLocks.lockedContractAddresses.includes(data.contractAddr)) { - console.log('Generalized lock:', balances[index], data.contractAddr); - value = getEffectiveValue(balances[index], '0') - if (data.edgewareAddr in gLocks) { - gLocks[data.edgewareAddr] = toBN(gLocks[data.edgewareAddr]).add(value).toString(); - } else { - gLocks[data.edgewareAddr] = value.toString(); - } - } else { - value = getEffectiveValue(balances[index], 'signaling'); - } - // Add value to total signaled ETH - - totalETHSignaled = totalETHSignaled.add(toBN(balances[index])); - totalEffectiveETHSignaled = totalEffectiveETHSignaled.add(value); - // Iterate over signals, partition reward into delayed and immediate amounts - if (data.edgewareAddr in signals) { - signals[data.edgewareAddr] = { - signalAmt: toBN(balances[index]).add(toBN(signals[data.edgewareAddr].signalAmt)).toString(), - effectiveValue: toBN(signals[data.edgewareAddr] - .effectiveValue) - .add(value) - .toString(), - }; - } else { - signals[data.edgewareAddr] = { - signalAmt: toBN(balances[index]).toString(), - effectiveValue: value.toString(), - }; - } - } - }); - // Return signals and total ETH signaled - return { signals, totalETHSignaled, totalEffectiveETHSignaled, generalizedLocks: gLocks } -} - -const getLockStorage = async (web3, lockAddress) => { - return Promise.all([0,1].map(v => { - return web3.eth.getStorageAt(lockAddress, v); - })) - .then(vals => { - return { - owner: vals[0], - unlockTime: hexToNumber(vals[1]), - }; - }); -}; - -const selectEdgewareValidators = (validatingLocks, totalAllocation, totalEffectiveETH, numOfValidators, existentialBalance=100000000000000) => { - const sortable = []; - // Add the calculated edgeware balances with the respective key to a collection - for (var key in validatingLocks) { - const keys = key.slice(2).match(/.{1,64}/g).map(key => `0x${key}`);; - if (keys.length === 3) { - sortable.push([ - keys, - toBN(validatingLocks[key].effectiveValue).sub(toBN(existentialBalance)).mul(toBN(totalAllocation)).div(totalEffectiveETH) - ]); - } - } - - // Sort and take the top "numOfValidators" from the collection - return sortable - .sort((a,b) => (a[1].lt(b[1])) ? 1 : ((b[1].lt(a[1])) ? -1 : 0)) - .map(v => { - return ([ - ...v[0].map(k => (k.slice(2))), // stash, controller, session - v[1].toString(), // staked balance - ]); - }); -}; - -const getEdgewareBalanceObjects = (locks, signals, generalizedLocks, totalAllocation, totalEffectiveETH, existentialBalance=100000000000000) => { - let balances = []; - let vesting = []; - let existBalAllocation = mulByAllocationFraction(toBN(existentialBalance), totalAllocation, totalEffectiveETH).toString() - // handle locks separately than signals at first, then we'll scan over all - // entries and ensure that there are only unique entries in the collections. - for (var key in locks) { - let keys; - if (key.length === 194) { - keys = key.slice(2).match(/.{1,64}/g).map(key => `0x${key}`); - // remove existential balance from this lock for controller account - if (toBN(locks[key].effectiveValue).lte(toBN(existentialBalance))) { - console.log('Warning! Validating lock with not enough balance for controller account:', locks[key], key, keys) - } - // ensure encodings work - try { - const encoded1 = keyring.encodeAddress(keys[0]); - const encoded2 = keyring.encodeAddress(keys[1]); - // add entry in for stash account - balances.push([ - keys[0].slice(2), - mulByAllocationFraction(toBN(locks[key].effectiveValue).sub(toBN(existentialBalance)), totalAllocation, totalEffectiveETH).toString(), - ]); - // add entry in for controller account with minimal existential balance - balances.push([ - keys[1].slice(2), - existBalAllocation, - ]) - } catch(e) { - console.log(e); - console.log(`Error processing lock event: ${keys[0]} or ${keys[1]} (${locks[key].effectiveValue})`); - } - } else { - try { - const encoded = keyring.encodeAddress(key); - balances.push([ - key.slice(2), - mulByAllocationFraction(locks[key].effectiveValue, totalAllocation, totalEffectiveETH).toString(), - ]); - } catch(e) { - console.log(e); - console.log(`Error processing lock event: ${key} (${locks[key].effectiveValue})`); - } - } - } - // handle signal entries - for (var key in signals) { - try { - let keys = [key]; - // allocate signals to first key if multiple submitted - if (key.length === 194) { - keys = key.slice(2).match(/.{1,64}/g).map(key => `0x${key}`); - } - const encoded = keyring.encodeAddress(keys[0]); - - if (keys[0] in generalizedLocks) { - const gValue = generalizedLocks[keys[0]]; - const leftoverValue = toBN(signals[key].effectiveValue).sub(toBN(gValue)); - // add 25% of non-generalised signal value to the liquid amount for the vesting collection - const vestingValue = toBN(gValue).add(leftoverValue.mul(toBN(25)).div(toBN(100))) - // create new balance record for the signaler - balances.push([ - keys[0].slice(2), - mulByAllocationFraction(toBN(signals[key].effectiveValue), totalAllocation, totalEffectiveETH).toString(), - ]); - if (leftoverValue.gt(toBN(0))) { - // create vesting record - vesting.push([ - keys[0].slice(2), - 5256000, - 1, - mulByAllocationFraction(vestingValue, totalAllocation, totalEffectiveETH).toString(), - ]); - } - } else { - // the liquid amount of the vesting is 25% of signaled value - const vestingValue = toBN(signals[key].effectiveValue).mul(toBN(25)).div(toBN(100)); - // create new balance record for the signaler - balances.push([ - keys[0].slice(2), - mulByAllocationFraction(toBN(signals[key].effectiveValue), totalAllocation, totalEffectiveETH).toString(), - ]); - - // create vesting record - vesting.push([ - keys[0].slice(2), - 5256000, - 1, - mulByAllocationFraction(vestingValue, totalAllocation, totalEffectiveETH).toString(), - ]); - } - } catch(e) { - console.log(e); - console.log(`Error processing signal event: ${key} (${signals[key].effectiveValue})`); - } - } - - return { balances: balances, vesting: vesting }; -}; - -const combineToUnique = (balances, vesting) => { - let balancesMap = {}; - let vestingMap = {}; - balances.forEach(entry => { - let account = entry[0]; - let amount = entry[1]; - - if (account in balancesMap) { - balancesMap[account] = toBN(balancesMap[account]).add(toBN(amount)).toString(); - } else { - balancesMap[account] = amount - } - }); - - vesting.forEach(entry => { - let account = entry[0]; - let amount = entry[3]; - if (account in vestingMap) { - vestingMap[account] = toBN(vestingMap[account]).add(toBN(amount)).toString(); - } else { - vestingMap[account] = amount - } - }); - - let newBalances = [] - let newVesting = []; - let total = toBN(0); - Object.keys(balancesMap).forEach(key => { - total = total.add(toBN(balancesMap[key])); - newBalances.push([ - key, - balancesMap[key], - ]); - }); - - Object.keys(vestingMap).forEach(key => { - newVesting.push([ - key, - 5256000, - 1, - vestingMap[key], - ]); - }); - console.log(`Balances: ${balances.length}`); - console.log(`Balances with vesting: ${vesting.length}`); - console.log(`EDG Total: ${total.toString()}`); - return { balances: newBalances, vesting: newVesting, total: total }; -} - -const mulByAllocationFraction = (amount, totalAllocation, totalEffectiveETH) => { - return toBN(amount).mul(toBN(totalAllocation)).div(toBN(totalEffectiveETH)); -} - -module.exports = { - getLocks, - getSignals, - getTotalLockedBalance, - getTotalSignaledBalance, - calculateEffectiveLocks, - calculateEffectiveSignals, - getLockStorage, - selectEdgewareValidators, - getEdgewareBalanceObjects, - combineToUnique, -}; diff --git a/ts-tests/frontier-tester/helpers/lockdropWeb3Util.js b/ts-tests/frontier-tester/helpers/lockdropWeb3Util.js deleted file mode 100644 index 206eb287..00000000 --- a/ts-tests/frontier-tester/helpers/lockdropWeb3Util.js +++ /dev/null @@ -1,100 +0,0 @@ -const Promise = require('bluebird'); - -const advanceTimeAndBlock = async (time) => { - await advanceTime(time); - await advanceBlock(); - - return getCurrentBlock(); -}; - -const advanceTime = (time, web3) => { - return new Promise((resolve, reject) => { - web3.currentProvider.send({ - jsonrpc: '2.0', - method: 'evm_increaseTime', - params: [time], - id: new Date().getTime() - }, (err, result) => { - if (err) { return reject(err); } - else { - if (!err) { - web3.currentProvider.send({ - jsonrpc: '2.0', - method: 'evm_mine', - params: [], - id: new Date().getSeconds() - }, (e, res) => { - if (e) reject(e); - else resolve(res); - }); - } - } - }); - }); -}; - -const advanceBlock = (web3) => { - return new Promise((resolve, reject) => { - web3.currentProvider.send({ - jsonrpc: '2.0', - method: 'evm_mine', - id: new Date().getTime() - }, (err, result) => { - if (err) { return reject(err); } - web3.eth.getBlock('latest', function (err, res) { - if (err) reject(err); - resolve(res.hash); - }); - }); - }); -}; - -function getCurrentBlock(web3) { - return new Promise((resolve, reject) => { - web3.eth.getBlock('latest', function (err, res) { - if (err) return reject(err); - resolve(res); - }); - }); -} - -async function getCurrentTimestamp(web3) { - const block = await getCurrentBlock(web3); - return block.timestamp; -} - - -const getBalance = (account, web3) => { - return new Promise((resolve, reject) => { - web3.eth.getBalance(account, (err, res) => { - if (err) reject(err); - else resolve(res); - }); - }); -}; - -const getTxReceipt = async (txHash, web3) => { - return await web3.eth.getTransactionReceipt(txHash); -} - -async function assertRevert(promise, invariants = () => {}) { - try { - await promise; - assert.fail('Expected revert not received'); - } catch (error) { - const revertFound = error.message.search('revert') >= 0 || error.message.search('invalid opcode'); - assert(revertFound, `Expected 'revert', got ${error} instead`); - invariants.call() - } -} - -module.exports = { - advanceTimeAndBlock, - advanceTime, - advanceBlock, - getCurrentBlock, - getCurrentTimestamp, - getBalance, - assertRevert, - getTxReceipt, -}; diff --git a/ts-tests/frontier-tester/helpers/schedule.js b/ts-tests/frontier-tester/helpers/schedule.js deleted file mode 100644 index 638ae8fa..00000000 --- a/ts-tests/frontier-tester/helpers/schedule.js +++ /dev/null @@ -1,31 +0,0 @@ -const { toBN, toWei } = require('web3').utils; - -const getEarlyParticipationBonus = (lockTime, lockStart) => { - const JUNE_1ST_UTC = 1559347200; - const JUNE_16TH_UTC = 1560643200; - const JULY_1ST_UTC = 1561939200; - const JULY_16TH_UTC = 1563235200; - const JULY_31ST_UTC = 1564531200; - const AUG_15TH_UTC = 1565827200; - const AUG_30TH_UTC = 1567123200; - - if (toBN(lockTime).lte(toBN(JUNE_16TH_UTC))) { - return toBN(150); - } else if (toBN(lockTime).lte(toBN(JULY_1ST_UTC))) { - return toBN(135); - } else if (toBN(lockTime).lte(toBN(JULY_16TH_UTC))) { - return toBN(123); - } else if (toBN(lockTime).lte(toBN(JULY_31ST_UTC))) { - return toBN(114); - } else if (toBN(lockTime).lte(toBN(AUG_15TH_UTC))) { - return toBN(108); - } else if (toBN(lockTime).lte(toBN(AUG_30TH_UTC))) { - return toBN(105); - } else { - return toBN(100); - } -}; - -module.exports = { - getEarlyParticipationBonus, -} diff --git a/ts-tests/frontier-tester/helpers/utils.js b/ts-tests/frontier-tester/helpers/utils.js deleted file mode 100644 index 1f66127d..00000000 --- a/ts-tests/frontier-tester/helpers/utils.js +++ /dev/null @@ -1,204 +0,0 @@ -const Web3 = require('web3'); -const HDWalletProvider = require("@truffle/hdwallet-provider"); -const { decodeAddress, encodeAddress, blake2AsHex } = require('@polkadot/util-crypto'); -const child_process = require('child_process'); -const { exit } = require('process'); - -const DISPLAY_LOG = process.env.DISPLAY_LOG || false; -const BINARY_PATH = `../../target/release/edgeware`; -const SPAWNING_TIME = 30000; - -// const account = '0x6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b'; -const account = '0x19e7e376e7c213b7e7e7e46cc70a5dd086daff2a'; -// const privKey = '99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342'; -const privKey = '1111111111111111111111111111111111111111111111111111111111111111'; - -const initWeb3 = async (pkey = privKey) => { - // const provider = new Web3.providers.HttpProvider('http://localhost:9933/'); - const provider = new HDWalletProvider({ - privateKeys: [ pkey ], - providerOrUrl: "http://localhost:9933/", - }); - const web3 = new Web3(provider); - const chainId = await web3.eth.getChainId(); - - // ensure native web3 sending works as well as truffle provider - web3.eth.accounts.wallet.add(privKey); - web3.eth.defaultAccount = web3.eth.accounts.wallet[0].address; - return web3; -}; - -const deployContract = async (name, c, args = [], web3 = undefined) => { - let deployer, pkey; - if (!web3) { - web3 = context.web3; - deployer = account; - pkey = privKey; - } else { - deployer = web3.eth.accounts.wallet[0].address; - pkey = web3.eth.accounts.wallet[0].privateKey; - } - - console.log(`Attempting to deploy ${name} from account: ${deployer}`); - const contract = new web3.eth.Contract(c.abi); - - const contractTx = contract.deploy({ - data: c.bytecode, - arguments: args, - }); - const estimatedGas = await contractTx.estimateGas(); - console.log(estimatedGas); - - const data = contractTx.encodeABI(); - const createTransaction = await web3.eth.accounts.signTransaction( - { - from: deployer, - data, - gas: estimatedGas, - }, - pkey - ); - - const createReceipt = await web3.eth.sendSignedTransaction( - createTransaction.rawTransaction - ); - console.log(`${name} deployed at address ${createReceipt.contractAddress}`); - return new web3.eth.Contract(c.abi, createReceipt.contractAddress); -}; - -const convertToEvmAddress = (substrateAddress) => { - const addressBytes = decodeAddress(substrateAddress); - return '0x' + Buffer.from(addressBytes.subarray(0, 20)).toString('hex'); -} - -const convertToSubstrateAddress = (evmAddress, prefix = 7) => { - const addressBytes = Buffer.from(evmAddress.slice(2), 'hex'); - const prefixBytes = Buffer.from('evm:'); - const convertBytes = Uint8Array.from(Buffer.concat([ prefixBytes, addressBytes ])); - const finalAddressHex = blake2AsHex(convertBytes, 256); - return encodeAddress(finalAddressHex, prefix); -} - -async function startEdgewareNode() { - const basePath = process.env.BASE_PATH || './db'; - const chain = process.env.CHAIN_PATH || 'dev'; - const cmd = BINARY_PATH; - const args = [ - // '--dev', - `--chain=${chain}`, - '--pruning=archive', - '--no-telemetry', - '--no-prometheus', - // '--tmp', - `--base-path=${basePath}`, - '--force-authoring', - '--alice', - '--validator', - '-lrpc=trace', - // '-levm=trace', - ]; - // console.log(`Running node with args: ${JSON.stringify(args)}`); - const binary = child_process.spawn(cmd, args); - - binary.on("error", (err) => { - if (err.errno == "ENOENT") { - console.error( - `\x1b[31mMissing Frontier binary (${BINARY_PATH}).\nPlease compile the Frontier project:\ncargo build\x1b[0m` - ); - } else { - console.error(err); - } - process.exit(1); - }); - - const binaryLogs = []; - const web3 = await new Promise((resolve) => { - const errHandle = () => { - console.error(`\x1b[31m Failed to start Edgeware Node.\x1b[0m`); - console.error(`Command: ${cmd} ${args.join(" ")}`); - console.error(`Logs:`); - console.error(binaryLogs.map((chunk) => chunk.toString()).join("\n")); - process.exit(1); - }; - const timer = setTimeout(errHandle, SPAWNING_TIME - 2000); - - const onData = async (chunk) => { - if (DISPLAY_LOG) { - console.log(chunk.toString()); - } - binaryLogs.push(chunk); - if (chunk.toString().match(/Address already in use/)) { - clearTimeout(timer); - errHandle(); - } else if (chunk.toString().match(/Listening for new connections/)) { - const web3 = await initWeb3(); - await web3.eth.getChainId(); - - clearTimeout(timer); - if (!DISPLAY_LOG) { - binary.stderr.off("data", onData); - binary.stdout.off("data", onData); - } - // console.log(`\x1b[31m Starting RPC\x1b[0m`); - resolve(web3); - } - }; - - // hook interrupt handler - const exitHandler = () => { - // console.log(`\x1b[31m Exit Handler Called\x1b[0m`); - binary.kill(); - process.exit(); - }; - process.on('SIGINT', exitHandler); - // process.on('exit', exitHandler); - - // hook data printing - binary.stderr.on("data", onData); - binary.stdout.on("data", onData); - }); - return { web3, binary }; -} - -function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} - -function describeWithEdgeware(title, cb) { - describe(title, async () => { - const context = { web3: null, binary: null }; - before("Starting Edgeware Node", async () => { - const data = await startEdgewareNode(); - context.binary = data.binary; - context.web3 = data.web3; - }); - - after('Exiting Edgeware Node', async () => { - if (context.web3 && context.web3.currentProvider && context.web3.currentProvider.engine) { - context.web3.currentProvider.engine.stop(); - } - - // console.log(`\x1b[31m Stopping RPC\x1b[0m`); - await new Promise((resolve) => { - context.binary.on('exit', () => { - // console.log('RPC STOPPED'); - resolve(); - }) - context.binary.kill(); - }); - await sleep(2000); - }); - - await cb(context); - }); -} - -module.exports = { - account, - privKey, - initWeb3, - deployContract, - convertToEvmAddress, - convertToSubstrateAddress, - describeWithEdgeware, -} diff --git a/ts-tests/frontier-tester/package.json b/ts-tests/frontier-tester/package.json deleted file mode 100644 index fe6b5bbc..00000000 --- a/ts-tests/frontier-tester/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "uniswap", - "version": "1.0.0", - "description": "", - "main": "index.js", - "directories": { - "test": "test" - }, - "scripts": { - "compile": "truffle compile", - "add-liquidity": "mocha --timeout 1000000 --exit tests/addLiquidity.js", - "init-eth-balance": "ts-mocha --timeout 100000 helpers/initDefaultAccountBalance.ts", - "test": "truffle compile && ts-mocha --timeout 100000", - "test-ci": "truffle compile && ts-mocha --timeout 100000 ./tests/*.{ts,js}" - }, - "author": "", - "license": "ISC", - "dependencies": { - "@edgeware/node-types": "^3.1.0-beta.14", - "@openzeppelin/contracts": "^2.5.0", - "@polkadot/api": "3.2.4-3", - "@polkadot/api-contract": "3.2.4-3", - "@polkadot/keyring": "^5.2.2", - "@polkadot/util": "^5.2.2", - "@polkadot/util-crypto": "^5.2.2", - "@truffle/contract": "^4.2.22", - "@truffle/hdwallet-provider": "^1.2.0", - "@types/chai": "^4.2.12", - "@types/mocha": "^8.0.3", - "@uniswap/v2-core": "^1.0.1", - "@uniswap/v2-periphery": "^1.1.0-beta.0", - "bn.js": "^5.1.3", - "chai": "^4.2.0", - "ethereumjs-wallet": "^1.0.0", - "hooked-web3-provider": "^1.0.0", - "js-sha256": "^0.9.0", - "mocha": "^8.2.1", - "openzeppelin-solidity": "^3.1.0", - "truffle": "^5.1.33", - "truffle-assertions": "^0.9.2", - "ts-mocha": "^7.0.0", - "ts-node": "^9.0.0", - "typescript": "^4.0.3", - "web3": "^1.2.0", - "web3-provider-engine": "https://github.com/MetaMask/web3-provider-engine.git" - } -} diff --git a/ts-tests/frontier-tester/tests/addLiquidity.js b/ts-tests/frontier-tester/tests/addLiquidity.js deleted file mode 100644 index 89b52b82..00000000 --- a/ts-tests/frontier-tester/tests/addLiquidity.js +++ /dev/null @@ -1,107 +0,0 @@ -const contract = require("@truffle/contract"); -const { assert } = require("chai"); -const { account, describeWithEdgeware } = require('../helpers/utils'); -const { deploy } = require('../helpers/deployUniswap'); - -const TokenA = require('../build/contracts/TokenA.json'); -const TokenB = require('../build/contracts/TokenB.json'); -const UniswapV2Router02 = require('../node_modules/@uniswap/v2-periphery/build/UniswapV2Router02.json'); -const UniswapV2Factory = require('../node_modules/@uniswap/v2-core/build/UniswapV2Factory.json'); -const UniswapV2Pair = require('../node_modules/@uniswap/v2-core/build/UniswapV2Pair.json'); - -describeWithEdgeware('Add Liquidity Test', async (context) => { - let FACTORY_ADDRESS; - let ROUTER_ADDRESS; - - before('Deploy uniswap contracts', async () => { - const d = await deploy(context.web3); - [FACTORY_ADDRESS, ROUTER_ADDRESS] = d; - }); - - it('should create uniswap pair', async () => { - // deploy two tokens - const web3 = context.web3; - const amount0 = web3.utils.toWei('10'); - const amount1 = web3.utils.toWei('10'); - - console.log('Deploying first token...'); - const TokenAContract = contract({ - abi: TokenA.abi, - unlinked_binary: TokenA.bytecode, - }); - TokenAContract.setProvider(web3.currentProvider); - const token0 = await TokenAContract.new(web3.utils.toWei('100'), { from: account }); - const address0 = token0.address; - - console.log('Deploying second token...'); - const TokenBContract = contract({ - abi: TokenB.abi, - unlinked_binary: TokenB.bytecode, - }); - TokenBContract.setProvider(web3.currentProvider); - const token1 = await TokenBContract.new(web3.utils.toWei('100'), { from: account }); - const address1 = token1.address; - - console.log('Approving first token...'); - const receipt0 = await token0.approve(ROUTER_ADDRESS, amount0, { - from: account - }); - console.log('Approving second token...'); - const receipt1 = await token1.approve(ROUTER_ADDRESS, amount1, { - from: account - }); - - // create the pair - const RouterContract = contract({ - abi: UniswapV2Router02.abi, - unlinked_binary: UniswapV2Router02.bytecode, - }); - RouterContract.setProvider(web3.currentProvider); - const router = await RouterContract.at(ROUTER_ADDRESS); - const args = [ - address0, address1, - amount0, amount1, - "0", "0", - account, - Math.ceil(Date.now() / 1000) + (60 * 20), // 1 day - { from: account }, - ]; - console.log('Adding liquidity with args: ', args); - const liquidityReceipt = await router.addLiquidity(...args); - - // query the pair - const FactoryContract = contract({ - abi: UniswapV2Factory.abi, - unlinked_binary: UniswapV2Factory.bytecode, - }); - FactoryContract.setProvider(web3.currentProvider); - console.log('Querying factory for pair...'); - const factory = await FactoryContract.at(FACTORY_ADDRESS, { from: account }); - const pairAddress = await factory.getPair.call(address0, address1, { - from: account, - }); - console.log(pairAddress); - const nPairs = await factory.allPairsLength.call({ from: account }); - - // query the pair's reserves - assert.notEqual(+nPairs, 0); - assert.notEqual(+(pairAddress.slice(2)), 0); - console.log(`Got pair: ${pairAddress} (${nPairs} total pairs).`); - const PairContract = contract({ - abi: UniswapV2Pair.abi, - unlinked_binary: UniswapV2Pair.bytecode, - }); - PairContract.setProvider(web3.currentProvider); - const pair = await PairContract.at(pairAddress); - const result = await pair.getReserves.call({ from: account }); - console.log(result); - console.log('result[0].toString()'); - console.log(result[0].toString()); - console.log(amount0); - console.log('result[1].toString()'); - console.log(result[1].toString()); - console.log(amount1); - assert.equal(result[0].toString(), amount0); - assert.equal(result[1].toString(), amount1); - }); -}); diff --git a/ts-tests/frontier-tester/tests/testAllowance.js b/ts-tests/frontier-tester/tests/testAllowance.js deleted file mode 100644 index 33ae3dda..00000000 --- a/ts-tests/frontier-tester/tests/testAllowance.js +++ /dev/null @@ -1,27 +0,0 @@ -const { assert } = require("chai"); -const { account, describeWithEdgeware } = require('../helpers/utils'); -// const UniswapV2ERC20 = require('../node_modules/@uniswap/v2-core/build/UniswapV2ERC20.json'); -const ERC20 = require('../node_modules/@openzeppelin/contracts/build/contracts/ERC20.json'); -const contract = require("@truffle/contract"); - -describeWithEdgeware("Allowance test", async (context) => { - it("should compute allowance", async () => { - const web3 = context.web3; - - let erc = contract({ - abi: ERC20.abi, - unlinked_binary: ERC20.bytecode, - }); - erc.setProvider(web3.currentProvider); - - const v = web3.utils.toWei('10', 'ether'); - let c = await erc.new({ from: account }); - - // create with value - const approvalAccount = '0xc0ffee254729296a45a3885639AC7E10F9d54979'; - await c.approve(approvalAccount, v, { from: account }); - - const allowance = await c.allowance.call(account, approvalAccount, { from: account }); - assert.equal(allowance, v); - }); -}); diff --git a/ts-tests/frontier-tester/tests/testCreate.js b/ts-tests/frontier-tester/tests/testCreate.js deleted file mode 100644 index 4dc8edc6..00000000 --- a/ts-tests/frontier-tester/tests/testCreate.js +++ /dev/null @@ -1,71 +0,0 @@ -const { assert } = require("chai"); -const { account, describeWithEdgeware } = require('../helpers/utils'); - -const CreateContract = require('../build/contracts/CreateContract.json'); -const SubContract = require('../build/contracts/SubContract.json'); -const contract = require("@truffle/contract"); - -describeWithEdgeware("CreateContract test", async (context) => { - it("should spawn subcontract", async () => { - const web3 = context.web3; - - let Create = contract({ - abi: CreateContract.abi, - unlinked_binary: CreateContract.bytecode, - }); - Create.setProvider(web3.currentProvider); - - let c = await Create.new({ from: account }); - let startNonce = await web3.eth.getTransactionCount(c.address); - console.log(`CreateContract address: ${c.address}, nonce: ${startNonce}`); - // create without value - let receipt = await c.spawn({ from: account }); - let address = await c.deployed.call({ from: account }); - - var Sub = contract({ - abi: SubContract.abi, - unlinked_binary: SubContract.bytecode, - }); - Sub.setProvider(web3.currentProvider); - let cSub = await Sub.at(address); - let balance = await cSub.getValue.call({ from: account }); - assert.equal(balance, '0', 'balance of deployed subcontract should be 0'); - - // check nonce - let nonce = await web3.eth.getTransactionCount(c.address); - assert.equal(nonce, startNonce + 1, 'contract nonce should increment'); - }); - - it("should spawn with value", async () => { - const web3 = context.web3; - - let Create = contract({ - abi: CreateContract.abi, - unlinked_binary: CreateContract.bytecode, - }); - Create.setProvider(web3.currentProvider); - - let c = await Create.new({ from: account }); - let startNonce = await web3.eth.getTransactionCount(c.address); - console.log(`CreateContract address: ${c.address}, nonce: ${startNonce}`); - // create with value - const value = web3.utils.toWei('10', 'ether'); - await c.spawnWithValue({ value, from: account }); - address = await c.deployed.call({ from: account }); - var Sub = contract({ - abi: SubContract.abi, - unlinked_binary: SubContract.bytecode, - }); - Sub.setProvider(web3.currentProvider); - let cSub = await Sub.at(address); - - let balOnContract = await cSub.getValue.call({ from: account }); - let balance = await web3.eth.getBalance(cSub.address); - assert.equal(balOnContract, value, 'new subcontract should have balance paid to it'); - assert.equal(balOnContract, balance, 'new subcontract should have balance paid to it'); - - // check nonce - const nonce = await web3.eth.getTransactionCount(c.address); - assert.equal(nonce, startNonce + 1, 'contract nonce should increment twice'); - }); -}); diff --git a/ts-tests/frontier-tester/tests/testCreate2.js b/ts-tests/frontier-tester/tests/testCreate2.js deleted file mode 100644 index d402ce82..00000000 --- a/ts-tests/frontier-tester/tests/testCreate2.js +++ /dev/null @@ -1,33 +0,0 @@ -const { assert } = require('chai'); -const Create2Factory = require('../build/contracts/Create2Factory.json'); -const ValueContract = require('../build/contracts/ValueContract.json'); -const { describeWithEdgeware, account } = require('../helpers/utils'); -const contract = require("@truffle/contract"); - -describeWithEdgeware('Create2Factory test', async (context) => { - it('should deploy with create2', async () => { - const web3 = context.web3; - let Create2 = contract({ - abi: Create2Factory.abi, - unlinked_binary: Create2Factory.bytecode, - }); - Create2.setProvider(web3.currentProvider); - - let c = await Create2.new({ from: account }); - - // load bytecode and deploy - await c.deploy(5, { from: account, gasPrice: 1000000000 }); - const addr = await c.viewAddr.call({ from: account, gasPrice: 1000000000 }); - - let Value = contract({ - abi: ValueContract.abi, - unlinked_binary: ValueContract.bytecode, - }); - Value.setProvider(web3.currentProvider); - - // load new contract and check methods - const valueContract = await Value.at(addr); - const value = await valueContract.getValue.call({ from: account, gasPrice: 1000000000 }); - assert.equal(value, '0'); - }); -}); diff --git a/ts-tests/frontier-tester/tests/testECRecovery.js b/ts-tests/frontier-tester/tests/testECRecovery.js deleted file mode 100644 index 69338b3c..00000000 --- a/ts-tests/frontier-tester/tests/testECRecovery.js +++ /dev/null @@ -1,65 +0,0 @@ -const { assert } = require('chai'); -const contract = require("@truffle/contract"); -const { account, privKey, describeWithEdgeware } = require('../helpers/utils'); -const ECRecovery = require('../build/contracts/ECRecovery.json'); - -describeWithEdgeware('ECRecovery test', async (context) => { - it('should recover account from signature and hash', async () => { - const web3 = context.web3; - - let ECR = contract({ - abi: ECRecovery.abi, - unlinked_binary: ECRecovery.bytecode, - }); - ECR.setProvider(web3.currentProvider); - - const c = await ECR.new({ from: account }); - - // prepare a signed message - const message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tubulum fuisse, qua illum, cuius is condemnatus est rogatione, P. Eaedem res maneant alio modo.' - const messageHex = '0x' + Buffer.from(message).toString('hex'); - const signature = await web3.eth.sign(messageHex, account); - const hash = web3.utils.sha3('\x19Ethereum Signed Message:\n' + message.length + message); - - // recover the signer - const address = await c.recover(hash, signature, { from: account, gas: web3.utils.toWei('1', 'ether') }); - assert.equal(address.toLowerCase(), account.toLowerCase()); - }); - - it('should interact with precompile directly', async () => { - const web3 = context.web3; - const ECRECOVER_PRECOMPILE_ADDRESS = '0000000000000000000000000000000000000000'; - - const message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tubulum fuisse, qua illum, cuius is condemnatus est rogatione, P. Eaedem res maneant alio modo.' - const messageHex = '0x' + Buffer.from(message).toString('hex'); - const sig = (await web3.eth.sign(messageHex, account)).slice(2); - const r = `${sig.slice(0, 64)}` - const s = `${sig.slice(64, 128)}` - const v = `${sig.slice(128, 130)}` - const sigPart = `${Buffer.alloc(31).toString('hex')}${v}${r}${s}`; - const hash = web3.utils.sha3('\x19Ethereum Signed Message:\n' + message.length + message).slice(2); - - const RAW_TX = { - from: account, - gas: '27720', - to: ECRECOVER_PRECOMPILE_ADDRESS, - value: "0x0", - data: `0x${hash.toString('hex')}${sigPart}`, - }; - - const SIGNED_TX = await web3.eth.accounts.signTransaction( - RAW_TX, - privKey - ); - - const tx = await web3.eth.sendTransaction({ - from: account, - to: ECRECOVER_PRECOMPILE_ADDRESS, - value: '0x0', - gas: '27720', - data: `0x${hash.toString('hex')}${sigPart}`, - }); - - assert.equal(tx.transactionHash, SIGNED_TX.transactionHash); - }); -}); diff --git a/ts-tests/frontier-tester/tests/testEvent.js b/ts-tests/frontier-tester/tests/testEvent.js deleted file mode 100644 index b956f861..00000000 --- a/ts-tests/frontier-tester/tests/testEvent.js +++ /dev/null @@ -1,65 +0,0 @@ -const { assert } = require('chai'); -const Web3 = require('web3'); -const EventContract = require('../build/contracts/EventContract.json'); -const { deployContract, account, describeWithEdgeware } = require('../helpers/utils'); -const contract = require("@truffle/contract"); - -describeWithEdgeware("EventContract test", async (context) => { - it("should emit event", async () => { - const web3 = context.web3; - let EC = contract({ - abi: EventContract.abi, - unlinked_binary: EventContract.bytecode, - }); - EC.setProvider(web3.currentProvider); - let c = await EC.new({ from: account }); - let res = await c.emitEvent({ from: account }); - assert.equal(res.receipt.logs.length, 1); - assert.equal(res.receipt.logs[0].event, 'e'); - }); - - it('should receive event thru web3 subscribe', async () => { - // init an HTTP web3 and use to set up another account for ws - const web3Http = context.web3; - const wsPrivKey = '99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E342'; - const wsAccount = '0x6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b'; - const value = web3Http.utils.toWei(web3Http.utils.toBN('1'), 'ether'); - const gasEstimate = await web3Http.eth.estimateGas({ - from: account, to: wsAccount, value, - }); - const balanceTx = await web3Http.eth.sendTransaction({ - from: account, to: wsAccount, value, gas: gasEstimate, - }); - - // init web3 with wsprovider - const web3Ws = new Web3(new Web3.providers.WebsocketProvider("ws://localhost:9944/")); - web3Ws.eth.accounts.wallet.add(wsPrivKey); - web3Ws.eth.defaultAccount = wsAccount; - const c = await deployContract('EventContract', EventContract, [], web3Ws, wsPrivKey); - const cAddress = c._address; - - // init subscription - await new Promise(async (resolve) => { - const sid = await new Promise((innerResolve) => { - c.events.allEvents() - .on('data', (data) => { - assert.equal(data.event, 'e'); - assert.equal(data.address, cAddress); - resolve(); - }) - .on('error', console.error) - .on('connected', (id) => innerResolve(id)); - }) - console.log(`Event subscription connected with id ${sid}.`); - - // use HTTP web3 connection to fire a tx to emit event - let EC = contract({ - abi: EventContract.abi, - unlinked_binary: EventContract.bytecode, - }); - EC.setProvider(web3Http.currentProvider); - const cc = await EC.at(cAddress); - const emitTx = await cc.emitEvent({ from: account }); - }); - }) -}); diff --git a/ts-tests/frontier-tester/tests/testFallback.js b/ts-tests/frontier-tester/tests/testFallback.js deleted file mode 100644 index adaadafb..00000000 --- a/ts-tests/frontier-tester/tests/testFallback.js +++ /dev/null @@ -1,37 +0,0 @@ -const { assert } = require('chai'); -const { account, describeWithEdgeware } = require('../helpers/utils'); -const contract = require("@truffle/contract"); -const FallbackContract = require('../build/contracts/FallbackContract.json'); - -describeWithEdgeware('Fallback test', async (context) => { - it('should return funds sent to invalid function', async () => { - const web3 = context.web3; - - // deploy contract - const FB = contract({ - abi: FallbackContract.abi, - unlinked_binary: FallbackContract.bytecode, - }); - FB.setProvider(web3.currentProvider); - const c = await FB.new({ from: account }); - - // prepare an invalid function call - const balanceBefore = await web3.eth.getBalance(account); - const functionSig = web3.eth.abi.encodeFunctionSignature('myMethod()'); - const valueSent = new web3.utils.BN(web3.utils.toWei('10', 'ether')); - const receipt = await web3.eth.sendTransaction({ - from: account, - to: c.address, - value: valueSent.toString(), - gas: '200000', - data: functionSig, - gasPrice: '1', - }); - const balanceAfter = await web3.eth.getBalance(account); - const balanceDiff = new web3.utils.BN(balanceBefore).sub(new web3.utils.BN(balanceAfter)); - const gasUsed = new web3.utils.BN(receipt.gasUsed); - - // ensure the value sent was (mostly) returned besides gas - assert.isTrue(balanceDiff.eq(gasUsed)); - }); -}) \ No newline at end of file diff --git a/ts-tests/frontier-tester/tests/testGasWeighting.ts b/ts-tests/frontier-tester/tests/testGasWeighting.ts deleted file mode 100644 index da6c5a93..00000000 --- a/ts-tests/frontier-tester/tests/testGasWeighting.ts +++ /dev/null @@ -1,47 +0,0 @@ -// TODO: try to send in many txs at once with different gas values and ensure that the highest ones go through -// - see what happens, do some get dropped? how does it work? -// - basically try to break the gas system - -import { assert } from 'chai'; -import StoreNum from '../build/contracts/StoreNum.json'; -const contract = require("@truffle/contract"); -const { account, describeWithEdgeware } = require('../helpers/utils.js'); - -describeWithEdgeware('Gas Weighting Test', async (context) => { - it.skip('should resolve higher priced tx earlier', async () => { - const web3 = context.web3; - - // init a contract that stores numbers - let SN = contract({ - abi: StoreNum.abi, - unlinked_binary: StoreNum.bytecode, - }); - SN.setProvider(web3.currentProvider); - const sn = await SN.new({ from: account }); - - // send out then wait for several transactions with different gas prices - const txPs = []; - const gas = await sn.addToStore.estimateGas(1); - console.log(`Estimated gas: ${gas}.`); - for (let i = 1; i <= 200; ++i) { - try { - const tx = sn.addToStore(i, { - from: account, - gasPrice: `${i % 2 ? 0 : 1000}`, - gas: (new web3.utils.BN(gas)).muln(2).toString(), - }); - txPs.push(tx); - } catch (e) { - console.log(`Failed to submit tx ${i} -- stopping.`); - break; - } - } - const receipts = await Promise.all(txPs); - const indexedReceipts = receipts.map((v, i) => [ v.receipt, i ]); - console.log(indexedReceipts.map((r) => `tx idx ${r[0].transactionIndex} adding value ${r[1]} processed on block ${r[0].blockNumber}`)); - - // check which order they were processed - const store = await sn.getStore(); - console.log(store.map((n) => +n)); - }); -}); diff --git a/ts-tests/frontier-tester/tests/testHashing.js b/ts-tests/frontier-tester/tests/testHashing.js deleted file mode 100644 index 0b1be81f..00000000 --- a/ts-tests/frontier-tester/tests/testHashing.js +++ /dev/null @@ -1,90 +0,0 @@ -const { assert } = require('chai'); -const contract = require("@truffle/contract"); -const { account, describeWithEdgeware } = require('../helpers/utils'); -const HashingContract = require('../build/contracts/Hashing.json'); -const RIPEMD160 = require('ripemd160'); -const { sha256 } = require('js-sha256'); - -// web3.eth.call returns a 32-byte hex string, but RIPEMD160 only returns a 20-byte result, -// so we need to trim the leading 0s off the call's return value in order to compare strings -// for equality. -const trimLeadingHex0s = (web3, n) => { - return web3.utils.numberToHex(web3.utils.hexToNumberString(n)); -} - -describeWithEdgeware('Hashing test', async (context) => { - let web3; - let c; - const message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tubulum fuisse, qua illum, cuius is condemnatus est rogatione, P. Eaedem res maneant alio modo.' - const messageBuf = Buffer.from(message); - const messageHex = '0x' + messageBuf.toString('hex'); - - before(async () => { - // setup web3 and contract instance - web3 = context.web3; - const Hashing = contract({ - abi: HashingContract.abi, - unlinked_binary: HashingContract.bytecode, - }); - Hashing.setProvider(web3.currentProvider); - c = await Hashing.new({ from: account }); - }); - - it('should perform keccak256 thru contract', async () => { - const contractResult = await c.callKeccak256.call(messageBuf, { from: account }); - const localResult = web3.utils.keccak256(messageHex); - assert.equal(contractResult, localResult); - }); - - it('should perform ripemd160 thru contract', async () => { - const contractResult = await c.callRipemd160.call(messageHex, { from: account }); - const localResult = '0x' + (new RIPEMD160().update(messageBuf).digest('hex')); - assert.equal(contractResult, localResult); - }); - - it('should perform ripemd160 directly', async () => { - const callResult = await web3.eth.call({ - to: '0000000000000000000000000000000000000003', - from: account, - data: messageHex, - }); - const localResult = '0x' + (new RIPEMD160().update(messageBuf).digest('hex')); - assert.equal(trimLeadingHex0s(web3, callResult), localResult); - }); - - it('should obtain same ripemd results from contract and direct call', async () => { - const callResult = await web3.eth.call({ - to: '0000000000000000000000000000000000000003', - from: account, - data: messageHex, - }); - const contractResult = await c.callRipemd160.call(messageHex, { from: account }); - assert.equal(trimLeadingHex0s(web3, callResult), contractResult); - }) - - it('should perform sha256 thru contract', async () => { - const contractResult = await c.callSha256.call(messageHex, { from: account }); - const localResult = '0x' + sha256.hex(messageBuf); - assert.equal(contractResult, localResult); - }); - - it('should perform sha256 directly', async () => { - const callResult = await web3.eth.call({ - to: '0000000000000000000000000000000000000002', - from: account, - data: messageHex, - }); - const localResult = '0x' + sha256.hex(messageBuf); - assert.equal(callResult, localResult); - }); - - it('should obtain same sha256 results from contract and direct call', async () => { - const callResult = await web3.eth.call({ - to: '0000000000000000000000000000000000000002', - from: account, - data: messageHex, - }); - const contractResult = await c.callSha256.call(messageHex, { from: account }); - assert.equal(callResult, contractResult); - }) -}); diff --git a/ts-tests/frontier-tester/tests/testInterfaces.js b/ts-tests/frontier-tester/tests/testInterfaces.js deleted file mode 100644 index 802f95d9..00000000 --- a/ts-tests/frontier-tester/tests/testInterfaces.js +++ /dev/null @@ -1,35 +0,0 @@ -const { assert } = require("chai"); -const IContractUser = require('../build/contracts/IContractUser.json'); -const ContractImpl = require('../build/contracts/ContractImpl.json'); -const { account, describeWithEdgeware } = require('../helpers/utils'); -const contract = require("@truffle/contract"); - -describeWithEdgeware('Interfaces test', async (context) => { - it('should access deployed interface', async () => { - const web3 = context.web3; - - console.log('Deploying something-doer...') - let CIContract = contract({ - abi: ContractImpl.abi, - unlinked_binary: ContractImpl.bytecode, - }); - CIContract.setProvider(web3.currentProvider); - let ci = await CIContract.new({ from: account }); - - console.log('Deploying caller of interface...'); - let ICUContract = contract({ - abi: IContractUser.abi, - unlinked_binary: IContractUser.bytecode, - }); - ICUContract.setProvider(web3.currentProvider); - let icu = await ICUContract.new({ from: account }); - - // test calling the subcontract - console.log('Linking contracts...'); - const tx = await icu.linkContract(ci.address, { from: account }) - - console.log('Calling method on subcontract...'); - const res = await icu.doTheThing.call({ from: account }); - assert.isTrue(res); - }); -}); diff --git a/ts-tests/frontier-tester/tests/testLockdrop.js b/ts-tests/frontier-tester/tests/testLockdrop.js deleted file mode 100644 index e8497c53..00000000 --- a/ts-tests/frontier-tester/tests/testLockdrop.js +++ /dev/null @@ -1,131 +0,0 @@ -const Lockdrop = require("../build/contracts/Lockdrop.json"); -const utility = require('../helpers/lockdropWeb3Util'); -const rlp = require('rlp'); -const keccak = require('keccak'); -const { assert } = require('chai'); -const contract = require("@truffle/contract"); -const { account, describeWithEdgeware } = require('../helpers/utils'); - -describeWithEdgeware("Lockdrop test", async (context) => { - const SECONDS_IN_DAY = 86400; - const THREE_MONTHS = 0; - const SIX_MONTHS = 1; - const TWELVE_MONTHS = 2; - let LD; - let web3; - - before(async function() { - web3 = context.web3; - - LD = contract({ - abi: Lockdrop.abi, - unlinked_binary: Lockdrop.bytecode, - }); - LD.setProvider(web3.currentProvider); - }); - - it('should setup and pull constants', async function () { - let time = await utility.getCurrentTimestamp(web3); - let lockdrop = await LD.new(time, { from: account }); - const LOCK_DROP_PERIOD = (await lockdrop.LOCK_DROP_PERIOD.call({ from: account })).toNumber(); - const LOCK_START_TIME = (await lockdrop.LOCK_START_TIME.call({ from: account })).toNumber(); - time = await utility.getCurrentTimestamp(web3); - assert.equal(LOCK_DROP_PERIOD, SECONDS_IN_DAY * 92); - assert.ok(LOCK_START_TIME <= time && time <= LOCK_START_TIME + 1000); - }); - - it('ensure the contract address matches JS RLP script', async function () { - let time = await utility.getCurrentTimestamp(web3); - let lockdrop = await LD.new(time, { from: account }); - const sender = account; - const nonce = (await web3.eth.getTransactionCount(sender)); - const input = [ sender, nonce - 1 ]; - const rlpEncoded = rlp.encode(input); - const contractAddressLong = keccak('keccak256').update(rlpEncoded).digest('hex'); - const contractAddr = contractAddressLong.substring(24); - - time = await utility.getCurrentTimestamp(web3); - assert.equal(web3.utils.toBN(lockdrop.address).toString(), web3.utils.toBN(contractAddr).toString()); - }); - - // Events don't work - it('should lock funds and increment nonce', async function () { - let time = await utility.getCurrentTimestamp(web3); - let lockdrop = await LD.new(time, { from: account }); - - let startNonce = await web3.eth.getTransactionCount(lockdrop.address); - assert.equal(startNonce, '1', 'start nonce of deployed contract should be 1'); - - let senderBalance = new web3.utils.BN(await web3.eth.getBalance(account)); - - const bcontractAddr1 = getContractAddress(lockdrop.address, startNonce); - const bcontractAddr2 = getContractAddress(lockdrop.address, startNonce + 1) - const bcontractAddr3 = getContractAddress(lockdrop.address, startNonce + 2); - const bcontractAddr4 = getContractAddress(lockdrop.address, startNonce + 3); - - const value = web3.utils.toWei('10', 'ether'); - - await lockdrop.lock(THREE_MONTHS, account, true, { - from: account, - value: value, - gas: 1500000, - gasPrice: 1000, - }); - - let balLock1 = await web3.eth.getBalance(bcontractAddr1); - let balLock2 = await web3.eth.getBalance(bcontractAddr2); - let balLock3 = await web3.eth.getBalance(bcontractAddr3); - let balLock4 = await web3.eth.getBalance(bcontractAddr4); - - assert.equal(value.toString(), balLock1, 'balance of first lock does not match expected'); - assert.equal(0, balLock2, 'balance of future second lock does not match expected'); - assert.equal(0, balLock3, 'balance of future third lock does not match expected'); - assert.equal(0, balLock4, 'balance of future fourth lock does not match expected'); - - let senderBalanceAfter = new web3.utils.BN(await web3.eth.getBalance(account)); - let sentBalance = senderBalance.sub(senderBalanceAfter); - assert.isTrue(sentBalance.gt(new web3.utils.BN(value)), 'sent balance should be greater than lock value'); - - const nonce = (await web3.eth.getTransactionCount(lockdrop.address)); - const contractAddr = getContractAddress(lockdrop.address, nonce - 1); - assert.equal(nonce, '2', 'contract nonce of Lockdrop contract should be 2 after lock') - - const bal0 = await web3.eth.getBalance(contractAddr); - - assert.equal(bal0, value, 'Lock value at address should be 10 eth after lock'); - - const value2 = web3.utils.toWei('100', 'ether'); - - await lockdrop.lock(THREE_MONTHS, account, true, { - from: account, - value: value2, - gas: 1500000, - gasPrice: 1000000000, - }); - - const new_nonce = (await web3.eth.getTransactionCount(lockdrop.address)); - const new_contractAddr = getContractAddress(lockdrop.address, new_nonce - 1); - const bal2 = await web3.eth.getBalance(new_contractAddr); - - assert.equal(bal2, value2, '2nd lock value should be non zero after lock'); - assert.equal(new_nonce - 1, nonce, 'nonce should increment'); - - balLock1 = await web3.eth.getBalance(bcontractAddr1); - balLock2 = await web3.eth.getBalance(bcontractAddr2); - balLock3 = await web3.eth.getBalance(bcontractAddr3); - balLock4 = await web3.eth.getBalance(bcontractAddr4); - - assert.equal(value.toString(), balLock1, 'balance of first lock does not match expected'); - assert.equal(value2.toString(), balLock2, 'balance of second lock does not match expected'); - assert.equal(0, balLock3, 'balance of future third lock does not match expected'); - assert.equal(0, balLock4, 'balance of future fourth lock does not match expected'); - }); -}); - -function getContractAddress(address, nonce) { - const input = [address, nonce] - const rlpEncoded = rlp.encode(input); - const contractAddressLong = keccak('keccak256').update(rlpEncoded).digest('hex'); - const contractAddr = contractAddressLong.substring(24); - return contractAddr; -} \ No newline at end of file diff --git a/ts-tests/frontier-tester/tests/testOwner.js b/ts-tests/frontier-tester/tests/testOwner.js deleted file mode 100644 index bc9bf314..00000000 --- a/ts-tests/frontier-tester/tests/testOwner.js +++ /dev/null @@ -1,39 +0,0 @@ -const { assert } = require('chai'); -const OwnerContract = require('../build/contracts/OwnerContract.json'); -const contract = require("@truffle/contract"); -const { account, describeWithEdgeware } = require('../helpers/utils'); - -describeWithEdgeware("OwnerContract test", async (context) => { - let OC; - let web3; - - before(async function() { - web3 = context.web3; - - OCDeploy = contract({ - abi: OwnerContract.abi, - unlinked_binary: OwnerContract.bytecode, - }); - OCDeploy.setProvider(web3.currentProvider); - OC = await OCDeploy.new({ from: account }); - }); - - it("should have owner", async () => { - let result = await OC.makeCall({ - from: account, - }); - assert.isTrue(result); - }); - - it("should fail with wrong owner", async () => { - // NOTE: this will fail, because the error will be: - // { code: -32603, message: 'inner executing call failed' } - // rather than a revert! - try { - await OC.makeCall({ from: '0xF8cef78E923919054037a1D03662bBD884fF4edf' }); - assert.fail('should throw'); - } catch (e) { - - } - }); -}); diff --git a/ts-tests/frontier-tester/tests/testPrecompiles.js b/ts-tests/frontier-tester/tests/testPrecompiles.js deleted file mode 100644 index 020a98f5..00000000 --- a/ts-tests/frontier-tester/tests/testPrecompiles.js +++ /dev/null @@ -1,67 +0,0 @@ -const { assert } = require('chai'); -const contract = require("@truffle/contract"); -const { account, describeWithEdgeware } = require('../helpers/utils'); - -describeWithEdgeware('Precompiles test', async (context) => { - let web3; - - before(async () => { - web3 = context.web3; - }); - - it('should perform identity directly', async () => { - const message = '0x1234567890' - const callResult = await web3.eth.call({ - to: '0000000000000000000000000000000000000004', - from: account, - data: message, - }); - assert.equal(callResult, message); - }); - - // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-198.md - it('should perform modexp directly', async () => { - // 3**(2**256 - 2**32 - 978) % (2**256 - 2**32 - 977) = 1 - const message = '0x0000000000000000000000000000000000000000000000000000000000000001' - + '0000000000000000000000000000000000000000000000000000000000000020' - + '0000000000000000000000000000000000000000000000000000000000000020' - + '03' - + 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e' - + 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'; - const callResult = await web3.eth.call({ - to: '0000000000000000000000000000000000000005', - from: account, - data: message, - }); - const localResult = '0x0000000000000000000000000000000000000000000000000000000000000001'; - assert.equal(callResult, localResult); - }); - - it('should perform ed25519verify directly', async () => { - // 'test' + //Alice pubkey + sig, generated via subkey - const message = '0x0000000000000000000000000000000000000000000000000000000074657374' - + '88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee' - + '6c92140653922643b059e25a8ea5007baecc4a84dd3baa0b2c3aa62d44aea0393d70d860f6a6d5266cdd62160a971917f257603de3d8d0218681753caadae204'; - const callResult = await web3.eth.call({ - to: '0000000000000000000000000000000000000006', - from: account, - data: message, - }); - const localResult = '0x00000000'; - assert.equal(callResult, localResult); - }); - - it('should perform invalid ed25519verify directly', async () => { - // invalid test - const message = '0x0000000000000000000000000000000000000000000000000000000074657375' - + '88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee' - + '003d4e3fca386deff58df1d86f8bb490d3204e14d14ef5e51af03e34b72f7abea34ec295d6a0c055388e521c91f60b25e5199ec5d4c2c1af433ac040a75d8f0a'; - const callResult = await web3.eth.call({ - to: '0000000000000000000000000000000000000006', - from: account, - data: message, - }); - const localResult = '0x00000001'; - assert.equal(callResult, localResult); - }) -}); diff --git a/ts-tests/frontier-tester/tests/testSubstrateBalances.ts b/ts-tests/frontier-tester/tests/testSubstrateBalances.ts deleted file mode 100644 index f12227fc..00000000 --- a/ts-tests/frontier-tester/tests/testSubstrateBalances.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { ApiPromise, WsProvider, Keyring } from '@polkadot/api'; -import { KeyringPair } from '@polkadot/keyring/types'; -import Web3 from 'web3'; -import { assert } from 'chai'; -const { convertToEvmAddress, convertToSubstrateAddress, describeWithEdgeware } = require('../helpers/utils.js'); -import BN from 'bn.js'; -import { spec } from '@edgeware/node-types'; -import { TypeRegistry } from '@polkadot/types'; - -describeWithEdgeware('Substrate <> EVM balances test', async (context) => { - let web3: Web3; - let web3Url: string; - let api: ApiPromise; - let id: number; - let keyring: KeyringPair; - let address: string; - let evmAddress: string; - let substrateEvmAddress: string; - const FEE_ACCURACY = 10000; - - const value = new BN('10000000000000000000'); - - // returns the fee - let sendSubstrateBalance = async (v: BN, addr = substrateEvmAddress): Promise => { - return new Promise(async (resolve) => { - const tx = api.tx.balances.transfer(addr, v); - const { partialFee } = await tx.paymentInfo(keyring); - tx.signAndSend(keyring, (result) => { - if (result.isError) { - assert.fail('tx failure'); - } - if (result.isCompleted) { - resolve(partialFee); - } - }); - }) - } - - const fetchBalance = async (acct: string): Promise => { - const res = await api.query.system.account(acct); - return res.data.free; - } - - before(async () => { - // init web3 - web3Url = 'http://localhost:9933'; - web3 = new Web3(web3Url); - id = await web3.eth.net.getId(); - assert.equal(id, 2021); - - // init polkadot - const polkadotUrl = 'ws://localhost:9944'; - api = await ApiPromise.create({ - provider: new WsProvider(polkadotUrl), - ...spec, - }); - const { ss58Format } = await api.rpc.system.properties(); - const substrateId = +ss58Format.unwrap(); - - // init addresses - keyring = new Keyring({ ss58Format: substrateId, type: 'sr25519' }).addFromUri('//Alice'); - address = keyring.address; - evmAddress = convertToEvmAddress(address); - substrateEvmAddress = convertToSubstrateAddress(evmAddress); - }); - - after(async () => { - if (api) { - await api.disconnect(); - } - }); - - it('should fund account via transfer', async () => { - // query start balances - const web3StartBalance = await web3.eth.getBalance(evmAddress); - const polkadotStartBalance = await fetchBalance(address); - const evmSubstrateStartBalance = await fetchBalance(substrateEvmAddress); - - assert.isTrue(polkadotStartBalance.gt(value), 'sender account must have sufficient balance'); - assert.equal(web3StartBalance, evmSubstrateStartBalance.toString(), 'substrate balance does not match web3 balance'); - - let fees = await sendSubstrateBalance(value); - - // query final balances - const polkadotEndBalance = await fetchBalance(address); - const evmSubstrateEndBalance = await fetchBalance(substrateEvmAddress); - const web3EndBalance = await web3.eth.getBalance(evmAddress); - - assert.equal( - polkadotEndBalance.divn(FEE_ACCURACY).toString(), - polkadotStartBalance.sub(value).sub(fees).divn(FEE_ACCURACY).toString(), - 'incorrect sender account balance' - ); - assert.equal(web3EndBalance, evmSubstrateEndBalance.toString(), 'substrate balance does not match web3 balance'); - assert.equal(evmSubstrateEndBalance.toString(), evmSubstrateStartBalance.add(value).toString(), 'incorrect web3 account balance'); - }); - - it('should withdraw via evm pallet', async () => { - // ensure the evm account has balance - await sendSubstrateBalance(value.clone().muln(2)); - - // query start balances - const web3StartBalance = await web3.eth.getBalance(evmAddress); - const polkadotStartBalance = await fetchBalance(address); - const evmSubstrateStartBalance = await fetchBalance(substrateEvmAddress); - assert.isTrue(evmSubstrateStartBalance.gt(value), 'evm account must have sufficient balance'); - assert.equal(web3StartBalance, evmSubstrateStartBalance.toString(), 'substrate balance does not match web3 balance'); - - // execute withdraw - const fees: BN = await new Promise(async (resolve) => { - const tx = api.tx.evm.withdraw(evmAddress, value); - const { partialFee } = await tx.paymentInfo(keyring); - return tx.signAndSend(keyring, (result) => { - if (result.isError) { - assert.fail('tx failure'); - } - if (result.isCompleted) { - resolve(partialFee); - } - }); - }); - - // query end balances - const polkadotEndBalance = await fetchBalance(address); - const evmSubstrateEndBalance = await fetchBalance(substrateEvmAddress); - const web3EndBalance = await web3.eth.getBalance(evmAddress); - - assert.equal(polkadotEndBalance.toString(), polkadotStartBalance.add(value).sub(fees).toString(), 'incorrect sender account balance'); - assert.equal(web3EndBalance, evmSubstrateEndBalance.toString(), 'substrate balance does not match web3 balance'); - assert.equal(evmSubstrateEndBalance.toString(), evmSubstrateStartBalance.sub(value).toString(), 'incorrect web3 account balance'); - - }); - - it('should update substrate balances from web3 tx', async () => { - // start with an EVM account with a known private key - const privKey = '99B3C12287537E38C90A9219D4CB074A89A16E9CDB20BF85728EBD97C343E343'; - const web3 = context.web3; - web3.eth.accounts.wallet.add(privKey); - web3.eth.defaultAccount = web3.eth.accounts.wallet[0].address; - const senderAddress = web3.eth.accounts.wallet[0].address; - const senderSubstrateAddress: string = convertToSubstrateAddress(senderAddress, id); - - // give the EVM account some balance to send back via web3 - await sendSubstrateBalance(value.clone().muln(2), senderSubstrateAddress); - - // query start balances - const web3StartBalance = await web3.eth.getBalance(evmAddress); - const senderWeb3StartBalance = await web3.eth.getBalance(senderAddress); - const senderEvmSubstrateStartBalance = await fetchBalance(senderSubstrateAddress); - assert.isTrue(web3.utils.toBN(senderWeb3StartBalance).gt(value), 'evm account must have sufficient balance'); - assert.equal(senderWeb3StartBalance, senderEvmSubstrateStartBalance.toString(), 'substrate balance does not match web3 balance'); - - // perform web3 call, send value back to the original substrate/alice account - const receipt = await web3.eth.sendTransaction({ - from: senderAddress, - to: evmAddress, - value: value.toString(), - gas: '1000000', - gasPrice: '1', - }); - // const gasUsed = web3.utils.toBN(web3.utils.toWei(`${receipt.gasUsed}`, 'gwei')); - const gasUsed = web3.utils.toBN(`${receipt.gasUsed}`); - - // verify end balances - const web3EndBalance = await web3.eth.getBalance(evmAddress); - const evmSubstrateEndBalance = await fetchBalance(substrateEvmAddress); - const senderWeb3EndBalance = await web3.eth.getBalance(senderAddress); - const senderEvmSubstrateEndBalance = await fetchBalance(senderSubstrateAddress); - assert.equal(senderWeb3EndBalance, senderEvmSubstrateEndBalance.toString(), 'sender substrate balance does not match web3 balance'); - assert.equal(senderWeb3EndBalance, (web3.utils.toBN(senderWeb3StartBalance).sub(value)).sub(gasUsed).toString(), 'incorrect web3 sender balance'); - assert.equal(web3EndBalance, web3.utils.toBN(web3StartBalance).add(value).toString(), 'incorrect web3 recipient balance'); - assert.equal(web3EndBalance, evmSubstrateEndBalance.toString(), 'recipient substrate balance does not match web3 balance') - }); -}); diff --git a/ts-tests/frontier-tester/tests/testSubstrateFeatures.ts b/ts-tests/frontier-tester/tests/testSubstrateFeatures.ts deleted file mode 100644 index 28f45e30..00000000 --- a/ts-tests/frontier-tester/tests/testSubstrateFeatures.ts +++ /dev/null @@ -1,209 +0,0 @@ -import { ApiPromise, WsProvider } from '@polkadot/api'; -import { KeyringPair } from '@polkadot/keyring/types'; -import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs'; -import { u8aToString } from '@polkadot/util'; -import { assert } from 'chai'; -import { spec } from '@edgeware/node-types'; -import { TypeRegistry } from '@polkadot/types'; -import BN from 'bn.js'; -import { SubmittableExtrinsic } from '@polkadot/api/types'; -const { describeWithEdgeware } = require('../helpers/utils.js'); - -describeWithEdgeware('Upgrade Tests', async (context) => { - let api: ApiPromise; - let pairs: TestKeyringMap; - const FEE_ACCURACY = 10000; - - before(async () => { - const polkadotUrl = 'ws://localhost:9944'; - const provider = new WsProvider(polkadotUrl); - api = await ApiPromise.create({ - provider, - ...spec, - }); - pairs = createTestPairs(); - }); - - after(async () => { - if (api) { - await api.disconnect(); - } - }); - - const submitTxWithFee = async (tx: SubmittableExtrinsic<'promise'>, from: KeyringPair): Promise => { - return new Promise(async (resolve) => { - const { partialFee } = await tx.paymentInfo(from); - tx.signAndSend(from, (result) => { - if (result.isError) { - assert.fail('tx failure'); - } - if (result.isCompleted) { - resolve(partialFee); - } - }); - }) - } - - const fetchBalance = async (acct: string): Promise => { - const res = await api.query.system.account(acct); - return res.data.free; - } - - it('should transfer balances', async () => { - const charlie = pairs.charlie; - const dave = pairs.dave; - const charlieStartBal = await fetchBalance(charlie.address); - const daveStartBal = await fetchBalance(dave.address); - - // send funds from charlie to dave - const value = new BN('10000000000000000000'); - const tx = api.tx.balances.transfer(dave.address, value); - const fees = await submitTxWithFee(tx, charlie); - - // verify results - const charlieEndBal = await fetchBalance(charlie.address); - const daveEndBal = await fetchBalance(dave.address); - assert.equal(daveStartBal.add(value).toString(), daveEndBal.toString()); - assert.equal( - charlieStartBal.sub(value).sub(fees).divn(FEE_ACCURACY).toString(), - charlieEndBal.divn(FEE_ACCURACY).toString() - ); - }); - - it('should create and second democracy proposal', async () => { - const charlie = pairs.charlie; - const dave = pairs.dave; - const value = api.consts.democracy.minimumDeposit; - const propCount = await api.query.democracy.publicPropCount(); - - // generate an arbitrary tx to propose - const proposalFunc = api.tx.system.fillBlock(+propCount); - - // submit proposal and verify - const tx = api.tx.democracy.propose(proposalFunc.method.hash, value); - await submitTxWithFee(tx, charlie); - const proposals = await api.query.democracy.publicProps(); - const proposal = proposals.find(([idx, hash, submitter]) => +idx === +propCount - && hash.toString() === proposalFunc.method.hash.toString() - && submitter.toString() === charlie.address - ); - assert.isTrue(!!proposal); - - // submit associated preimage - const preimageTx = api.tx.democracy.notePreimage(proposalFunc.method.toHex()); - await submitTxWithFee(preimageTx, charlie); - const preimage = await api.query.democracy.preimages(proposalFunc.method.hash); - assert.isTrue(preimage.isSome); - assert.isTrue(preimage.unwrap().isAvailable); - assert.equal(preimage.unwrap().asAvailable.provider.toString(), charlie.address); - - // second it - const voters = await api.query.democracy.depositOf(+propCount); - const secondTx = api.tx.democracy.second(+propCount, voters.unwrap()[0].length); - await submitTxWithFee(secondTx, dave); - const newVoters = await api.query.democracy.depositOf(+propCount); - assert.isTrue(newVoters.isSome); - assert.isTrue(newVoters.unwrap()[0].map((c) => c.toString()).includes(charlie.address)); - assert.isTrue(newVoters.unwrap()[0].map((c) => c.toString()).includes(dave.address)); - }); - - it('should create treasury proposal', async () => { - // setup args - const bob = pairs.bob; - const startBal = await fetchBalance(bob.address); - const value = new BN('10000000000000000000'); - const beneficiary = pairs.alice.address; - const bondPermill = api.consts.treasury.proposalBond; - const bondMinimum = api.consts.treasury.proposalBondMinimum; - const bondFromPct = value.mul(bondPermill).divn(1_000_000); - const bond = BN.max(bondFromPct, bondMinimum); - - // make transaction - const tx = api.tx.treasury.proposeSpend(value, beneficiary); - const fee = await submitTxWithFee(tx, bob); - - // fetch result on success - const endBal = await fetchBalance(bob.address); - const proposalCount = await api.query.treasury.proposalCount(); - const proposal = await api.query.treasury.proposals(proposalCount.subn(1)); - - // verify results - assert.equal((startBal.sub(bond)).sub(fee).toString(), endBal.toString()); - assert.isTrue(proposal.isSome); - assert.equal(proposal.unwrap().beneficiary.toString(), beneficiary); - assert.equal(proposal.unwrap().value.toString(), value.toString()); - assert.equal(proposal.unwrap().proposer.toString(), bob.address); - assert.equal(proposal.unwrap().bond.toString(), bond.toString()); - }); - - it('should apply for council', async () => { - const bob = pairs.bob; - const candidates = await api.query.elections.candidates(); - const submitCandidacyTx = api.tx.elections.submitCandidacy(candidates.length); - await submitTxWithFee(submitCandidacyTx, bob); - const newCandidates = await api.query.elections.candidates(); - assert.isTrue(newCandidates.map((c) => c.toString()).includes(bob.address)); - }); - - it('should register an identity', async () => { - const bob = pairs.bob; - const name = 'i am bob'; - const identityInfo = api.createType('IdentityInfo', { - additional: [], - display: { raw: name }, - legal: { none: null }, - web: { none: null }, - riot: { none: null }, - email: { none: null }, - image: { none: null }, - twitter: { none: null }, - }); - const tx = api.tx.identity.setIdentity(identityInfo) - await submitTxWithFee(tx, bob); - const identity = await api.query.identity.identityOf(bob.address); - assert.isTrue(identity.isSome); - assert.equal(u8aToString(identity.unwrap().info.display.toU8a()).replace(/[^\x20-\x7E]/g, ''), name); - }); - -/* - it('should deploy WASM', async () => { - // deploy a contract - const eve = pairs.eve; - const json = fs.readFileSync(`${__dirname}/../helpers/flipper.json`, { encoding: 'utf8' }); - const wasm = fs.readFileSync(`${__dirname}/../helpers/flipper.wasm`); - - // create the contract blueprint - const code = new CodePromise(api, json, wasm); - const blueprint: BlueprintPromise = await new Promise((resolve) => { - code.createBlueprint().signAndSend(eve, (res) => { - if (res.isCompleted) { - resolve(res.blueprint); - } - }); - }); - assert.isTrue(!!blueprint); - - // deploy a contract - const value = new BN('1230000000000'); - const gasLimit = new BN('100000000000'); - const contract: ContractPromise = await new Promise((resolve, reject) => { - blueprint.createContract('new', value, gasLimit, true).signAndSend(eve, (res) => { - if (res.dispatchError) { - if (res.dispatchError.isModule) { - const details = api.registry.findMetaError(res.dispatchError.asModule.toU8a()); - console.error(`${details.section}::${details.name}: ${details.documentation[0]}`); - } - reject(res.dispatchError); - } else if (res.isCompleted) { - resolve(res.contract); - } - }) - }); - - // verify the contract flipped the value - const getResult = await contract.query.get(eve.address, value, gasLimit); - assert.isTrue(getResult.result.isOk); - assert.isTrue((getResult.result.value as bool).isFalse); - }); -*/ -}); diff --git a/ts-tests/frontier-tester/tests/testTime.js b/ts-tests/frontier-tester/tests/testTime.js deleted file mode 100644 index 7a39f856..00000000 --- a/ts-tests/frontier-tester/tests/testTime.js +++ /dev/null @@ -1,45 +0,0 @@ -const { assert } = require("chai"); -const TimeContract = require("../build/contracts/TimeContract.json"); -const { account, describeWithEdgeware } = require('../helpers/utils'); -const contract = require("@truffle/contract"); - -const BLOCK_TIME_MS = 6000; - -function timeout(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} - -function blockTimeifyDate(n) { - return Math.floor(n / BLOCK_TIME_MS) * (BLOCK_TIME_MS / 1000); -} - -describeWithEdgeware("TimeContract test", async (context) => { - it("should be testable", async () => { - const web3 = context.web3; - let Time = contract({ - abi: TimeContract.abi, - unlinked_binary: TimeContract.bytecode, - }); - Time.setProvider(web3.currentProvider); - - let t = await Time.new({ from: account }); - await t.timeBeforeEnd({ from: account, gasPrice: 1000000000 }); - - // fetch initial values - let now = await t.viewNow.call({ from: account }); - let dNow = blockTimeifyDate(Date.now()).toString(); - assert.equal(dNow, now.toString()); - - // wait a block - await timeout(BLOCK_TIME_MS); - const now2 = await t.viewNow.call({ from: account }); - dNow = blockTimeifyDate(Date.now()).toString(); - assert.equal(dNow, now2.toString()); - - // wait a block - await timeout(BLOCK_TIME_MS); - const now3 = await t.viewNow.call({ from: account }); - dNow = blockTimeifyDate(Date.now()).toString(); - assert.equal(dNow, now3.toString()); - }); -}); diff --git a/ts-tests/frontier-tester/tests/testValue.js b/ts-tests/frontier-tester/tests/testValue.js deleted file mode 100644 index 9bb79845..00000000 --- a/ts-tests/frontier-tester/tests/testValue.js +++ /dev/null @@ -1,64 +0,0 @@ -const { assert } = require('chai'); -const ValueContract = require('../build/contracts/ValueContract.json'); -const { account, describeWithEdgeware } = require('../helpers/utils'); -const contract = require("@truffle/contract"); - -describeWithEdgeware("ValueContract test", async (context) => { - it("should have value", async () => { - const web3 = context.web3; - const gasPrice = web3.utils.toWei("1", 'gwei'); - let Value = contract({ - abi: ValueContract.abi, - unlinked_binary: ValueContract.bytecode, - }); - Value.setProvider(web3.currentProvider); - - const BN = web3.utils.BN; - let balance = await web3.eth.getBalance(account); - let c = await Value.new({ from: account, gasPrice }); - let createReceipt = await web3.eth.getTransactionReceipt(c.transactionHash); - let createGasUsed = web3.utils.toWei(`${createReceipt.gasUsed}`, 'gwei'); - let valueStored = await c.getValue.call({ from: account }); - - assert.equal(valueStored, '0'); - const valueToSend = web3.utils.toWei('1', 'ether'); - const tx = await c.sendValue({ value: valueToSend, from: account, gasPrice }); - const txGasUsed = web3.utils.toWei(`${tx.receipt.gasUsed}`, 'gwei'); - const updatedValue = await c.getValue.call({ from: account }); - const updatedBalance = await web3.eth.getBalance(account); - const totalSpent = (new BN(valueToSend)).add(new BN(createGasUsed)).add(new BN(txGasUsed)); - assert.equal(updatedValue.toString(), (new BN(valueStored)).add(new BN(valueToSend)).toString(), "contract value wrong"); - assert.equal(updatedBalance.toString(), (new BN(balance)).sub(totalSpent).toString(), "account balance wrong"); - }); - - - it("should setup ValueContract with non-zero value", async () => { - const web3 = context.web3; - const gasPrice = web3.utils.toWei("1", 'gwei'); - let Value = contract({ - abi: ValueContract.abi, - unlinked_binary: ValueContract.bytecode, - }); - Value.setProvider(web3.currentProvider); - - const BN = web3.utils.BN; - let balance = await web3.eth.getBalance(account); - - const initialSendValue = web3.utils.toWei('1', 'ether'); - let c = await Value.new({ from: account, value: initialSendValue, gasPrice }); - let createReceipt = await web3.eth.getTransactionReceipt(c.transactionHash); - let createGasUsed = web3.utils.toWei(`${createReceipt.gasUsed}`, 'gwei'); - let valueStored = await c.getValue.call({ from: account }); - - assert.equal(valueStored, web3.utils.toWei('1', 'ether')); - const valueToSend = web3.utils.toWei('1', 'ether'); - const tx = await c.sendValue({ value: valueToSend, from: account, gasPrice }); - const txGasUsed = web3.utils.toWei(`${tx.receipt.gasUsed}`, 'gwei'); - const updatedBalance = await web3.eth.getBalance(account); - const updatedValue = await c.getValue.call({ from: account }); - const totalValueSent = (new BN(initialSendValue)).add(new BN(valueToSend)); - const totalSpent = (new BN(createGasUsed)).add(new BN(txGasUsed)).add(totalValueSent); - assert.equal(updatedValue.toString(), (new BN(valueStored)).add(new BN(valueToSend)).toString(), "contract value wrong"); - assert.equal(updatedBalance.toString(), (new BN(balance)).sub(totalSpent).toString(), "account balance wrong"); - }); -}); diff --git a/ts-tests/frontier-tester/truffle-config.js b/ts-tests/frontier-tester/truffle-config.js deleted file mode 100644 index 991ecca2..00000000 --- a/ts-tests/frontier-tester/truffle-config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - compilers: { - solc: { - version: "=0.5.16" - } - }, -} diff --git a/ts-tests/frontier-tester/tsconfig.json b/ts-tests/frontier-tester/tsconfig.json deleted file mode 100644 index 5382b83c..00000000 --- a/ts-tests/frontier-tester/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "resolveJsonModule": true - } -} \ No newline at end of file diff --git a/ts-tests/frontier-tester/yarn.lock b/ts-tests/frontier-tester/yarn.lock deleted file mode 100644 index c595f662..00000000 --- a/ts-tests/frontier-tester/yarn.lock +++ /dev/null @@ -1,6044 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/helper-module-imports@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz#4c5c54be04bd31670a7382797d75b9fa2e5b5620" - integrity sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw== - dependencies: - "@babel/types" "^7.10.4" - -"@babel/helper-plugin-utils@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" - integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== - -"@babel/helper-validator-identifier@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" - integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== - -"@babel/plugin-transform-runtime@^7.5.5": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.11.0.tgz#e27f78eb36f19448636e05c33c90fd9ad9b8bccf" - integrity sha512-LFEsP+t3wkYBlis8w6/kmnd6Kb1dxTd+wGJ8MlxTGzQo//ehtqlVL4S9DNUa53+dtPSQobN2CXx4d81FqC58cw== - dependencies: - "@babel/helper-module-imports" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" - resolve "^1.8.1" - semver "^5.5.1" - -"@babel/runtime@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" - integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg== - dependencies: - regenerator-runtime "^0.13.4" - -"@babel/runtime@^7.5.5": - version "7.11.2" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736" - integrity sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw== - dependencies: - regenerator-runtime "^0.13.4" - -"@babel/types@^7.10.4": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.0.tgz#2ae6bf1ba9ae8c3c43824e5861269871b206e90d" - integrity sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA== - dependencies: - "@babel/helper-validator-identifier" "^7.10.4" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - -"@edgeware/node-types@^3.1.0-beta.14": - version "3.1.0-beta.14" - resolved "https://registry.yarnpkg.com/@edgeware/node-types/-/node-types-3.1.0-beta.14.tgz#d55b01c5bcc5e5201d74a4259258aece5f3fcc07" - integrity sha512-Iz7nzUnNbAw46aAfVwioceNsaT0DKTJUqrDsILY/7lXCZeclaibyXuHghBkCHRSDnztYxCG/8gfjyHH6+s16rQ== - -"@ethersproject/abi@5.0.0-beta.153": - version "5.0.0-beta.153" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz#43a37172b33794e4562999f6e2d555b7599a8eee" - integrity sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg== - dependencies: - "@ethersproject/address" ">=5.0.0-beta.128" - "@ethersproject/bignumber" ">=5.0.0-beta.130" - "@ethersproject/bytes" ">=5.0.0-beta.129" - "@ethersproject/constants" ">=5.0.0-beta.128" - "@ethersproject/hash" ">=5.0.0-beta.128" - "@ethersproject/keccak256" ">=5.0.0-beta.127" - "@ethersproject/logger" ">=5.0.0-beta.129" - "@ethersproject/properties" ">=5.0.0-beta.131" - "@ethersproject/strings" ">=5.0.0-beta.130" - -"@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.0": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.0.2.tgz#80d0ddfb7d4bd0d32657747fa4bdd2defef2e00a" - integrity sha512-+rz26RKj7ujGfQynys4V9VJRbR+wpC6eL8F22q3raWMH3152Ha31GwJPWzxE/bEA+43M/zTNVwY0R53gn53L2Q== - dependencies: - "@ethersproject/bignumber" "^5.0.0" - "@ethersproject/bytes" "^5.0.0" - "@ethersproject/keccak256" "^5.0.0" - "@ethersproject/logger" "^5.0.0" - "@ethersproject/rlp" "^5.0.0" - bn.js "^4.4.0" - -"@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.0": - version "5.0.5" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.0.5.tgz#31bd7e75aad46ace345fae69b1f5bb120906af1b" - integrity sha512-24ln7PV0g8ZzjcVZiLW9Wod0i+XCmK6zKkAaxw5enraTIT1p7gVOcSXFSzNQ9WYAwtiFQPvvA+TIO2oEITZNJA== - dependencies: - "@ethersproject/bytes" "^5.0.0" - "@ethersproject/logger" "^5.0.0" - bn.js "^4.4.0" - -"@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.0": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.0.3.tgz#b3769963ae0188a35713d343890a903bda20af9c" - integrity sha512-AyPMAlY+Amaw4Zfp8OAivm1xYPI8mqiUYmEnSUk1CnS2NrQGHEMmFJFiOJdS3gDDpgSOFhWIjZwxKq2VZpqNTA== - dependencies: - "@ethersproject/logger" "^5.0.0" - -"@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.0": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.0.2.tgz#f7ac0b320e2bbec1a5950da075015f8bc4e8fed1" - integrity sha512-nNoVlNP6bgpog7pQ2EyD1xjlaXcy1Cl4kK5v1KoskHj58EtB6TK8M8AFGi3GgHTdMldfT4eN3OsoQ/CdOTVNFA== - dependencies: - "@ethersproject/bignumber" "^5.0.0" - -"@ethersproject/hash@>=5.0.0-beta.128": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.0.2.tgz#6d69558786961836d530b8b4a8714eac5388aec7" - integrity sha512-dWGvNwmVRX2bxoQQ3ciMw46Vzl1nqfL+5R8+2ZxsRXD3Cjgw1dL2mdjJF7xMMWPvPdrlhKXWSK0gb8VLwHZ8Cw== - dependencies: - "@ethersproject/bytes" "^5.0.0" - "@ethersproject/keccak256" "^5.0.0" - "@ethersproject/logger" "^5.0.0" - "@ethersproject/strings" "^5.0.0" - -"@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.0": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.0.2.tgz#7ed4a95bb45ee502cf4532223833740a83602797" - integrity sha512-MbroXutc0gPNYIrUjS4Aw0lDuXabdzI7+l7elRWr1G6G+W0v00e/3gbikWkCReGtt2Jnt4lQSgnflhDwQGcIhA== - dependencies: - "@ethersproject/bytes" "^5.0.0" - js-sha3 "0.5.7" - -"@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.0": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.0.4.tgz#09fa4765b5691233e3afb6617cb38a700f9dd2e4" - integrity sha512-alA2LiAy1LdQ/L1SA9ajUC7MvGAEQLsICEfKK4erX5qhkXE1LwLSPIzobtOWFsMHf2yrXGKBLnnpuVHprI3sAw== - -"@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.0": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.0.2.tgz#2facb62d2f2d968c7b3d0befa5bcc884cc565d3b" - integrity sha512-FxAisPGAOACQjMJzewl9OJG6lsGCPTm5vpUMtfeoxzAlAb2lv+kHzQPUh9h4jfAILzE8AR1jgXMzRmlhwyra1Q== - dependencies: - "@ethersproject/logger" "^5.0.0" - -"@ethersproject/rlp@^5.0.0": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.0.2.tgz#d6b550a2ac5e484f15f0f63337e522004d2e78cd" - integrity sha512-oE0M5jqQ67fi2SuMcrpoewOpEuoXaD8M9JeR9md1bXRMvDYgKXUtDHs22oevpEOdnO2DPIRabp6MVHa4aDuWmw== - dependencies: - "@ethersproject/bytes" "^5.0.0" - "@ethersproject/logger" "^5.0.0" - -"@ethersproject/signing-key@^5.0.0": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.0.3.tgz#adb84360e147bfd336cb2fe114100120732dc10a" - integrity sha512-5QPZaBRGCLzfVMbFb3LcVjNR0UbTXnwDHASnQYfbzwUOnFYHKxHsrcbl/5ONGoppgi8yXgOocKqlPCFycJJVWQ== - dependencies: - "@ethersproject/bytes" "^5.0.0" - "@ethersproject/logger" "^5.0.0" - "@ethersproject/properties" "^5.0.0" - elliptic "6.5.3" - -"@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.0": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.0.2.tgz#1753408c3c889813fd0992abd76393e3e47a2619" - integrity sha512-oNa+xvSqsFU96ndzog0IBTtsRFGOqGpzrXJ7shXLBT7juVeSEyZA/sYs0DMZB5mJ9FEjHdZKxR/rTyBY91vuXg== - dependencies: - "@ethersproject/bytes" "^5.0.0" - "@ethersproject/constants" "^5.0.0" - "@ethersproject/logger" "^5.0.0" - -"@ethersproject/transactions@^5.0.0-beta.135": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.0.2.tgz#590ede71fc87b45be7bd46002e18ae52246a2347" - integrity sha512-jZp0ZbbJlq4JLZY6qoMzNtp2HQsX6USQposi3ns0MPUdn3OdZJBDtrcO15r/2VS5t/K1e1GE5MI1HmMKlcTbbQ== - dependencies: - "@ethersproject/address" "^5.0.0" - "@ethersproject/bignumber" "^5.0.0" - "@ethersproject/bytes" "^5.0.0" - "@ethersproject/constants" "^5.0.0" - "@ethersproject/keccak256" "^5.0.0" - "@ethersproject/logger" "^5.0.0" - "@ethersproject/properties" "^5.0.0" - "@ethersproject/rlp" "^5.0.0" - "@ethersproject/signing-key" "^5.0.0" - -"@openzeppelin/contracts@^2.5.0": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-2.5.1.tgz#c76e3fc57aa224da3718ec351812a4251289db31" - integrity sha512-qIy6tLx8rtybEsIOAlrM4J/85s2q2nPkDqj/Rx46VakBZ0LwtFhXIVub96LXHczQX0vaqmAueDqNPXtbSXSaYQ== - -"@polkadot/api-contract@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-3.2.4-3.tgz#44b16e6d3259d7e0c21c496044771302bb8d019c" - integrity sha512-Gi8yOjk+yIsrazPBZRFLHxAveIOiuETHmZ9QQoSDC6XpkK4jhhmVG3o5oRmEzn+78SEA/cYAW8gxKVf6aeoUQQ== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/api" "3.2.4-3" - "@polkadot/types" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/x-rxjs" "3.2.4-3" - bn.js "^4.11.9" - -"@polkadot/api-derive@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-3.2.4-3.tgz#451ac9906ddf88e55cbc331ac264eddbeb1a757d" - integrity sha512-iNtbFetZsta1SMkGcJWxV1EDB3FrXreXC3w2JhEwZ9BdZV+P8WnLKWP2q96aERlHff2792QbtdNyXtHPLgWprA== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/api" "3.2.4-3" - "@polkadot/rpc-core" "3.2.4-3" - "@polkadot/types" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" - "@polkadot/x-rxjs" "3.2.4-3" - bn.js "^4.11.9" - -"@polkadot/api@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-3.2.4-3.tgz#947508eef3d19a9c527dbf268cde411a14e09118" - integrity sha512-FTtQYtRZ0JLIbvGMlL8U4QDOZI3LxNiKvqDHgao+LJg0d+ZwawWlF6ZOJpJ84mW96dEzRIhhuhY299jQvLpbXA== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/api-derive" "3.2.4-3" - "@polkadot/keyring" "^5.2.2" - "@polkadot/metadata" "3.2.4-3" - "@polkadot/rpc-core" "3.2.4-3" - "@polkadot/rpc-provider" "3.2.4-3" - "@polkadot/types" "3.2.4-3" - "@polkadot/types-known" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" - "@polkadot/x-rxjs" "3.2.4-3" - bn.js "^4.11.9" - eventemitter3 "^4.0.7" - -"@polkadot/keyring@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-5.2.2.tgz#1b011d9ad96ce142ee21183c2e76cbc0c7c5c39b" - integrity sha512-HZ+CABf0hC1P2ySHN/EP2ldiUa9jKo33Gg5lsOos4MjlsCrqhTB/LBg9dSYVO8Z215wpty7KBHvPYQv4XRXO7Q== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/util" "5.2.2" - "@polkadot/util-crypto" "5.2.2" - -"@polkadot/metadata@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-3.2.4-3.tgz#aeb975d0700ec26f46d27110e9e578fcafc0df0e" - integrity sha512-YgeO2cGNAMEvK+kKS5m9MYnhx7L/D71/fUO96FFJUgKentV3ofxsc6TdSE2B8bnl5jxI5zmlC6UvzMfB72tKjA== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/types" "3.2.4-3" - "@polkadot/types-known" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" - bn.js "^4.11.9" - -"@polkadot/networks@5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-5.2.2.tgz#465fd0984f1a161803c4c605d6931f90ad0b966f" - integrity sha512-rffpQNldyajuGrqNzNsQiGyupFv7TDUZ4Pm1kGAToMipd9IfJQFRs9TxeCvP7qwsWmsAPBe3YN6GHRNtS9TdEg== - dependencies: - "@babel/runtime" "^7.12.5" - -"@polkadot/rpc-core@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-3.2.4-3.tgz#637175a6b18994788daf5ba62e206947a0e9b79d" - integrity sha512-cK9/ul/4IfzoYExVCONo3ua9YyGCbB3L3tUyDuFfEN6RZj0GtNc558fdMrU2zs1bpRkqElYPoRIY5y6OUsIAKQ== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/metadata" "3.2.4-3" - "@polkadot/rpc-provider" "3.2.4-3" - "@polkadot/types" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/x-rxjs" "3.2.4-3" - -"@polkadot/rpc-provider@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-3.2.4-3.tgz#592e580d47b471d9f41cd0aa84d347f6ceeb4da7" - integrity sha512-92n/VGFlDK+vj++W9rxoJ0xSKRwBYCHta3hp/adUGYThXGBZWcpkOqtrvXdlKk8bxXWrj+ASUXSXS0QsYqHvlw== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/types" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" - "@polkadot/x-fetch" "^5.2.2" - "@polkadot/x-ws" "^5.2.2" - bn.js "^4.11.9" - eventemitter3 "^4.0.7" - -"@polkadot/types-known@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-3.2.4-3.tgz#21bcb0e22cdc5386bf80745120674f0bb04d9275" - integrity sha512-FaAmfgrNrRjibm2WfJ/KtO86U3JZLSSJUB52hq3U7HAL52BG0e10qOqXrik2nXM7GrzPXm8pVpiUWjCldJ95YQ== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/types" "3.2.4-3" - "@polkadot/util" "^5.2.2" - bn.js "^4.11.9" - -"@polkadot/types@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-3.2.4-3.tgz#58006660b9e8e4d2a0d43b4a125621d63999eaa0" - integrity sha512-izRz/Z3KCGl1wpKTJMBZRf/hdSZOX3zks1AUQT4uuuc/k96oQf/JTMZUT1FSxaKZ0r6kVQKHfOeduQfREdQ0zQ== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/metadata" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" - "@polkadot/x-rxjs" "3.2.4-3" - "@types/bn.js" "^4.11.6" - bn.js "^4.11.9" - -"@polkadot/util-crypto@5.2.2", "@polkadot/util-crypto@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-5.2.2.tgz#103d6ccda64c72c2e971028b0ec7e74ffb4acd8c" - integrity sha512-U/QX5cwhFQgd448LVbJRP8IR9UeUNOH//Dv+ZhoCcqLXkVxMotF8BJjRUzkQVrORIlP0miWlwxygb4xzNsYhsw== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/networks" "5.2.2" - "@polkadot/util" "5.2.2" - "@polkadot/wasm-crypto" "^3.1.1" - "@polkadot/x-randomvalues" "5.2.2" - base-x "^3.0.8" - blakejs "^1.1.0" - bn.js "^4.11.9" - create-hash "^1.2.0" - elliptic "^6.5.3" - hash.js "^1.1.7" - js-sha3 "^0.8.0" - scryptsy "^2.1.0" - tweetnacl "^1.0.3" - xxhashjs "^0.2.2" - -"@polkadot/util@5.2.2", "@polkadot/util@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-5.2.2.tgz#c673a8b260fa29eadb4a95748cd675325b22e3b1" - integrity sha512-kUtQ3Jv+9xCMZOoXwFXVv7xHc5idPCIerbXN44406lvB3dF7G4sMUIG6fx2kCuarL+lF4RK8F4o14SpctK3wCA== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/x-textdecoder" "5.2.2" - "@polkadot/x-textencoder" "5.2.2" - "@types/bn.js" "^4.11.6" - bn.js "^4.11.9" - camelcase "^5.3.1" - ip-regex "^4.2.0" - -"@polkadot/wasm-crypto-asmjs@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-3.1.1.tgz#391e1be6f7d65552b09c2e2486d108c379e46dc6" - integrity sha512-7Lt4B/6dwUhb5OAuSes0qMd83TpkngvEpiXTt2ccf/t2OvAXY9msfeJ9as3dI2jvjA9edD//jiejJ0BHJgpuXw== - dependencies: - "@babel/runtime" "^7.12.5" - -"@polkadot/wasm-crypto-wasm@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-3.1.1.tgz#94638daa7642e6a9681cb854757d98401913f087" - integrity sha512-KaP1Ojf889ZeXHGPmyFTj0Qxr/jQ4yfpaGiEOCvYKXRYsDsbZKfxcb96PFil/x0yoZswWG3TX2S3hebnAzkmBg== - dependencies: - "@babel/runtime" "^7.12.5" - -"@polkadot/wasm-crypto@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-3.1.1.tgz#e9ec63204f508541dfda72f0b6b98be40e27de50" - integrity sha512-uApLRojJY9Q7Arji6w9/eOYEu8Pg8dm+zt+640QLzC4KVVCpbdMmrcFAXCZXeOIJwsKveZsNehGUCcG77ypVPg== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/wasm-crypto-asmjs" "^3.1.1" - "@polkadot/wasm-crypto-wasm" "^3.1.1" - -"@polkadot/x-fetch@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-5.2.2.tgz#8e2e39f3872b1ffcc18767282b3afb1786ff938f" - integrity sha512-u1fd8woiE8l6xn9QXpdFhhaYIarShtDJTBgGKH3PFuQVrPjrTT3iA+OIHB4jpM8FFZyPG6rCdk6N9EFp/3neFA== - dependencies: - "@babel/runtime" "^7.12.5" - "@types/node-fetch" "^2.5.7" - node-fetch "^2.6.1" - -"@polkadot/x-randomvalues@5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-5.2.2.tgz#c44e5ea967eac347525604dd43500ae2fb6ec418" - integrity sha512-0aJmWUvOil6SC1At5YDHKFAMTUkvKw9IQC9Qxj0WhaDIY3KETgX+dNWNI8qEeoKsgCXMybPzewI5X9IXl7QItQ== - dependencies: - "@babel/runtime" "^7.12.5" - -"@polkadot/x-rxjs@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-3.2.4-3.tgz#7779998f5d7190c77c8493a41701f5cc4c53edc5" - integrity sha512-EJlm1nyXXQCttvjrS3ss9Aq797HoN5jW+mB0yF6YbeH7nfERifiouykVvASa0PSsb6eITBAZDNvJHt6L0a62Ig== - dependencies: - "@babel/runtime" "^7.12.5" - rxjs "^6.6.3" - -"@polkadot/x-textdecoder@5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-5.2.2.tgz#0b412c275107485c36c70dffe67f0cfee8f1e786" - integrity sha512-4ca8oJT/CAXh0XqtKykuHLEubZZP+7KINGOd2NUqxrNQRCgc6iClAiNq+HByPJz4WMTIOTyGcbH2CplzB/GHLg== - dependencies: - "@babel/runtime" "^7.12.5" - -"@polkadot/x-textencoder@5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-5.2.2.tgz#2c58b9093e33ae3628a8feb1d0bcd25e0c25fcb7" - integrity sha512-HInuKv67Jac6aNFxeQtFaEM97mgLB6shqB7oR5Z8cCL2T+xrdbp+cr5/R392QDt/LY6csFp5hw2YkN+42Yrthg== - dependencies: - "@babel/runtime" "^7.12.5" - -"@polkadot/x-ws@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-5.2.2.tgz#71f992a6b7b6677451d37e064134ec42d6ac7268" - integrity sha512-UitnCF7THR/NFhZq26znBhUJUt9bynlX1G6s3gxvtJaibmTVdsAW2ZiBO8GuoR0DiWRPn037QYXBLigQEDaWCw== - dependencies: - "@babel/runtime" "^7.12.5" - "@types/websocket" "^1.0.1" - websocket "^1.0.33" - -"@sindresorhus/is@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" - integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== - -"@szmarczak/http-timer@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" - integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== - dependencies: - defer-to-connect "^1.0.1" - -"@truffle/blockchain-utils@^0.0.25": - version "0.0.25" - resolved "https://registry.yarnpkg.com/@truffle/blockchain-utils/-/blockchain-utils-0.0.25.tgz#f4b320890113d282f25f1a1ecd65b94a8b763ac1" - integrity sha512-XA5m0BfAWtysy5ChHyiAf1fXbJxJXphKk+eZ9Rb9Twi6fn3Jg4gnHNwYXJacYFEydqT5vr2s4Ou812JHlautpw== - dependencies: - source-map-support "^0.5.19" - -"@truffle/codec@^0.6.1": - version "0.6.1" - resolved "https://registry.yarnpkg.com/@truffle/codec/-/codec-0.6.1.tgz#ed26bb4948d8a3d4b5884538ae41b1c7f9f900ba" - integrity sha512-HrInHX9yLVVRCGOsXG2mZNG5P724KHZH3Pez6tMn39yLPsiKm9CzHcAHF5uX7ExhponOTEtKViudQ4MAFfh9Jg== - dependencies: - big.js "^5.2.2" - bn.js "^4.11.8" - borc "^2.1.2" - debug "^4.1.0" - lodash.clonedeep "^4.5.0" - lodash.escaperegexp "^4.1.2" - lodash.partition "^4.6.0" - lodash.sum "^4.0.2" - semver "^6.3.0" - source-map-support "^0.5.19" - utf8 "^3.0.0" - web3-utils "1.2.1" - -"@truffle/contract-schema@^3.2.5": - version "3.2.5" - resolved "https://registry.yarnpkg.com/@truffle/contract-schema/-/contract-schema-3.2.5.tgz#498bbadad955daefd2638af4b195607734b306b9" - integrity sha512-07lzyYJinGvpaKc/WUm1sigtE5qDjFfUb/wUfV5cNsUmRSd/Ji9vTZ+of/zYP4MztJQLT/ZtuG836oXhWgqntg== - dependencies: - ajv "^6.10.0" - crypto-js "^3.1.9-1" - debug "^4.1.0" - -"@truffle/contract@^4.2.22": - version "4.2.22" - resolved "https://registry.yarnpkg.com/@truffle/contract/-/contract-4.2.22.tgz#48219634ec7a1f970d2be4819d2d115cdb33d896" - integrity sha512-mkkuQucuZb+kHlnDwcEF5CXKa7c3hZRTN7y0NSVGlNKPMAd+VMoGi4RsJy3o0ALAumsxi714sGMHJagqoz/RmA== - dependencies: - "@truffle/blockchain-utils" "^0.0.25" - "@truffle/contract-schema" "^3.2.5" - "@truffle/debug-utils" "^4.2.8" - "@truffle/error" "^0.0.11" - "@truffle/interface-adapter" "^0.4.16" - bignumber.js "^7.2.1" - ethereum-ens "^0.8.0" - ethers "^4.0.0-beta.1" - source-map-support "^0.5.19" - web3 "1.2.1" - web3-core-helpers "1.2.1" - web3-core-promievent "1.2.1" - web3-eth-abi "1.2.1" - web3-utils "1.2.1" - -"@truffle/debug-utils@^4.2.8": - version "4.2.8" - resolved "https://registry.yarnpkg.com/@truffle/debug-utils/-/debug-utils-4.2.8.tgz#2e5f865b9fea26884344396aef29a332bc1a7a75" - integrity sha512-o1apbR4FpQDVNCtT7nnXDAmHKGHEOVGuXyz9QG/IhjRdqxwZEE0pzBAW13tdIwduNaj6TQQVTB/Fx8uz914qzg== - dependencies: - "@truffle/codec" "^0.6.1" - "@trufflesuite/chromafi" "^2.1.2" - chalk "^2.4.2" - debug "^4.1.0" - highlight.js "^9.15.8" - highlightjs-solidity "^1.0.18" - -"@truffle/error@^0.0.11": - version "0.0.11" - resolved "https://registry.yarnpkg.com/@truffle/error/-/error-0.0.11.tgz#2789c0042d7e796dcbb840c7a9b5d2bcd8e0e2d8" - integrity sha512-ju6TucjlJkfYMmdraYY/IBJaFb+Sa+huhYtOoyOJ+G29KcgytUVnDzKGwC7Kgk6IsxQMm62Mc1E0GZzFbGGipw== - -"@truffle/hdwallet-provider@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@truffle/hdwallet-provider/-/hdwallet-provider-1.2.0.tgz#7d4cc2038e1a2ca5cf08877f72a6383d14aff491" - integrity sha512-EPatDbyRuGbB/MLt9ZBokmtjyLjaNpuHfUIWuv4mQMrH1Nu82H5AAZYLh4Z1BZliDZpqB03a0yUMmK/4R0BN9g== - dependencies: - "@trufflesuite/web3-provider-engine" "15.0.13-1" - "@types/web3" "^1.0.20" - any-promise "^1.3.0" - bindings "^1.5.0" - ethereum-cryptography "^0.1.3" - ethereum-protocol "^1.0.1" - ethereumjs-tx "^1.0.0" - ethereumjs-util "^6.1.0" - ethereumjs-wallet "^0.6.3" - source-map-support "^0.5.19" - -"@truffle/interface-adapter@^0.4.16": - version "0.4.16" - resolved "https://registry.yarnpkg.com/@truffle/interface-adapter/-/interface-adapter-0.4.16.tgz#6bd65d9d17b4a2a51f39d05dd8b467daa8855792" - integrity sha512-lsxk26Lz/h0n8fe37K1ZxowxokXj0AZeNR10QHltDvkHukuTIC4L6fXvrUi74mCwI9hShl4CSBas1Q8kAyJyOA== - dependencies: - bn.js "^4.11.8" - ethers "^4.0.32" - source-map-support "^0.5.19" - web3 "1.2.1" - -"@trufflesuite/chromafi@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@trufflesuite/chromafi/-/chromafi-2.1.2.tgz#50715070093c5543a406a2cc85fa70fc8d1a36ab" - integrity sha512-KcfjcH3B8+lHfSTfugFPBpMZmppLNCnM6/PP8ByrQLSACyjh9UOMUWHAW3FDHKEt1cOCzIFXrx2f4AFFrQFxSg== - dependencies: - ansi-mark "^1.0.0" - ansi-regex "^3.0.0" - array-uniq "^1.0.3" - camelcase "^4.1.0" - chalk "^2.3.2" - cheerio "^1.0.0-rc.2" - detect-indent "^5.0.0" - he "^1.1.1" - highlight.js "^9.12.0" - husky "^0.14.3" - lodash.merge "^4.6.2" - min-indent "^1.0.0" - strip-ansi "^4.0.0" - strip-indent "^2.0.0" - super-split "^1.1.0" - -"@trufflesuite/eth-json-rpc-filters@^4.1.2-1": - version "4.1.2-1" - resolved "https://registry.yarnpkg.com/@trufflesuite/eth-json-rpc-filters/-/eth-json-rpc-filters-4.1.2-1.tgz#61ab78c52e98a883e5cf086925b34a30297b1824" - integrity sha512-/MChvC5dw2ck9NU1cZmdovCz2VKbOeIyR4tcxDvA5sT+NaL0rA2/R5U0yI7zsbo1zD+pgqav77rQHTzpUdDNJQ== - dependencies: - "@trufflesuite/eth-json-rpc-middleware" "^4.4.2-0" - await-semaphore "^0.1.3" - eth-query "^2.1.2" - json-rpc-engine "^5.1.3" - lodash.flatmap "^4.5.0" - safe-event-emitter "^1.0.1" - -"@trufflesuite/eth-json-rpc-infura@^4.0.3-0": - version "4.0.3-0" - resolved "https://registry.yarnpkg.com/@trufflesuite/eth-json-rpc-infura/-/eth-json-rpc-infura-4.0.3-0.tgz#6d22122937cf60ec9d21a02351c101fdc608c4fe" - integrity sha512-xaUanOmo0YLqRsL0SfXpFienhdw5bpQ1WEXxMTRi57az4lwpZBv4tFUDvcerdwJrxX9wQqNmgUgd1BrR01dumw== - dependencies: - "@trufflesuite/eth-json-rpc-middleware" "^4.4.2-1" - cross-fetch "^2.1.1" - eth-json-rpc-errors "^1.0.1" - json-rpc-engine "^5.1.3" - -"@trufflesuite/eth-json-rpc-middleware@^4.4.2-0", "@trufflesuite/eth-json-rpc-middleware@^4.4.2-1": - version "4.4.2-1" - resolved "https://registry.yarnpkg.com/@trufflesuite/eth-json-rpc-middleware/-/eth-json-rpc-middleware-4.4.2-1.tgz#8c3638ed8a7ed89a1e5e71407de068a65bef0df2" - integrity sha512-iEy9H8ja7/8aYES5HfrepGBKU9n/Y4OabBJEklVd/zIBlhCCBAWBqkIZgXt11nBXO/rYAeKwYuE3puH3ByYnLA== - dependencies: - "@trufflesuite/eth-sig-util" "^1.4.2" - btoa "^1.2.1" - clone "^2.1.1" - eth-json-rpc-errors "^1.0.1" - eth-query "^2.1.2" - ethereumjs-block "^1.6.0" - ethereumjs-tx "^1.3.7" - ethereumjs-util "^5.1.2" - ethereumjs-vm "^2.6.0" - fetch-ponyfill "^4.0.0" - json-rpc-engine "^5.1.3" - json-stable-stringify "^1.0.1" - pify "^3.0.0" - safe-event-emitter "^1.0.1" - -"@trufflesuite/eth-sig-util@^1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@trufflesuite/eth-sig-util/-/eth-sig-util-1.4.2.tgz#b529e2f38ac08e652116f48981132a26242a4f08" - integrity sha512-+GyfN6b0LNW77hbQlH3ufZ/1eCON7mMrGym6tdYf7xiNw9Vv3jBO72bmmos1EId2NgBvPMhmYYm6DSLQFTmzrA== - dependencies: - ethereumjs-abi "^0.6.8" - ethereumjs-util "^5.1.1" - -"@trufflesuite/web3-provider-engine@15.0.13-1": - version "15.0.13-1" - resolved "https://registry.yarnpkg.com/@trufflesuite/web3-provider-engine/-/web3-provider-engine-15.0.13-1.tgz#f6a7f7131a2fdc4ab53976318ed13ce83e8e4bcb" - integrity sha512-6u3x/iIN5fyj8pib5QTUDmIOUiwAGhaqdSTXdqCu6v9zo2BEwdCqgEJd1uXDh3DBmPRDfiZ/ge8oUPy7LerpHg== - dependencies: - "@trufflesuite/eth-json-rpc-filters" "^4.1.2-1" - "@trufflesuite/eth-json-rpc-infura" "^4.0.3-0" - "@trufflesuite/eth-json-rpc-middleware" "^4.4.2-1" - "@trufflesuite/eth-sig-util" "^1.4.2" - async "^2.5.0" - backoff "^2.5.0" - clone "^2.0.0" - cross-fetch "^2.1.0" - eth-block-tracker "^4.4.2" - eth-json-rpc-errors "^2.0.2" - ethereumjs-block "^1.2.2" - ethereumjs-tx "^1.2.0" - ethereumjs-util "^5.1.5" - ethereumjs-vm "^2.3.4" - json-stable-stringify "^1.0.1" - promise-to-callback "^1.0.0" - readable-stream "^2.2.9" - request "^2.85.0" - semaphore "^1.0.3" - ws "^5.1.1" - xhr "^2.2.0" - xtend "^4.0.1" - -"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.5", "@types/bn.js@^4.11.6": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" - -"@types/chai@^4.2.12": - version "4.2.12" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.12.tgz#6160ae454cd89dae05adc3bb97997f488b608201" - integrity sha512-aN5IAC8QNtSUdQzxu7lGBgYAOuU1tmRU4c9dIq5OKGf/SBVjXo+ffM2wEjudAWbgpOhy60nLoAGH1xm8fpCKFQ== - -"@types/color-name@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" - integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= - -"@types/mocha@^8.0.3": - version "8.0.3" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.0.3.tgz#51b21b6acb6d1b923bbdc7725c38f9f455166402" - integrity sha512-vyxR57nv8NfcU0GZu8EUXZLTbCMupIUwy95LJ6lllN+JRPG25CwMHoB1q5xKh8YKhQnHYRAn4yW2yuHbf/5xgg== - -"@types/node-fetch@^2.5.7": - version "2.5.7" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" - integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - -"@types/node@*": - version "14.6.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.0.tgz#7d4411bf5157339337d7cff864d9ff45f177b499" - integrity sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA== - -"@types/node@^10.3.2": - version "10.17.34" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.34.tgz#8f5ee42d5e816d551450f5729022828d3f3c7293" - integrity sha512-DlT8xondSSUixRxkdXQ3+dIZmCWkM6PX8kqIx1Zqp+FA/GmHJwqPixMeF89OirKVCFBh7U1m1I1Oj4gSrUW5oQ== - -"@types/node@^12.12.6": - version "12.12.54" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.54.tgz#a4b58d8df3a4677b6c08bfbc94b7ad7a7a5f82d1" - integrity sha512-ge4xZ3vSBornVYlDnk7yZ0gK6ChHf/CHB7Gl1I0Jhah8DDnEQqBzgohYG4FX4p81TNirSETOiSyn+y1r9/IR6w== - -"@types/pbkdf2@^3.0.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" - integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== - dependencies: - "@types/node" "*" - -"@types/secp256k1@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.1.tgz#fb3aa61a1848ad97d7425ff9dcba784549fca5a4" - integrity sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog== - dependencies: - "@types/node" "*" - -"@types/web3@^1.0.20": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@types/web3/-/web3-1.2.2.tgz#d95a101547ce625c5ebd0470baa5dbd4b9f3c015" - integrity sha512-eFiYJKggNrOl0nsD+9cMh2MLk4zVBfXfGnVeRFbpiZzBE20eet4KLA3fXcjSuHaBn0RnQzwLAGdgzgzdet4C0A== - dependencies: - web3 "*" - -"@types/websocket@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.1.tgz#039272c196c2c0e4868a0d8a1a27bbb86e9e9138" - integrity sha512-f5WLMpezwVxCLm1xQe/kdPpQIOmL0TXYx2O15VYfYzc7hTIdxiOoOvez+McSIw3b7z/1zGovew9YSL7+h4h7/Q== - dependencies: - "@types/node" "*" - -"@ungap/promise-all-settled@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== - -"@uniswap/lib@1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@uniswap/lib/-/lib-1.1.1.tgz#0afd29601846c16e5d082866cbb24a9e0758e6bc" - integrity sha512-2yK7sLpKIT91TiS5sewHtOa7YuM8IuBXVl4GZv2jZFys4D2sY7K5vZh6MqD25TPA95Od+0YzCVq6cTF2IKrOmg== - -"@uniswap/v2-core@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@uniswap/v2-core/-/v2-core-1.0.0.tgz#e0fab91a7d53e8cafb5326ae4ca18351116b0844" - integrity sha512-BJiXrBGnN8mti7saW49MXwxDBRFiWemGetE58q8zgfnPPzQKq55ADltEILqOt6VFZ22kVeVKbF8gVd8aY3l7pA== - -"@uniswap/v2-core@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@uniswap/v2-core/-/v2-core-1.0.1.tgz#af8f508bf183204779938969e2e54043e147d425" - integrity sha512-MtybtkUPSyysqLY2U210NBDeCHX+ltHt3oADGdjqoThZaFRDKwM6k1Nb3F0A3hk5hwuQvytFWhrWHOEq6nVJ8Q== - -"@uniswap/v2-periphery@^1.1.0-beta.0": - version "1.1.0-beta.0" - resolved "https://registry.yarnpkg.com/@uniswap/v2-periphery/-/v2-periphery-1.1.0-beta.0.tgz#20a4ccfca22f1a45402303aedb5717b6918ebe6d" - integrity sha512-6dkwAMKza8nzqYiXEr2D86dgW3TTavUvCR0w2Tu33bAbM8Ah43LKAzH7oKKPRT5VJQaMi1jtkGs1E8JPor1n5g== - dependencies: - "@uniswap/lib" "1.1.1" - "@uniswap/v2-core" "1.0.0" - -abstract-leveldown@~2.6.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" - integrity sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA== - dependencies: - xtend "~4.0.0" - -abstract-leveldown@~2.7.1: - version "2.7.2" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz#87a44d7ebebc341d59665204834c8b7e0932cc93" - integrity sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w== - dependencies: - xtend "~4.0.0" - -accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -aes-js@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" - integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0= - -aes-js@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" - integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== - -ajv@^6.10.0: - version "6.12.5" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.5.tgz#19b0e8bae8f476e5ba666300387775fb1a00a4da" - integrity sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^6.12.3: - version "6.12.4" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.4.tgz#0614facc4522127fa713445c6bfd3ebd376e2234" - integrity sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-colors@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-mark@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/ansi-mark/-/ansi-mark-1.0.4.tgz#1cd4ba8d57f15f109d6aaf6ec9ca9786c8a4ee6c" - integrity sha1-HNS6jVfxXxCdaq9uycqXhsik7mw= - dependencies: - ansi-regex "^3.0.0" - array-uniq "^1.0.3" - chalk "^2.3.2" - strip-ansi "^4.0.0" - super-split "^1.1.0" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" - integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== - dependencies: - "@types/color-name" "^1.1.1" - color-convert "^2.0.1" - -any-promise@1.3.0, any-promise@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= - -anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -app-module-path@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" - integrity sha1-ZBqlXft9am8KgUHEucCqULbCTdU= - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-uniq@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= - -array.prototype.map@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array.prototype.map/-/array.prototype.map-1.0.2.tgz#9a4159f416458a23e9483078de1106b2ef68f8ec" - integrity sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - es-array-method-boxes-properly "^1.0.0" - is-string "^1.0.4" - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -asn1.js@^5.2.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" - integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - safer-buffer "^2.1.0" - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - -async-eventemitter@^0.2.2: - version "0.2.4" - resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" - integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== - dependencies: - async "^2.4.0" - -async-limiter@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" - integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== - -async@^1.4.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= - -async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -await-semaphore@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/await-semaphore/-/await-semaphore-0.1.3.tgz#2b88018cc8c28e06167ae1cdff02504f1f9688d3" - integrity sha512-d1W2aNSYcz/sxYO4pMGX9vq65qOTu0P800epMud+6cYYX0QcT7zyqcxec3VWzpgvdXo57UWmVbZpLMjX2m1I7Q== - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.10.1" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.1.tgz#e1e82e4f3e999e2cfd61b161280d16a111f86428" - integrity sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA== - -backoff@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/backoff/-/backoff-2.5.0.tgz#f616eda9d3e4b66b8ca7fca79f695722c5f8e26f" - integrity sha1-9hbtqdPktmuMp/ynn2lXIsX44m8= - dependencies: - precond "0.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base-x@^3.0.2, base-x@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.8.tgz#1e1106c2537f0162e8b52474a557ebb09000018d" - integrity sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA== - dependencies: - safe-buffer "^5.0.1" - -base64-js@^1.0.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" - integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - -bignumber.js@^7.2.1: - version "7.2.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f" - integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== - -bignumber.js@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.0.tgz#805880f84a329b5eac6e7cb6f8274b6d82bdf075" - integrity sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A== - -bignumber.js@debris/bignumber.js#master: - version "2.0.7" - resolved "https://codeload.github.com/debris/bignumber.js/tar.gz/c7a38de919ed75e6fb6ba38051986e294b328df9" - -binary-extensions@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" - integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -bl@^1.0.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" - integrity sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww== - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - -blakejs@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" - integrity sha1-ad+S75U6qIylGjLfarHFShVfx6U= - -bluebird@^3.4.7, bluebird@^3.5.0: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - -bn.js@4.11.6: - version "4.11.6" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" - integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU= - -bn.js@4.11.8: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0: - version "4.11.9" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" - integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw== - -bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.3.tgz#beca005408f642ebebea80b042b4d18d2ac0ee6b" - integrity sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ== - -body-parser@1.19.0, body-parser@^1.16.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - -boolbase@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= - -borc@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/borc/-/borc-2.1.2.tgz#6ce75e7da5ce711b963755117dd1b187f6f8cf19" - integrity sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w== - dependencies: - bignumber.js "^9.0.0" - buffer "^5.5.0" - commander "^2.15.0" - ieee754 "^1.1.13" - iso-url "~0.4.7" - json-text-sequence "~0.1.0" - readable-stream "^3.6.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -brorand@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" - integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg== - dependencies: - bn.js "^5.1.1" - browserify-rsa "^4.0.1" - create-hash "^1.2.0" - create-hmac "^1.1.7" - elliptic "^6.5.3" - inherits "^2.0.4" - parse-asn1 "^5.1.5" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -bs58@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= - dependencies: - base-x "^3.0.2" - -bs58check@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" - integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== - dependencies: - bs58 "^4.0.0" - create-hash "^1.1.0" - safe-buffer "^5.1.2" - -btoa@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/btoa/-/btoa-1.2.1.tgz#01a9909f8b2c93f6bf680ba26131eb30f7fa3d73" - integrity sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g== - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - -buffer-from@^1.0.0, buffer-from@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -buffer-to-arraybuffer@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" - integrity sha1-YGSkD6dutDxyOrqe+PbhIW0QURo= - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= - -buffer@^5.0.5, buffer@^5.2.1, buffer@^5.5.0, buffer@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" - integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -bufferutil@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.1.tgz#3a177e8e5819a1243fe16b63a199951a7ad8d4a7" - integrity sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA== - dependencies: - node-gyp-build "~3.7.0" - -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - -cacheable-request@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" - integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^3.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^1.0.2" - -camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - -camelcase@^5.0.0, camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.0.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -chai@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" - integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.0" - type-detect "^4.0.5" - -chalk@^2.3.2, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - -checkpoint-store@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" - integrity sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY= - dependencies: - functional-red-black-tree "^1.0.1" - -cheerio@^1.0.0-rc.2: - version "1.0.0-rc.3" - resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6" - integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA== - dependencies: - css-select "~1.2.0" - dom-serializer "~0.1.1" - entities "~1.1.1" - htmlparser2 "^3.9.1" - lodash "^4.15.0" - parse5 "^3.0.1" - -chokidar@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.1.tgz#c84e5b3d18d9a4d77558fef466b1bf16bbeb3450" - integrity sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.3.0" - optionalDependencies: - fsevents "~2.1.2" - -chokidar@3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" - integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.5.0" - optionalDependencies: - fsevents "~2.1.2" - -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -ci-info@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" - integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== - -cids@^0.7.1: - version "0.7.5" - resolved "https://registry.yarnpkg.com/cids/-/cids-0.7.5.tgz#60a08138a99bfb69b6be4ceb63bfef7a396b28b2" - integrity sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA== - dependencies: - buffer "^5.5.0" - class-is "^1.1.0" - multibase "~0.6.0" - multicodec "^1.0.0" - multihashes "~0.4.15" - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -class-is@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/class-is/-/class-is-1.1.0.tgz#9d3c0fba0440d211d843cec3dedfa48055005825" - integrity sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw== - -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - -clone@^2.0.0, clone@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@^2.15.0, commander@^2.8.1: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - -content-hash@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/content-hash/-/content-hash-2.5.2.tgz#bbc2655e7c21f14fd3bfc7b7d4bfe6e454c9e211" - integrity sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw== - dependencies: - cids "^0.7.1" - multicodec "^0.5.5" - multihashes "^0.4.15" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - -cookiejar@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" - integrity sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA== - -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -cors@^2.8.1: - version "2.8.5" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" - integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== - dependencies: - object-assign "^4" - vary "^1" - -create-ecdh@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" - integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== - dependencies: - bn.js "^4.1.0" - elliptic "^6.5.3" - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -cross-fetch@^2.1.0, cross-fetch@^2.1.1: - version "2.2.3" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" - integrity sha512-PrWWNH3yL2NYIb/7WF/5vFG3DCQiXDOVf8k3ijatbrtnwNuhMWLC7YF7uqf53tbTFDzHIUD8oITw4Bxt8ST3Nw== - dependencies: - node-fetch "2.1.2" - whatwg-fetch "2.0.4" - -crypto-browserify@3.12.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - -crypto-js@^3.1.4, crypto-js@^3.1.9-1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.3.0.tgz#846dd1cce2f68aacfa156c8578f926a609b7976b" - integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q== - -css-select@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" - integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= - dependencies: - boolbase "~1.0.0" - css-what "2.1" - domutils "1.5.1" - nth-check "~1.0.1" - -css-what@2.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" - integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== - -cuint@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/cuint/-/cuint-0.2.2.tgz#408086d409550c2631155619e9fa7bcadc3b991b" - integrity sha1-QICG1AlVDCYxFVYZ6fp7ytw7mRs= - -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -debug@2.6.9, debug@^2.2.0: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -debug@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" - integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== - dependencies: - ms "2.1.2" - -debug@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decamelize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" - integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -decompress-response@^3.2.0, decompress-response@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= - dependencies: - mimic-response "^1.0.0" - -decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" - integrity sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ== - dependencies: - file-type "^5.2.0" - is-stream "^1.1.0" - tar-stream "^1.5.2" - -decompress-tarbz2@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b" - integrity sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A== - dependencies: - decompress-tar "^4.1.0" - file-type "^6.1.0" - is-stream "^1.1.0" - seek-bzip "^1.0.5" - unbzip2-stream "^1.0.9" - -decompress-targz@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee" - integrity sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w== - dependencies: - decompress-tar "^4.1.1" - file-type "^5.2.0" - is-stream "^1.1.0" - -decompress-unzip@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" - integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k= - dependencies: - file-type "^3.8.0" - get-stream "^2.2.0" - pify "^2.3.0" - yauzl "^2.4.2" - -decompress@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.1.tgz#007f55cc6a62c055afa37c07eb6a4ee1b773f118" - integrity sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ== - dependencies: - decompress-tar "^4.0.0" - decompress-tarbz2 "^4.0.0" - decompress-targz "^4.0.0" - decompress-unzip "^4.0.1" - graceful-fs "^4.1.10" - make-dir "^1.0.0" - pify "^2.3.0" - strip-dirs "^2.0.0" - -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - -defer-to-connect@^1.0.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" - integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== - -deferred-leveldown@~1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz#3acd2e0b75d1669924bc0a4b642851131173e1eb" - integrity sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA== - dependencies: - abstract-leveldown "~2.6.0" - -define-properties@^1.1.2, define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -delimit-stream@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/delimit-stream/-/delimit-stream-0.1.0.tgz#9b8319477c0e5f8aeb3ce357ae305fc25ea1cd2b" - integrity sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -detect-indent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" - integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= - -diff@4.0.2, diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -diff@^3.1.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - -dom-serializer@0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" - integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g== - dependencies: - domelementtype "^2.0.1" - entities "^2.0.0" - -dom-serializer@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" - integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== - dependencies: - domelementtype "^1.3.0" - entities "^1.1.1" - -dom-walk@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" - integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== - -domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" - integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== - -domelementtype@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.0.2.tgz#f3b6e549201e46f588b59463dd77187131fe6971" - integrity sha512-wFwTwCVebUrMgGeAwRL/NhZtHAUyT9n9yg4IMDwf10+6iCMxSkVq9MGCVEH+QZWo1nNidy8kNvwmv4zWHDTqvA== - -domhandler@^2.3.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" - integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== - dependencies: - domelementtype "1" - -domutils@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" - integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= - dependencies: - dom-serializer "0" - domelementtype "1" - -domutils@^1.5.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" - integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== - dependencies: - dom-serializer "0" - domelementtype "1" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -elliptic@6.3.3: - version "6.3.3" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f" - integrity sha1-VILZZG1UvLif19mU/J4ulWiHbj8= - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - inherits "^2.0.1" - -elliptic@6.5.3, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3: - version "6.5.3" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" - integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -encoding@^0.1.11: - version "0.1.13" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" - integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== - dependencies: - iconv-lite "^0.6.2" - -end-of-stream@^1.0.0, end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -entities@^1.1.1, entities@~1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" - integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== - -entities@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f" - integrity sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ== - -errno@~0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" - integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== - dependencies: - prr "~1.0.1" - -es-abstract@^1.17.0-next.1, es-abstract@^1.17.4, es-abstract@^1.17.5: - version "1.17.6" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.6.tgz#9142071707857b2cacc7b89ecb670316c3e2d52a" - integrity sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.2.0" - is-regex "^1.1.0" - object-inspect "^1.7.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimend "^1.0.1" - string.prototype.trimstart "^1.0.1" - -es-array-method-boxes-properly@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" - integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== - -es-get-iterator@^1.0.2: - version "1.1.0" - resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.0.tgz#bb98ad9d6d63b31aacdc8f89d5d0ee57bcb5b4c8" - integrity sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ== - dependencies: - es-abstract "^1.17.4" - has-symbols "^1.0.1" - is-arguments "^1.0.4" - is-map "^2.0.1" - is-set "^2.0.1" - is-string "^1.0.5" - isarray "^2.0.5" - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -es5-ext@^0.10.35, es5-ext@^0.10.50: - version "0.10.53" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" - integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== - dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.3" - next-tick "~1.0.0" - -es6-iterator@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-symbol@^3.1.1, es6-symbol@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -eth-block-tracker@^4.4.2: - version "4.4.3" - resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-4.4.3.tgz#766a0a0eb4a52c867a28328e9ae21353812cf626" - integrity sha512-A8tG4Z4iNg4mw5tP1Vung9N9IjgMNqpiMoJ/FouSFwNCGHv2X0mmOYwtQOJzki6XN7r7Tyo01S29p7b224I4jw== - dependencies: - "@babel/plugin-transform-runtime" "^7.5.5" - "@babel/runtime" "^7.5.5" - eth-query "^2.1.0" - json-rpc-random-id "^1.0.1" - pify "^3.0.0" - safe-event-emitter "^1.0.1" - -eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.0: - version "2.0.8" - resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" - integrity sha1-IprEbsqG1S4MmR58sq74P/D2i88= - dependencies: - idna-uts46-hx "^2.3.1" - js-sha3 "^0.5.7" - -eth-json-rpc-errors@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/eth-json-rpc-errors/-/eth-json-rpc-errors-1.1.1.tgz#148377ef55155585981c21ff574a8937f9d6991f" - integrity sha512-WT5shJ5KfNqHi9jOZD+ID8I1kuYWNrigtZat7GOQkvwo99f8SzAVaEcWhJUv656WiZOAg3P1RiJQANtUmDmbIg== - dependencies: - fast-safe-stringify "^2.0.6" - -eth-json-rpc-errors@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/eth-json-rpc-errors/-/eth-json-rpc-errors-2.0.2.tgz#c1965de0301fe941c058e928bebaba2e1285e3c4" - integrity sha512-uBCRM2w2ewusRHGxN8JhcuOb2RN3ueAOYH/0BhqdFmQkZx5lj5+fLKTz0mIVOzd4FG5/kUksCzCD7eTEim6gaA== - dependencies: - fast-safe-stringify "^2.0.6" - -eth-json-rpc-filters@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/eth-json-rpc-filters/-/eth-json-rpc-filters-4.1.1.tgz#15277c66790236d85f798f4d7dc6bab99a798cd2" - integrity sha512-GkXb2h6STznD+AmMzblwXgm1JMvjdK9PTIXG7BvIkTlXQ9g0QOxuU1iQRYHoslF9S30BYBSoLSisAYPdLggW+A== - dependencies: - await-semaphore "^0.1.3" - eth-json-rpc-middleware "^4.1.4" - eth-query "^2.1.2" - json-rpc-engine "^5.1.3" - lodash.flatmap "^4.5.0" - safe-event-emitter "^1.0.1" - -eth-json-rpc-infura@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/eth-json-rpc-infura/-/eth-json-rpc-infura-4.0.2.tgz#8af1a1a2e9a0a82aaa302bbc96fb1a4c15d69b83" - integrity sha512-dvgOrci9lZqpjpp0hoC3Zfedhg3aIpLFVDH0TdlKxRlkhR75hTrKTwxghDrQwE0bn3eKrC8RsN1m/JdnIWltpw== - dependencies: - cross-fetch "^2.1.1" - eth-json-rpc-errors "^1.0.1" - eth-json-rpc-middleware "^4.1.4" - json-rpc-engine "^5.1.3" - -eth-json-rpc-middleware@^4.1.4, eth-json-rpc-middleware@^4.1.5: - version "4.4.1" - resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-4.4.1.tgz#07d3dd0724c24a8d31e4a172ee96271da71b4228" - integrity sha512-yoSuRgEYYGFdVeZg3poWOwAlRI+MoBIltmOB86MtpoZjvLbou9EB/qWMOWSmH2ryCWLW97VYY6NWsmWm3OAA7A== - dependencies: - btoa "^1.2.1" - clone "^2.1.1" - eth-json-rpc-errors "^1.0.1" - eth-query "^2.1.2" - eth-sig-util "^1.4.2" - ethereumjs-block "^1.6.0" - ethereumjs-tx "^1.3.7" - ethereumjs-util "^5.1.2" - ethereumjs-vm "^2.6.0" - fetch-ponyfill "^4.0.0" - json-rpc-engine "^5.1.3" - json-stable-stringify "^1.0.1" - pify "^3.0.0" - safe-event-emitter "^1.0.1" - -eth-lib@0.2.7: - version "0.2.7" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" - integrity sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco= - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - xhr-request-promise "^0.1.2" - -eth-lib@0.2.8: - version "0.2.8" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.8.tgz#b194058bef4b220ad12ea497431d6cb6aa0623c8" - integrity sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw== - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - xhr-request-promise "^0.1.2" - -eth-lib@^0.1.26: - version "0.1.29" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.29.tgz#0c11f5060d42da9f931eab6199084734f4dbd1d9" - integrity sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ== - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - nano-json-stream-parser "^0.1.2" - servify "^0.1.12" - ws "^3.0.0" - xhr-request-promise "^0.1.2" - -eth-query@^2.1.0, eth-query@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" - integrity sha1-1nQdkAAQa1FRDHLbktY2VFam2l4= - dependencies: - json-rpc-random-id "^1.0.0" - xtend "^4.0.1" - -eth-rpc-errors@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eth-rpc-errors/-/eth-rpc-errors-3.0.0.tgz#d7b22653c70dbf9defd4ef490fd08fe70608ca10" - integrity sha512-iPPNHPrLwUlR9xCSYm7HHQjWBasor3+KZfRvwEWxMz3ca0yqnlBeJrnyphkGIXZ4J7AMAaOLmwy4AWhnxOiLxg== - dependencies: - fast-safe-stringify "^2.0.6" - -eth-sig-util@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" - integrity sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA= - dependencies: - ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" - ethereumjs-util "^5.1.1" - -ethereum-bloom-filters@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.7.tgz#b7b80735e385dbb7f944ce6b4533e24511306060" - integrity sha512-cDcJJSJ9GMAcURiAWO3DxIEhTL/uWqlQnvgKpuYQzYPrt/izuGU+1ntQmHt0IRq6ADoSYHFnB+aCEFIldjhkMQ== - dependencies: - js-sha3 "^0.8.0" - -ethereum-common@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" - integrity sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA== - -ethereum-common@^0.0.18: - version "0.0.18" - resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" - integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= - -ethereum-cryptography@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" - integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== - dependencies: - "@types/pbkdf2" "^3.0.0" - "@types/secp256k1" "^4.0.1" - blakejs "^1.1.0" - browserify-aes "^1.2.0" - bs58check "^2.1.2" - create-hash "^1.2.0" - create-hmac "^1.1.7" - hash.js "^1.1.7" - keccak "^3.0.0" - pbkdf2 "^3.0.17" - randombytes "^2.1.0" - safe-buffer "^5.1.2" - scrypt-js "^3.0.0" - secp256k1 "^4.0.1" - setimmediate "^1.0.5" - -ethereum-ens@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/ethereum-ens/-/ethereum-ens-0.8.0.tgz#6d0f79acaa61fdbc87d2821779c4e550243d4c57" - integrity sha512-a8cBTF4AWw1Q1Y37V1LSCS9pRY4Mh3f8vCg5cbXCCEJ3eno1hbI/+Ccv9SZLISYpqQhaglP3Bxb/34lS4Qf7Bg== - dependencies: - bluebird "^3.4.7" - eth-ens-namehash "^2.0.0" - js-sha3 "^0.5.7" - pako "^1.0.4" - underscore "^1.8.3" - web3 "^1.0.0-beta.34" - -ethereum-protocol@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ethereum-protocol/-/ethereum-protocol-1.0.1.tgz#b7d68142f4105e0ae7b5e178cf42f8d4dc4b93cf" - integrity sha512-3KLX1mHuEsBW0dKG+c6EOJS1NBNqdCICvZW9sInmZTt5aY0oxmHVggYRE0lJu1tcnMD1K+AKHdLi6U43Awm1Vg== - -ethereumjs-abi@^0.6.8, "ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": - version "0.6.8" - resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#1cfbb13862f90f0b391d8a699544d5fe4dfb8c7b" - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -ethereumjs-account@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz#eeafc62de544cb07b0ee44b10f572c9c49e00a84" - integrity sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA== - dependencies: - ethereumjs-util "^5.0.0" - rlp "^2.0.0" - safe-buffer "^5.1.1" - -ethereumjs-block@^1.2.2, ethereumjs-block@^1.6.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" - integrity sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg== - dependencies: - async "^2.0.1" - ethereum-common "0.2.0" - ethereumjs-tx "^1.2.2" - ethereumjs-util "^5.0.0" - merkle-patricia-tree "^2.1.2" - -ethereumjs-block@~2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz#c7654be7e22df489fda206139ecd63e2e9c04965" - integrity sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg== - dependencies: - async "^2.0.1" - ethereumjs-common "^1.5.0" - ethereumjs-tx "^2.1.1" - ethereumjs-util "^5.0.0" - merkle-patricia-tree "^2.1.2" - -ethereumjs-common@^1.1.0, ethereumjs-common@^1.3.2, ethereumjs-common@^1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz#2065dbe9214e850f2e955a80e650cb6999066979" - integrity sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA== - -ethereumjs-tx@^1.0.0, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" - integrity sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA== - dependencies: - ethereum-common "^0.0.18" - ethereumjs-util "^5.0.0" - -ethereumjs-tx@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz#5dfe7688bf177b45c9a23f86cf9104d47ea35fed" - integrity sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw== - dependencies: - ethereumjs-common "^1.5.0" - ethereumjs-util "^6.0.0" - -ethereumjs-util@^5.0.0, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.5: - version "5.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz#a833f0e5fca7e5b361384dc76301a721f537bf65" - integrity sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ== - dependencies: - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "^0.1.3" - rlp "^2.0.0" - safe-buffer "^5.1.1" - -ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" - integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.3" - -ethereumjs-util@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.4.tgz#f4b2022a91416bf421b35b0d5b81c21e8abd8b7f" - integrity sha512-isldtbCn9fdnhBPxedMNbFkNWVZ8ZdQvKRDSrdflame/AycAPKMer+vEpndpBxYIB3qxN6bd3Gh1YCQW9LDkCQ== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.4" - -ethereumjs-vm@^2.3.4, ethereumjs-vm@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz#76243ed8de031b408793ac33907fb3407fe400c6" - integrity sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw== - dependencies: - async "^2.1.2" - async-eventemitter "^0.2.2" - ethereumjs-account "^2.0.3" - ethereumjs-block "~2.2.0" - ethereumjs-common "^1.1.0" - ethereumjs-util "^6.0.0" - fake-merkle-patricia-tree "^1.0.1" - functional-red-black-tree "^1.0.1" - merkle-patricia-tree "^2.3.2" - rustbn.js "~0.2.0" - safe-buffer "^5.1.1" - -ethereumjs-wallet@^0.6.3: - version "0.6.5" - resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.5.tgz#685e9091645cee230ad125c007658833991ed474" - integrity sha512-MDwjwB9VQVnpp/Dc1XzA6J1a3wgHQ4hSvA1uWNatdpOrtCbPVuQSKSyRnjLvS0a+KKMw2pvQ9Ybqpb3+eW8oNA== - dependencies: - aes-js "^3.1.1" - bs58check "^2.1.2" - ethereum-cryptography "^0.1.3" - ethereumjs-util "^6.0.0" - randombytes "^2.0.6" - safe-buffer "^5.1.2" - scryptsy "^1.2.1" - utf8 "^3.0.0" - uuid "^3.3.2" - -ethereumjs-wallet@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-1.0.0.tgz#d6e2d7eddadbbf3d171050c1324eaec5b2981ecb" - integrity sha512-2zE4pxEL/ssTmBpYpf9ZE63lQ19aC8ANpprxC4+R7+/Q5n/YvPlKLzJEkkofiaPL12fHKlmjrB3FOXqLl6I3Rw== - dependencies: - aes-js "^3.1.1" - bs58check "^2.1.2" - ethereum-cryptography "^0.1.3" - ethereumjs-util "^7.0.2" - randombytes "^2.0.6" - scrypt-js "^3.0.1" - utf8 "^3.0.0" - uuid "^3.3.2" - -ethers@4.0.0-beta.3: - version "4.0.0-beta.3" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.0-beta.3.tgz#15bef14e57e94ecbeb7f9b39dd0a4bd435bc9066" - integrity sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog== - dependencies: - "@types/node" "^10.3.2" - aes-js "3.0.0" - bn.js "^4.4.0" - elliptic "6.3.3" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.3" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - -ethers@^4.0.0-beta.1, ethers@^4.0.32: - version "4.0.48" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.48.tgz#330c65b8133e112b0613156e57e92d9009d8fbbe" - integrity sha512-sZD5K8H28dOrcidzx9f8KYh8083n5BexIO3+SbE4jK83L85FxtpXZBCQdXb8gkg+7sBqomcLhhkU7UHL+F7I2g== - dependencies: - aes-js "3.0.0" - bn.js "^4.4.0" - elliptic "6.5.3" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.4" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - -ethjs-unit@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" - integrity sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk= - dependencies: - bn.js "4.11.6" - number-to-bn "1.7.0" - -ethjs-util@0.1.6, ethjs-util@^0.1.3: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" - integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== - dependencies: - is-hex-prefixed "1.0.0" - strip-hex-prefix "1.0.0" - -eventemitter3@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" - integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== - -eventemitter3@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" - integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== - -eventemitter3@^4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -events@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" - integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== - -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -express@^4.14.0: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== - dependencies: - accepts "~1.3.7" - array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" - content-type "~1.0.4" - cookie "0.4.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "~1.1.2" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" - range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" - statuses "~1.5.0" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -ext@^1.1.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" - integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== - dependencies: - type "^2.0.0" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fake-merkle-patricia-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" - integrity sha1-S4w6z7Ugr635hgsfFM2M40As3dM= - dependencies: - checkpoint-store "^1.1.0" - -fast-deep-equal@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-safe-stringify@^2.0.6: - version "2.0.7" - resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" - integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== - -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= - dependencies: - pend "~1.2.0" - -fetch-ponyfill@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" - integrity sha1-rjzl9zLGReq4fkroeTQUcJsjmJM= - dependencies: - node-fetch "~1.7.1" - -file-type@^3.8.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" - integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek= - -file-type@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" - integrity sha1-LdvqfHP/42No365J3DOMBYwritY= - -file-type@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919" - integrity sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg== - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - -find-up@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-up@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -flat@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" - integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== - dependencies: - is-buffer "~2.0.3" - -flat@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -fs-extra@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" - integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-minipass@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@~2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= - -get-stream@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" - integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4= - dependencies: - object-assign "^4.0.1" - pinkie-promise "^2.0.0" - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -get-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -glob-parent@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== - dependencies: - is-glob "^4.0.1" - -glob@7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global@~4.3.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" - integrity sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8= - dependencies: - min-document "^2.19.0" - process "~0.5.1" - -got@9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" - integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== - dependencies: - "@sindresorhus/is" "^0.14.0" - "@szmarczak/http-timer" "^1.1.2" - cacheable-request "^6.0.0" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^4.1.0" - lowercase-keys "^1.0.1" - mimic-response "^1.0.1" - p-cancelable "^1.0.0" - to-readable-stream "^1.0.0" - url-parse-lax "^3.0.0" - -got@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" - integrity sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw== - dependencies: - decompress-response "^3.2.0" - duplexer3 "^0.1.4" - get-stream "^3.0.0" - is-plain-obj "^1.1.0" - is-retry-allowed "^1.0.0" - is-stream "^1.0.0" - isurl "^1.0.0-alpha5" - lowercase-keys "^1.0.0" - p-cancelable "^0.3.0" - p-timeout "^1.1.1" - safe-buffer "^5.0.1" - timed-out "^4.0.0" - url-parse-lax "^1.0.0" - url-to-options "^1.0.1" - -graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-symbol-support-x@^1.4.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" - integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== - -has-symbols@^1.0.0, has-symbols@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== - -has-to-string-tag-x@^1.2.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" - integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== - dependencies: - has-symbol-support-x "^1.4.1" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" - integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.0" - -hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -he@1.2.0, he@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -highlight.js@^9.12.0, highlight.js@^9.15.8: - version "9.18.3" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.3.tgz#a1a0a2028d5e3149e2380f8a865ee8516703d634" - integrity sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ== - -highlightjs-solidity@^1.0.18: - version "1.0.18" - resolved "https://registry.yarnpkg.com/highlightjs-solidity/-/highlightjs-solidity-1.0.18.tgz#3deb0593689a26fbadf98e631bf2cd305a6417c9" - integrity sha512-k15h0br4oCRT0F0jTRuZbimerVt5V4n0k25h7oWi0kVqlBNeXPbSr5ddw02/2ukJmYfB8jauFDmxSauJjwM7Eg== - -hmac-drbg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -hooked-web3-provider@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hooked-web3-provider/-/hooked-web3-provider-1.0.0.tgz#07c94db32d857b966e74d1111b5a54bfb8533a17" - integrity sha1-B8lNsy2Fe5ZudNERG1pUv7hTOhc= - dependencies: - web3 "0.15.1" - -htmlparser2@^3.9.1: - version "3.10.1" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" - integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== - dependencies: - domelementtype "^1.3.1" - domhandler "^2.3.0" - domutils "^1.5.1" - entities "^1.1.1" - inherits "^2.0.1" - readable-stream "^3.1.1" - -http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-https@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" - integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs= - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -husky@^0.14.3: - version "0.14.3" - resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" - integrity sha512-e21wivqHpstpoiWA/Yi8eFti8E+sQDSS53cpJsPptPs295QTOQR0ZwnHo2TXy1XOpZFD9rPOd3NpmqTK6uMLJA== - dependencies: - is-ci "^1.0.10" - normalize-path "^1.0.0" - strip-indent "^2.0.0" - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01" - integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -idna-uts46-hx@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" - integrity sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA== - dependencies: - punycode "2.1.0" - -ieee754@^1.1.13, ieee754@^1.1.4: - version "1.1.13" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" - integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== - -immediate@^3.2.3: - version "3.3.0" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" - integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ip-regex@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.2.0.tgz#a03f5eb661d9a154e3973a03de8b23dd0ad6892e" - integrity sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-arguments@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.0.4.tgz#3faf966c7cba0ff437fb31f6250082fcf0448cf3" - integrity sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-buffer@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.4.tgz#3e572f23c8411a5cfd9557c849e3665e0b290623" - integrity sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A== - -is-callable@^1.1.4, is-callable@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.0.tgz#83336560b54a38e35e3a2df7afd0454d691468bb" - integrity sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw== - -is-ci@^1.0.10: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" - integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== - dependencies: - ci-info "^1.5.0" - -is-date-object@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" - integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fn@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" - integrity sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw= - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-function@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" - integrity sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-hex-prefixed@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" - integrity sha1-fY035q135dEnFIkTxXPggtd39VQ= - -is-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.1.tgz#520dafc4307bb8ebc33b813de5ce7c9400d644a1" - integrity sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw== - -is-natural-number@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" - integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" - integrity sha1-iVJojF7C/9awPsyF52ngKQMINHA= - -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - -is-plain-obj@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-regex@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" - integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== - dependencies: - has-symbols "^1.0.1" - -is-retry-allowed@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" - integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== - -is-set@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.1.tgz#d1604afdab1724986d30091575f54945da7e5f43" - integrity sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA== - -is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-string@^1.0.4, is-string@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" - integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== - -is-symbol@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" - integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== - dependencies: - has-symbols "^1.0.1" - -is-typedarray@^1.0.0, is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= - -isarray@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -iso-url@~0.4.7: - version "0.4.7" - resolved "https://registry.yarnpkg.com/iso-url/-/iso-url-0.4.7.tgz#de7e48120dae46921079fe78f325ac9e9217a385" - integrity sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog== - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -isurl@^1.0.0-alpha5: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" - integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== - dependencies: - has-to-string-tag-x "^1.2.0" - is-object "^1.0.1" - -iterate-iterator@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/iterate-iterator/-/iterate-iterator-1.0.1.tgz#1693a768c1ddd79c969051459453f082fe82e9f6" - integrity sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw== - -iterate-value@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/iterate-value/-/iterate-value-1.0.2.tgz#935115bd37d006a52046535ebc8d07e9c9337f57" - integrity sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ== - dependencies: - es-get-iterator "^1.0.2" - iterate-iterator "^1.0.1" - -js-sha256@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" - integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== - -js-sha3@0.5.7, js-sha3@^0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= - -js-sha3@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - -js-yaml@3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@3.14.0: - version "3.14.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" - integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= - -json-rpc-engine@^5.1.3: - version "5.3.0" - resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-5.3.0.tgz#7dc7291766b28766ebda33eb6d3f4c6301c44ff4" - integrity sha512-+diJ9s8rxB+fbJhT7ZEf8r8spaLRignLd8jTgQ/h5JSGppAHGtNMZtCoabipCaleR1B3GTGxbXBOqhaJSGmPGQ== - dependencies: - eth-rpc-errors "^3.0.0" - safe-event-emitter "^1.0.1" - -json-rpc-random-id@^1.0.0, json-rpc-random-id@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" - integrity sha1-uknZat7RRE27jaPSA3SKy7zeyMg= - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= - dependencies: - jsonify "~0.0.0" - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json-text-sequence@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/json-text-sequence/-/json-text-sequence-0.1.1.tgz#a72f217dc4afc4629fff5feb304dc1bd51a2f3d2" - integrity sha1-py8hfcSvxGKf/1/rME3BvVGi89I= - dependencies: - delimit-stream "0.1.0" - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -keccak@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.1.tgz#ae30a0e94dbe43414f741375cff6d64c8bea0bff" - integrity sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -keyv@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" - integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== - dependencies: - json-buffer "3.0.0" - -level-codec@~7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" - integrity sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ== - -level-errors@^1.0.3: - version "1.1.2" - resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" - integrity sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w== - dependencies: - errno "~0.1.1" - -level-errors@~1.0.3: - version "1.0.5" - resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.0.5.tgz#83dbfb12f0b8a2516bdc9a31c4876038e227b859" - integrity sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig== - dependencies: - errno "~0.1.1" - -level-iterator-stream@~1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz#e43b78b1a8143e6fa97a4f485eb8ea530352f2ed" - integrity sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0= - dependencies: - inherits "^2.0.1" - level-errors "^1.0.3" - readable-stream "^1.0.33" - xtend "^4.0.0" - -level-ws@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" - integrity sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos= - dependencies: - readable-stream "~1.0.15" - xtend "~2.1.1" - -levelup@^1.2.1: - version "1.3.9" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-1.3.9.tgz#2dbcae845b2bb2b6bea84df334c475533bbd82ab" - integrity sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ== - dependencies: - deferred-leveldown "~1.2.1" - level-codec "~7.0.0" - level-errors "~1.0.3" - level-iterator-stream "~1.3.0" - prr "~1.0.1" - semver "~5.4.1" - xtend "~4.0.0" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= - -lodash.escaperegexp@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" - integrity sha1-ZHYsSGGAglGKw99Mz11YhtriA0c= - -lodash.flatmap@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.flatmap/-/lodash.flatmap-4.5.0.tgz#ef8cbf408f6e48268663345305c6acc0b778702e" - integrity sha1-74y/QI9uSCaGYzRTBcaswLd4cC4= - -lodash.isequal@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lodash.partition@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.partition/-/lodash.partition-4.6.0.tgz#a38e46b73469e0420b0da1212e66d414be364ba4" - integrity sha1-o45GtzRp4EILDaEhLmbUFL42S6Q= - -lodash.sum@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/lodash.sum/-/lodash.sum-4.0.2.tgz#ad90e397965d803d4f1ff7aa5b2d0197f3b4637b" - integrity sha1-rZDjl5ZdgD1PH/eqWy0Bl/O0Y3s= - -lodash@^4.15.0, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-symbols@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - -log-symbols@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" - integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== - dependencies: - chalk "^4.0.0" - -lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - -ltgt@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" - integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= - -make-dir@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" - integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== - dependencies: - pify "^3.0.0" - -make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -memdown@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" - integrity sha1-tOThkhdGZP+65BNhqlAPMRnv4hU= - dependencies: - abstract-leveldown "~2.7.1" - functional-red-black-tree "^1.0.1" - immediate "^3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.1.1" - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -merkle-patricia-tree@^2.1.2, merkle-patricia-tree@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz#982ca1b5a0fde00eed2f6aeed1f9152860b8208a" - integrity sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g== - dependencies: - async "^1.4.2" - ethereumjs-util "^5.0.0" - level-ws "0.0.0" - levelup "^1.2.1" - memdown "^1.0.0" - readable-stream "^2.0.0" - rlp "^2.0.0" - semaphore ">=1.0.1" - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - -mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mimic-response@^1.0.0, mimic-response@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -min-document@^2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= - dependencies: - dom-walk "^0.1.0" - -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.0, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - -mkdirp-promise@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" - integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= - dependencies: - mkdirp "*" - -mkdirp@*: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mocha@8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.0.1.tgz#fe01f0530362df271aa8f99510447bc38b88d8ed" - integrity sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg== - dependencies: - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.3.1" - debug "3.2.6" - diff "4.0.2" - escape-string-regexp "1.0.5" - find-up "4.1.0" - glob "7.1.6" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" - minimatch "3.0.4" - ms "2.1.2" - object.assign "4.1.0" - promise.allsettled "1.0.2" - serialize-javascript "3.0.0" - strip-json-comments "3.0.1" - supports-color "7.1.0" - which "2.0.2" - wide-align "1.1.3" - workerpool "6.0.0" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" - -mocha@^8.2.1: - version "8.2.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.2.1.tgz#f2fa68817ed0e53343d989df65ccd358bc3a4b39" - integrity sha512-cuLBVfyFfFqbNR0uUKbDGXKGk+UDFe6aR4os78XIrMQpZl/nv7JYHcvP5MFIAb374b2zFXsdgEGwmzMtP0Xg8w== - dependencies: - "@ungap/promise-all-settled" "1.1.2" - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.4.3" - debug "4.2.0" - diff "4.0.2" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.1.6" - growl "1.10.5" - he "1.2.0" - js-yaml "3.14.0" - log-symbols "4.0.0" - minimatch "3.0.4" - ms "2.1.2" - nanoid "3.1.12" - serialize-javascript "5.0.1" - strip-json-comments "3.1.1" - supports-color "7.2.0" - which "2.0.2" - wide-align "1.1.3" - workerpool "6.0.2" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "2.0.0" - -mock-fs@^4.1.0: - version "4.12.0" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.12.0.tgz#a5d50b12d2d75e5bec9dac3b67ffe3c41d31ade4" - integrity sha512-/P/HtrlvBxY4o/PzXY9cCNBrdylDNxg7gnrv2sMNxj+UJ2m8jSpl0/A6fuJeNAWr99ZvGWH8XCbE0vmnM5KupQ== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -ms@2.1.2, ms@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -multibase@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.7.0.tgz#1adfc1c50abe05eefeb5091ac0c2728d6b84581b" - integrity sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg== - dependencies: - base-x "^3.0.8" - buffer "^5.5.0" - -multibase@~0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.6.1.tgz#b76df6298536cc17b9f6a6db53ec88f85f8cc12b" - integrity sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw== - dependencies: - base-x "^3.0.8" - buffer "^5.5.0" - -multicodec@^0.5.5: - version "0.5.7" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-0.5.7.tgz#1fb3f9dd866a10a55d226e194abba2dcc1ee9ffd" - integrity sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA== - dependencies: - varint "^5.0.0" - -multicodec@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-1.0.4.tgz#46ac064657c40380c28367c90304d8ed175a714f" - integrity sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg== - dependencies: - buffer "^5.6.0" - varint "^5.0.0" - -multihashes@^0.4.15, multihashes@~0.4.15: - version "0.4.21" - resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.21.tgz#dc02d525579f334a7909ade8a122dabb58ccfcb5" - integrity sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw== - dependencies: - buffer "^5.5.0" - multibase "^0.7.0" - varint "^5.0.0" - -nan@^2.14.0: - version "2.14.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" - integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw== - -nano-json-stream-parser@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" - integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= - -nanoid@3.1.12: - version "3.1.12" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654" - integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A== - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -next-tick@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= - -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-fetch@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" - integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= - -node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -node-fetch@~1.7.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" - -node-gyp-build@^4.2.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" - integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== - -node-gyp-build@~3.7.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-3.7.0.tgz#daa77a4f547b9aed3e2aac779eaf151afd60ec8d" - integrity sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w== - -normalize-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" - integrity sha1-MtDkcvkf80VwHBWoMRAY07CpA3k= - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -normalize-url@^4.1.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" - integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== - -nth-check@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" - integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== - dependencies: - boolbase "~1.0.0" - -number-to-bn@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" - integrity sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA= - dependencies: - bn.js "4.11.6" - strip-hex-prefix "1.0.0" - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-inspect@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" - integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== - -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object-keys@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" - integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= - -object.assign@4.1.0, object.assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -oboe@2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" - integrity sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY= - dependencies: - http-https "^1.0.0" - -oboe@2.1.5: - version "2.1.5" - resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.5.tgz#5554284c543a2266d7a38f17e073821fbde393cd" - integrity sha1-VVQoTFQ6ImbXo48X4HOCH73jk80= - dependencies: - http-https "^1.0.0" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -openzeppelin-solidity@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/openzeppelin-solidity/-/openzeppelin-solidity-3.1.0.tgz#bc43306bf59f90a3fa7d97c42209617360d51a74" - integrity sha512-+MatFtoqicq5Pc4zkICs8g8gUyULU5HvyBn+OJRoYBHr0Pm3F/9sav3ZgL9npWtRFAIxzM9ryjQ9kKLwt05Imw== - -original-require@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/original-require/-/original-require-1.0.1.tgz#0f130471584cd33511c5ec38c8d59213f9ac5e20" - integrity sha1-DxMEcVhM0zURxew4yNWSE/msXiA= - -p-cancelable@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" - integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== - -p-cancelable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" - integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-limit@^2.0.0, p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.0.2.tgz#1664e010af3cadc681baafd3e2a437be7b0fb5fe" - integrity sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg== - dependencies: - p-try "^2.0.0" - -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-timeout@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" - integrity sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y= - dependencies: - p-finally "^1.0.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -pako@^1.0.4: - version "1.0.11" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== - -parse-asn1@^5.0.0, parse-asn1@^5.1.5: - version "5.1.6" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" - integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== - dependencies: - asn1.js "^5.2.0" - browserify-aes "^1.0.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - -parse-headers@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.3.tgz#5e8e7512383d140ba02f0c7aa9f49b4399c92515" - integrity sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA== - -parse5@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" - integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA== - dependencies: - "@types/node" "*" - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -pathval@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" - integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA= - -pbkdf2@^3.0.17, pbkdf2@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.1.tgz#cb8724b0fada984596856d1a6ebafd3584654b94" - integrity sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - -picomatch@^2.0.4, picomatch@^2.0.7, picomatch@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== - -pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - -precond@0.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" - integrity sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw= - -prepend-http@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= - -prepend-http@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -process@~0.5.1: - version "0.5.2" - resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" - integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= - -promise-to-callback@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" - integrity sha1-XSp0kBC/tn2WNZj805YHRqaP7vc= - dependencies: - is-fn "^1.0.0" - set-immediate-shim "^1.0.1" - -promise.allsettled@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/promise.allsettled/-/promise.allsettled-1.0.2.tgz#d66f78fbb600e83e863d893e98b3d4376a9c47c9" - integrity sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg== - dependencies: - array.prototype.map "^1.0.1" - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - function-bind "^1.1.1" - iterate-value "^1.0.0" - -proxy-addr@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" - integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.1" - -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - -psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - -public-encrypt@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -punycode@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" - integrity sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0= - -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -query-string@^5.0.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" - integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== - dependencies: - decode-uri-component "^0.2.0" - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.0.6, randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - -randomhex@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/randomhex/-/randomhex-0.1.5.tgz#baceef982329091400f2a2912c6cd02f1094f585" - integrity sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU= - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - -readable-stream@^1.0.33: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@^2.0.0, readable-stream@^2.2.9, readable-stream@^2.3.0, readable-stream@^2.3.5: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^3.1.1, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@~1.0.15: - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readdirp@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.3.0.tgz#984458d13a1e42e2e9f5841b129e162f369aff17" - integrity sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ== - dependencies: - picomatch "^2.0.7" - -readdirp@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" - integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== - dependencies: - picomatch "^2.2.1" - -regenerator-runtime@^0.13.4: - version "0.13.7" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" - integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== - -request@^2.79.0, request@^2.85.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -resolve@^1.8.1: - version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== - dependencies: - path-parse "^1.0.6" - -responselike@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= - dependencies: - lowercase-keys "^1.0.0" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -rlp@^2.0.0, rlp@^2.2.3, rlp@^2.2.4: - version "2.2.6" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.6.tgz#c80ba6266ac7a483ef1e69e8e2f056656de2fb2c" - integrity sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg== - dependencies: - bn.js "^4.11.1" - -rustbn.js@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" - integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== - -rxjs@^6.6.3: - version "6.6.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" - integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== - dependencies: - tslib "^1.9.0" - -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-event-emitter@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" - integrity sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg== - dependencies: - events "^3.0.0" - -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -scrypt-js@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" - integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q= - -scrypt-js@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" - integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== - -scrypt-js@^3.0.0, scrypt-js@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" - integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== - -scryptsy@2.1.0, scryptsy@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-2.1.0.tgz#8d1e8d0c025b58fdd25b6fa9a0dc905ee8faa790" - integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== - -scryptsy@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" - integrity sha1-oyJfpLJST4AnAHYeKFW987LZIWM= - dependencies: - pbkdf2 "^3.0.3" - -secp256k1@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" - integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== - dependencies: - elliptic "^6.5.2" - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -seek-bzip@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.6.tgz#35c4171f55a680916b52a07859ecf3b5857f21c4" - integrity sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ== - dependencies: - commander "^2.8.1" - -semaphore@>=1.0.1, semaphore@^1.0.3: - version "1.1.0" - resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" - integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== - -semver@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" - integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== - -semver@^5.5.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@~5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" - integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== - -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.7.2" - mime "1.6.0" - ms "2.1.1" - on-finished "~2.3.0" - range-parser "~1.2.1" - statuses "~1.5.0" - -serialize-javascript@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-3.0.0.tgz#492e489a2d77b7b804ad391a5f5d97870952548e" - integrity sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw== - -serialize-javascript@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" - integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== - dependencies: - randombytes "^2.1.0" - -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.1" - -servify@^0.1.12: - version "0.1.12" - resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" - integrity sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw== - dependencies: - body-parser "^1.16.0" - cors "^2.8.1" - express "^4.14.0" - request "^2.79.0" - xhr "^2.3.3" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E= - -setimmediate@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" - integrity sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48= - -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -simple-concat@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" - integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== - -simple-get@^2.7.0: - version "2.8.1" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" - integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw== - dependencies: - decompress-response "^3.3.0" - once "^1.3.1" - simple-concat "^1.0.0" - -source-map-support@^0.5.17, source-map-support@^0.5.19, source-map-support@^0.5.6: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string.prototype.trimend@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" - integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - -string.prototype.trimstart@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" - integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-dirs@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" - integrity sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g== - dependencies: - is-natural-number "^4.0.1" - -strip-hex-prefix@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" - integrity sha1-DF8VX+8RUTczd96du1iNoFUA428= - dependencies: - is-hex-prefixed "1.0.0" - -strip-indent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" - integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= - -strip-json-comments@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" - integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== - -strip-json-comments@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -super-split@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/super-split/-/super-split-1.1.0.tgz#43b3ba719155f4d43891a32729d59b213d9155fc" - integrity sha512-I4bA5mgcb6Fw5UJ+EkpzqXfiuvVGS/7MuND+oBxNFmxu3ugLNrdIatzBLfhFRMVMLxgSsRy+TjIktgkF9RFSNQ== - -supports-color@7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" - integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== - dependencies: - has-flag "^4.0.0" - -supports-color@7.2.0, supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -swarm-js@0.1.39: - version "0.1.39" - resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.39.tgz#79becb07f291d4b2a178c50fee7aa6e10342c0e8" - integrity sha512-QLMqL2rzF6n5s50BptyD6Oi0R1aWlJC5Y17SRIVXRj6OR1DRIPM7nepvrxxkjA1zNzFz6mUOMjfeqeDaWB7OOg== - dependencies: - bluebird "^3.5.0" - buffer "^5.0.5" - decompress "^4.0.0" - eth-lib "^0.1.26" - fs-extra "^4.0.2" - got "^7.1.0" - mime-types "^2.1.16" - mkdirp-promise "^5.0.1" - mock-fs "^4.1.0" - setimmediate "^1.0.5" - tar "^4.0.2" - xhr-request-promise "^0.1.2" - -swarm-js@^0.1.40: - version "0.1.40" - resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.40.tgz#b1bc7b6dcc76061f6c772203e004c11997e06b99" - integrity sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA== - dependencies: - bluebird "^3.5.0" - buffer "^5.0.5" - eth-lib "^0.1.26" - fs-extra "^4.0.2" - got "^7.1.0" - mime-types "^2.1.16" - mkdirp-promise "^5.0.1" - mock-fs "^4.1.0" - setimmediate "^1.0.5" - tar "^4.0.2" - xhr-request "^1.0.1" - -tar-stream@^1.5.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" - integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== - dependencies: - bl "^1.0.0" - buffer-alloc "^1.2.0" - end-of-stream "^1.0.0" - fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.1" - xtend "^4.0.0" - -tar@^4.0.2: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - -through@^2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -timed-out@^4.0.0, timed-out@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= - -to-buffer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -to-readable-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" - integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -truffle-assertions@^0.9.2: - version "0.9.2" - resolved "https://registry.yarnpkg.com/truffle-assertions/-/truffle-assertions-0.9.2.tgz#0f8360f53ad92b6d8fdb8ceb5dce54c1fc392e23" - integrity sha512-9g2RhaxU2F8DeWhqoGQvL/bV8QVoSnQ6PY+ZPvYRP5eF7+/8LExb4mjLx/FeliLTjc3Tv1SABG05Gu5qQ/ErmA== - dependencies: - assertion-error "^1.1.0" - lodash.isequal "^4.5.0" - -truffle@^5.1.33: - version "5.1.41" - resolved "https://registry.yarnpkg.com/truffle/-/truffle-5.1.41.tgz#662a0f2816c4e5a12bae25c0b68d908478ff4606" - integrity sha512-6vphA82Os7HvrzqkMy0o2kxP0SYsf7glHE8U8jk15lbUNOy76SrBLmTi7at7xFkIq6LMgv03YRf0EFEN/qwAxg== - dependencies: - app-module-path "^2.2.0" - mocha "8.0.1" - original-require "1.0.1" - -ts-mocha@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-7.0.0.tgz#f1549b48b46f53d7ae1dccbb26313c7879acb190" - integrity sha512-7WfkQw1W6JZXG5m4E1w2e945uWzBoZqmnOHvpMu0v+zvyKLdUQeTtRMfcQsVEKsUnYL6nTyH4okRt2PZucmFXQ== - dependencies: - ts-node "7.0.1" - optionalDependencies: - tsconfig-paths "^3.5.0" - -ts-node@7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" - integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== - dependencies: - arrify "^1.0.0" - buffer-from "^1.1.0" - diff "^3.1.0" - make-error "^1.1.1" - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map-support "^0.5.6" - yn "^2.0.0" - -ts-node@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.0.0.tgz#e7699d2a110cc8c0d3b831715e417688683460b3" - integrity sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg== - dependencies: - arg "^4.1.0" - diff "^4.0.1" - make-error "^1.1.1" - source-map-support "^0.5.17" - yn "3.1.1" - -tsconfig-paths@^3.5.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b" - integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw== - dependencies: - "@types/json5" "^0.0.29" - json5 "^1.0.1" - minimist "^1.2.0" - strip-bom "^3.0.0" - -tslib@^1.9.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" - integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - -type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-is@~1.6.17, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - -type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.0.0.tgz#5f16ff6ef2eb44f260494dae271033b29c09a9c3" - integrity sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow== - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -typescript@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5" - integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg== - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== - -unbzip2-stream@^1.0.9: - version "1.4.3" - resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" - integrity sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg== - dependencies: - buffer "^5.2.1" - through "^2.3.8" - -underscore@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" - integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== - -underscore@^1.8.3: - version "1.11.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.11.0.tgz#dd7c23a195db34267186044649870ff1bab5929e" - integrity sha512-xY96SsN3NA461qIRKZ/+qox37YXPtSBswMGfiNptr+wrt6ds4HaMw23TP612fEyGekRE6LNRiLYr/aqbHXNedw== - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - -url-parse-lax@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= - dependencies: - prepend-http "^1.0.1" - -url-parse-lax@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= - dependencies: - prepend-http "^2.0.0" - -url-set-query@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" - integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= - -url-to-options@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= - -utf-8-validate@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.2.tgz#63cfbccd85dc1f2b66cf7a1d0eebc08ed056bfb3" - integrity sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw== - dependencies: - node-gyp-build "~3.7.0" - -utf8@3.0.0, utf8@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" - integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== - -utf8@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.2.tgz#1fa0d9270e9be850d9b05027f63519bf46457d96" - integrity sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY= - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -uuid@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" - integrity sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w= - -uuid@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -varint@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.0.tgz#d826b89f7490732fabc0c0ed693ed475dcb29ebf" - integrity sha1-2Ca4n3SQcy+rwMDtaT7Uddyynr8= - -vary@^1, vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -web3-bzz@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.1.tgz#c3bd1e8f0c02a13cd6d4e3c3e9e1713f144f6f0d" - integrity sha512-LdOO44TuYbGIPfL4ilkuS89GQovxUpmLz6C1UC7VYVVRILeZS740FVB3j9V4P4FHUk1RenaDfKhcntqgVCHtjw== - dependencies: - got "9.6.0" - swarm-js "0.1.39" - underscore "1.9.1" - -web3-bzz@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.11.tgz#41bc19a77444bd5365744596d778b811880f707f" - integrity sha512-XGpWUEElGypBjeFyUhTkiPXFbDVD6Nr/S5jznE3t8cWUA0FxRf1n3n/NuIZeb0H9RkN2Ctd/jNma/k8XGa3YKg== - dependencies: - "@types/node" "^12.12.6" - got "9.6.0" - swarm-js "^0.1.40" - underscore "1.9.1" - -web3-bzz@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.3.0.tgz#83dfd77fa8a64bbb660462dffd0fee2a02ef1051" - integrity sha512-ibYAnKab+sgTo/UdfbrvYfWblXjjgSMgyy9/FHa6WXS14n/HVB+HfWqGz2EM3fok8Wy5XoKGMvdqvERQ/mzq1w== - dependencies: - "@types/node" "^12.12.6" - got "9.6.0" - swarm-js "^0.1.40" - underscore "1.9.1" - -web3-core-helpers@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.1.tgz#f5f32d71c60a4a3bd14786118e633ce7ca6d5d0d" - integrity sha512-Gx3sTEajD5r96bJgfuW377PZVFmXIH4TdqDhgGwd2lZQCcMi+DA4TgxJNJGxn0R3aUVzyyE76j4LBrh412mXrw== - dependencies: - underscore "1.9.1" - web3-eth-iban "1.2.1" - web3-utils "1.2.1" - -web3-core-helpers@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.11.tgz#84c681ed0b942c0203f3b324a245a127e8c67a99" - integrity sha512-PEPoAoZd5ME7UfbnCZBdzIerpe74GEvlwT4AjOmHeCVZoIFk7EqvOZDejJHt+feJA6kMVTdd0xzRNN295UhC1A== - dependencies: - underscore "1.9.1" - web3-eth-iban "1.2.11" - web3-utils "1.2.11" - -web3-core-helpers@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.3.0.tgz#697cc3246a7eaaaac64ea506828d861c981c3f31" - integrity sha512-+MFb1kZCrRctf7UYE7NCG4rGhSXaQJ/KF07di9GVK1pxy1K0+rFi61ZobuV1ky9uQp+uhhSPts4Zp55kRDB5sw== - dependencies: - underscore "1.9.1" - web3-eth-iban "1.3.0" - web3-utils "1.3.0" - -web3-core-method@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.1.tgz#9df1bafa2cd8be9d9937e01c6a47fc768d15d90a" - integrity sha512-Ghg2WS23qi6Xj8Od3VCzaImLHseEA7/usvnOItluiIc5cKs00WYWsNy2YRStzU9a2+z8lwQywPYp0nTzR/QXdQ== - dependencies: - underscore "1.9.1" - web3-core-helpers "1.2.1" - web3-core-promievent "1.2.1" - web3-core-subscriptions "1.2.1" - web3-utils "1.2.1" - -web3-core-method@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.11.tgz#f880137d1507a0124912bf052534f168b8d8fbb6" - integrity sha512-ff0q76Cde94HAxLDZ6DbdmKniYCQVtvuaYh+rtOUMB6kssa5FX0q3vPmixi7NPooFnbKmmZCM6NvXg4IreTPIw== - dependencies: - "@ethersproject/transactions" "^5.0.0-beta.135" - underscore "1.9.1" - web3-core-helpers "1.2.11" - web3-core-promievent "1.2.11" - web3-core-subscriptions "1.2.11" - web3-utils "1.2.11" - -web3-core-method@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.3.0.tgz#a71387af842aec7dbad5dbbd1130c14cc6c8beb3" - integrity sha512-h0yFDrYVzy5WkLxC/C3q+hiMnzxdWm9p1T1rslnuHgOp6nYfqzu/6mUIXrsS4h/OWiGJt+BZ0xVZmtC31HDWtg== - dependencies: - "@ethersproject/transactions" "^5.0.0-beta.135" - underscore "1.9.1" - web3-core-helpers "1.3.0" - web3-core-promievent "1.3.0" - web3-core-subscriptions "1.3.0" - web3-utils "1.3.0" - -web3-core-promievent@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.1.tgz#003e8a3eb82fb27b6164a6d5b9cad04acf733838" - integrity sha512-IVUqgpIKoeOYblwpex4Hye6npM0aMR+kU49VP06secPeN0rHMyhGF0ZGveWBrGvf8WDPI7jhqPBFIC6Jf3Q3zw== - dependencies: - any-promise "1.3.0" - eventemitter3 "3.1.2" - -web3-core-promievent@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.11.tgz#51fe97ca0ddec2f99bf8c3306a7a8e4b094ea3cf" - integrity sha512-il4McoDa/Ox9Agh4kyfQ8Ak/9ABYpnF8poBLL33R/EnxLsJOGQG2nZhkJa3I067hocrPSjEdlPt/0bHXsln4qA== - dependencies: - eventemitter3 "4.0.4" - -web3-core-promievent@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.3.0.tgz#e0442dd0a8989b6bdce09293976cee6d9237a484" - integrity sha512-blv69wrXw447TP3iPvYJpllkhW6B18nfuEbrfcr3n2Y0v1Jx8VJacNZFDFsFIcgXcgUIVCtOpimU7w9v4+rtaw== - dependencies: - eventemitter3 "4.0.4" - -web3-core-requestmanager@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.1.tgz#fa2e2206c3d738db38db7c8fe9c107006f5c6e3d" - integrity sha512-xfknTC69RfYmLKC+83Jz73IC3/sS2ZLhGtX33D4Q5nQ8yc39ElyAolxr9sJQS8kihOcM6u4J+8gyGMqsLcpIBg== - dependencies: - underscore "1.9.1" - web3-core-helpers "1.2.1" - web3-providers-http "1.2.1" - web3-providers-ipc "1.2.1" - web3-providers-ws "1.2.1" - -web3-core-requestmanager@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.11.tgz#fe6eb603fbaee18530293a91f8cf26d8ae28c45a" - integrity sha512-oFhBtLfOiIbmfl6T6gYjjj9igOvtyxJ+fjS+byRxiwFJyJ5BQOz4/9/17gWR1Cq74paTlI7vDGxYfuvfE/mKvA== - dependencies: - underscore "1.9.1" - web3-core-helpers "1.2.11" - web3-providers-http "1.2.11" - web3-providers-ipc "1.2.11" - web3-providers-ws "1.2.11" - -web3-core-requestmanager@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.3.0.tgz#c5b9a0304504c0e6cce6c90bc1a3bff82732aa1f" - integrity sha512-3yMbuGcomtzlmvTVqNRydxsx7oPlw3ioRL6ReF9PeNYDkUsZaUib+6Dp5eBt7UXh5X+SIn/xa1smhDHz5/HpAw== - dependencies: - underscore "1.9.1" - web3-core-helpers "1.3.0" - web3-providers-http "1.3.0" - web3-providers-ipc "1.3.0" - web3-providers-ws "1.3.0" - -web3-core-subscriptions@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.1.tgz#8c2368a839d4eec1c01a4b5650bbeb82d0e4a099" - integrity sha512-nmOwe3NsB8V8UFsY1r+sW6KjdOS68h8nuh7NzlWxBQT/19QSUGiERRTaZXWu5BYvo1EoZRMxCKyCQpSSXLc08g== - dependencies: - eventemitter3 "3.1.2" - underscore "1.9.1" - web3-core-helpers "1.2.1" - -web3-core-subscriptions@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.11.tgz#beca908fbfcb050c16f45f3f0f4c205e8505accd" - integrity sha512-qEF/OVqkCvQ7MPs1JylIZCZkin0aKK9lDxpAtQ1F8niEDGFqn7DT8E/vzbIa0GsOjL2fZjDhWJsaW+BSoAW1gg== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.2.11" - -web3-core-subscriptions@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.3.0.tgz#c2622ccd2b84f4687475398ff966b579dba0847e" - integrity sha512-MUUQUAhJDb+Nz3S97ExVWveH4utoUnsbPWP+q1HJH437hEGb4vunIb9KvN3hFHLB+aHJfPeStM/4yYTz5PeuyQ== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.3.0" - -web3-core@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.1.tgz#7278b58fb6495065e73a77efbbce781a7fddf1a9" - integrity sha512-5ODwIqgl8oIg/0+Ai4jsLxkKFWJYE0uLuE1yUKHNVCL4zL6n3rFjRMpKPokd6id6nJCNgeA64KdWQ4XfpnjdMg== - dependencies: - web3-core-helpers "1.2.1" - web3-core-method "1.2.1" - web3-core-requestmanager "1.2.1" - web3-utils "1.2.1" - -web3-core@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.11.tgz#1043cacc1becb80638453cc5b2a14be9050288a7" - integrity sha512-CN7MEYOY5ryo5iVleIWRE3a3cZqVaLlIbIzDPsvQRUfzYnvzZQRZBm9Mq+ttDi2STOOzc1MKylspz/o3yq/LjQ== - dependencies: - "@types/bn.js" "^4.11.5" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-core-requestmanager "1.2.11" - web3-utils "1.2.11" - -web3-core@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.3.0.tgz#b818903738461c1cca0163339e1d6d3fa51242cf" - integrity sha512-BwWvAaKJf4KFG9QsKRi3MNoNgzjI6szyUlgme1qNPxUdCkaS3Rdpa0VKYNHP7M/YTk82/59kNE66mH5vmoaXjA== - dependencies: - "@types/bn.js" "^4.11.5" - "@types/node" "^12.12.6" - bignumber.js "^9.0.0" - web3-core-helpers "1.3.0" - web3-core-method "1.3.0" - web3-core-requestmanager "1.3.0" - web3-utils "1.3.0" - -web3-eth-abi@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.1.tgz#9b915b1c9ebf82f70cca631147035d5419064689" - integrity sha512-jI/KhU2a/DQPZXHjo2GW0myEljzfiKOn+h1qxK1+Y9OQfTcBMxrQJyH5AP89O6l6NZ1QvNdq99ThAxBFoy5L+g== - dependencies: - ethers "4.0.0-beta.3" - underscore "1.9.1" - web3-utils "1.2.1" - -web3-eth-abi@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.11.tgz#a887494e5d447c2926d557a3834edd66e17af9b0" - integrity sha512-PkRYc0+MjuLSgg03QVWqWlQivJqRwKItKtEpRUaxUAeLE7i/uU39gmzm2keHGcQXo3POXAbOnMqkDvOep89Crg== - dependencies: - "@ethersproject/abi" "5.0.0-beta.153" - underscore "1.9.1" - web3-utils "1.2.11" - -web3-eth-abi@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.3.0.tgz#387b7ea9b38be69ad8856bc7b4e9a6a69bb4d22b" - integrity sha512-1OrZ9+KGrBeBRd3lO8upkpNua9+7cBsQAgor9wbA25UrcUYSyL8teV66JNRu9gFxaTbkpdrGqM7J/LXpraXWrg== - dependencies: - "@ethersproject/abi" "5.0.0-beta.153" - underscore "1.9.1" - web3-utils "1.3.0" - -web3-eth-accounts@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.1.tgz#2741a8ef337a7219d57959ac8bd118b9d68d63cf" - integrity sha512-26I4qq42STQ8IeKUyur3MdQ1NzrzCqPsmzqpux0j6X/XBD7EjZ+Cs0lhGNkSKH5dI3V8CJasnQ5T1mNKeWB7nQ== - dependencies: - any-promise "1.3.0" - crypto-browserify "3.12.0" - eth-lib "0.2.7" - scryptsy "2.1.0" - semver "6.2.0" - underscore "1.9.1" - uuid "3.3.2" - web3-core "1.2.1" - web3-core-helpers "1.2.1" - web3-core-method "1.2.1" - web3-utils "1.2.1" - -web3-eth-accounts@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.11.tgz#a9e3044da442d31903a7ce035a86d8fa33f90520" - integrity sha512-6FwPqEpCfKIh3nSSGeo3uBm2iFSnFJDfwL3oS9pyegRBXNsGRVpgiW63yhNzL0796StsvjHWwQnQHsZNxWAkGw== - dependencies: - crypto-browserify "3.12.0" - eth-lib "0.2.8" - ethereumjs-common "^1.3.2" - ethereumjs-tx "^2.1.1" - scrypt-js "^3.0.1" - underscore "1.9.1" - uuid "3.3.2" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-utils "1.2.11" - -web3-eth-accounts@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.3.0.tgz#010acf389b2bee6d5e1aecb2fe78bfa5c8f26c7a" - integrity sha512-/Q7EVW4L2wWUbNRtOTwAIrYvJid/5UnKMw67x/JpvRMwYC+e+744P536Ja6SG4X3MnzFvd3E/jruV4qa6k+zIw== - dependencies: - crypto-browserify "3.12.0" - eth-lib "0.2.8" - ethereumjs-common "^1.3.2" - ethereumjs-tx "^2.1.1" - scrypt-js "^3.0.1" - underscore "1.9.1" - uuid "3.3.2" - web3-core "1.3.0" - web3-core-helpers "1.3.0" - web3-core-method "1.3.0" - web3-utils "1.3.0" - -web3-eth-contract@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.1.tgz#3542424f3d341386fd9ff65e78060b85ac0ea8c4" - integrity sha512-kYFESbQ3boC9bl2rYVghj7O8UKMiuKaiMkxvRH5cEDHil8V7MGEGZNH0slSdoyeftZVlaWSMqkRP/chfnKND0g== - dependencies: - underscore "1.9.1" - web3-core "1.2.1" - web3-core-helpers "1.2.1" - web3-core-method "1.2.1" - web3-core-promievent "1.2.1" - web3-core-subscriptions "1.2.1" - web3-eth-abi "1.2.1" - web3-utils "1.2.1" - -web3-eth-contract@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.11.tgz#917065902bc27ce89da9a1da26e62ef663663b90" - integrity sha512-MzYuI/Rq2o6gn7vCGcnQgco63isPNK5lMAan2E51AJLknjSLnOxwNY3gM8BcKoy4Z+v5Dv00a03Xuk78JowFow== - dependencies: - "@types/bn.js" "^4.11.5" - underscore "1.9.1" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-core-promievent "1.2.11" - web3-core-subscriptions "1.2.11" - web3-eth-abi "1.2.11" - web3-utils "1.2.11" - -web3-eth-contract@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.3.0.tgz#c758340ac800788e29fa29edc8b0c0ac957b741c" - integrity sha512-3SCge4SRNCnzLxf0R+sXk6vyTOl05g80Z5+9/B5pERwtPpPWaQGw8w01vqYqsYBKC7zH+dxhMaUgVzU2Dgf7bQ== - dependencies: - "@types/bn.js" "^4.11.5" - underscore "1.9.1" - web3-core "1.3.0" - web3-core-helpers "1.3.0" - web3-core-method "1.3.0" - web3-core-promievent "1.3.0" - web3-core-subscriptions "1.3.0" - web3-eth-abi "1.3.0" - web3-utils "1.3.0" - -web3-eth-ens@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.1.tgz#a0e52eee68c42a8b9865ceb04e5fb022c2d971d5" - integrity sha512-lhP1kFhqZr2nnbu3CGIFFrAnNxk2veXpOXBY48Tub37RtobDyHijHgrj+xTh+mFiPokyrapVjpFsbGa+Xzye4Q== - dependencies: - eth-ens-namehash "2.0.8" - underscore "1.9.1" - web3-core "1.2.1" - web3-core-helpers "1.2.1" - web3-core-promievent "1.2.1" - web3-eth-abi "1.2.1" - web3-eth-contract "1.2.1" - web3-utils "1.2.1" - -web3-eth-ens@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.11.tgz#26d4d7f16d6cbcfff918e39832b939edc3162532" - integrity sha512-dbW7dXP6HqT1EAPvnniZVnmw6TmQEKF6/1KgAxbo8iBBYrVTMDGFQUUnZ+C4VETGrwwaqtX4L9d/FrQhZ6SUiA== - dependencies: - content-hash "^2.5.2" - eth-ens-namehash "2.0.8" - underscore "1.9.1" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-promievent "1.2.11" - web3-eth-abi "1.2.11" - web3-eth-contract "1.2.11" - web3-utils "1.2.11" - -web3-eth-ens@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.3.0.tgz#0887ba38473c104cf5fb8a715828b3b354fa02a2" - integrity sha512-WnOru+EcuM5dteiVYJcHXo/I7Wq+ei8RrlS2nir49M0QpYvUPGbCGgTbifcjJQTWamgORtWdljSA1s2Asdb74w== - dependencies: - content-hash "^2.5.2" - eth-ens-namehash "2.0.8" - underscore "1.9.1" - web3-core "1.3.0" - web3-core-helpers "1.3.0" - web3-core-promievent "1.3.0" - web3-eth-abi "1.3.0" - web3-eth-contract "1.3.0" - web3-utils "1.3.0" - -web3-eth-iban@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.1.tgz#2c3801718946bea24e9296993a975c80b5acf880" - integrity sha512-9gkr4QPl1jCU+wkgmZ8EwODVO3ovVj6d6JKMos52ggdT2YCmlfvFVF6wlGLwi0VvNa/p+0BjJzaqxnnG/JewjQ== - dependencies: - bn.js "4.11.8" - web3-utils "1.2.1" - -web3-eth-iban@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.11.tgz#f5f73298305bc7392e2f188bf38a7362b42144ef" - integrity sha512-ozuVlZ5jwFC2hJY4+fH9pIcuH1xP0HEFhtWsR69u9uDIANHLPQQtWYmdj7xQ3p2YT4bQLq/axKhZi7EZVetmxQ== - dependencies: - bn.js "^4.11.9" - web3-utils "1.2.11" - -web3-eth-iban@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.3.0.tgz#15b782dfaf273ebc4e3f389f1367f4e88ddce4a5" - integrity sha512-v9mZWhR4fPF17/KhHLiWir4YHWLe09O3B/NTdhWqw3fdAMJNztzMHGzgHxA/4fU+rhrs/FhDzc4yt32zMEXBZw== - dependencies: - bn.js "^4.11.9" - web3-utils "1.3.0" - -web3-eth-personal@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.1.tgz#244e9911b7b482dc17c02f23a061a627c6e47faf" - integrity sha512-RNDVSiaSoY4aIp8+Hc7z+X72H7lMb3fmAChuSBADoEc7DsJrY/d0R5qQDK9g9t2BO8oxgLrLNyBP/9ub2Hc6Bg== - dependencies: - web3-core "1.2.1" - web3-core-helpers "1.2.1" - web3-core-method "1.2.1" - web3-net "1.2.1" - web3-utils "1.2.1" - -web3-eth-personal@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.11.tgz#a38b3942a1d87a62070ce0622a941553c3d5aa70" - integrity sha512-42IzUtKq9iHZ8K9VN0vAI50iSU9tOA1V7XU2BhF/tb7We2iKBVdkley2fg26TxlOcKNEHm7o6HRtiiFsVK4Ifw== - dependencies: - "@types/node" "^12.12.6" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-net "1.2.11" - web3-utils "1.2.11" - -web3-eth-personal@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.3.0.tgz#d376e03dc737d961ff1f8d1aca866efad8477135" - integrity sha512-2czUhElsJdLpuNfun9GeLiClo5O6Xw+bLSjl3f4bNG5X2V4wcIjX2ygep/nfstLLtkz8jSkgl/bV7esANJyeRA== - dependencies: - "@types/node" "^12.12.6" - web3-core "1.3.0" - web3-core-helpers "1.3.0" - web3-core-method "1.3.0" - web3-net "1.3.0" - web3-utils "1.3.0" - -web3-eth@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.1.tgz#b9989e2557c73a9e8ffdc107c6dafbe72c79c1b0" - integrity sha512-/2xly4Yry5FW1i+uygPjhfvgUP/MS/Dk+PDqmzp5M88tS86A+j8BzKc23GrlA8sgGs0645cpZK/999LpEF5UdA== - dependencies: - underscore "1.9.1" - web3-core "1.2.1" - web3-core-helpers "1.2.1" - web3-core-method "1.2.1" - web3-core-subscriptions "1.2.1" - web3-eth-abi "1.2.1" - web3-eth-accounts "1.2.1" - web3-eth-contract "1.2.1" - web3-eth-ens "1.2.1" - web3-eth-iban "1.2.1" - web3-eth-personal "1.2.1" - web3-net "1.2.1" - web3-utils "1.2.1" - -web3-eth@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.11.tgz#4c81fcb6285b8caf544058fba3ae802968fdc793" - integrity sha512-REvxW1wJ58AgHPcXPJOL49d1K/dPmuw4LjPLBPStOVkQjzDTVmJEIsiLwn2YeuNDd4pfakBwT8L3bz1G1/wVsQ== - dependencies: - underscore "1.9.1" - web3-core "1.2.11" - web3-core-helpers "1.2.11" - web3-core-method "1.2.11" - web3-core-subscriptions "1.2.11" - web3-eth-abi "1.2.11" - web3-eth-accounts "1.2.11" - web3-eth-contract "1.2.11" - web3-eth-ens "1.2.11" - web3-eth-iban "1.2.11" - web3-eth-personal "1.2.11" - web3-net "1.2.11" - web3-utils "1.2.11" - -web3-eth@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.3.0.tgz#898e5f5a8827f9bc6844e267a52eb388916a6771" - integrity sha512-/bzJcxXPM9EM18JM5kO2JjZ3nEqVo3HxqU93aWAEgJNqaP/Lltmufl2GpvIB2Hvj+FXAjAXquxUdQ2/xP7BzHQ== - dependencies: - underscore "1.9.1" - web3-core "1.3.0" - web3-core-helpers "1.3.0" - web3-core-method "1.3.0" - web3-core-subscriptions "1.3.0" - web3-eth-abi "1.3.0" - web3-eth-accounts "1.3.0" - web3-eth-contract "1.3.0" - web3-eth-ens "1.3.0" - web3-eth-iban "1.3.0" - web3-eth-personal "1.3.0" - web3-net "1.3.0" - web3-utils "1.3.0" - -web3-net@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.1.tgz#edd249503315dd5ab4fa00220f6509d95bb7ab10" - integrity sha512-Yt1Bs7WgnLESPe0rri/ZoPWzSy55ovioaP35w1KZydrNtQ5Yq4WcrAdhBzcOW7vAkIwrsLQsvA+hrOCy7mNauw== - dependencies: - web3-core "1.2.1" - web3-core-method "1.2.1" - web3-utils "1.2.1" - -web3-net@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.11.tgz#eda68ef25e5cdb64c96c39085cdb74669aabbe1b" - integrity sha512-sjrSDj0pTfZouR5BSTItCuZ5K/oZPVdVciPQ6981PPPIwJJkCMeVjD7I4zO3qDPCnBjBSbWvVnLdwqUBPtHxyg== - dependencies: - web3-core "1.2.11" - web3-core-method "1.2.11" - web3-utils "1.2.11" - -web3-net@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.3.0.tgz#b69068cccffab58911c2f08ca4abfbefb0f948c6" - integrity sha512-Xz02KylOyrB2YZzCkysEDrY7RbKxb7LADzx3Zlovfvuby7HBwtXVexXKtoGqksa+ns1lvjQLLQGb+OeLi7Sr7w== - dependencies: - web3-core "1.3.0" - web3-core-method "1.3.0" - web3-utils "1.3.0" - -"web3-provider-engine@https://github.com/MetaMask/web3-provider-engine.git": - version "15.0.12" - resolved "https://github.com/MetaMask/web3-provider-engine.git#15bc747a62b94509c7c9fc3211be7874382d4bc8" - dependencies: - async "^2.5.0" - backoff "^2.5.0" - clone "^2.0.0" - cross-fetch "^2.1.0" - eth-block-tracker "^4.4.2" - eth-json-rpc-errors "^2.0.2" - eth-json-rpc-filters "^4.1.1" - eth-json-rpc-infura "^4.0.1" - eth-json-rpc-middleware "^4.1.5" - eth-sig-util "^1.4.2" - ethereumjs-block "^1.2.2" - ethereumjs-tx "^1.2.0" - ethereumjs-util "^5.1.5" - ethereumjs-vm "^2.3.4" - json-stable-stringify "^1.0.1" - promise-to-callback "^1.0.0" - readable-stream "^2.2.9" - request "^2.85.0" - semaphore "^1.0.3" - ws "^5.1.1" - xhr "^2.2.0" - xtend "^4.0.1" - -web3-providers-http@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.1.tgz#c93ea003a42e7b894556f7e19dd3540f947f5013" - integrity sha512-BDtVUVolT9b3CAzeGVA/np1hhn7RPUZ6YYGB/sYky+GjeO311Yoq8SRDUSezU92x8yImSC2B+SMReGhd1zL+bQ== - dependencies: - web3-core-helpers "1.2.1" - xhr2-cookies "1.1.0" - -web3-providers-http@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.11.tgz#1cd03442c61670572d40e4dcdf1faff8bd91e7c6" - integrity sha512-psh4hYGb1+ijWywfwpB2cvvOIMISlR44F/rJtYkRmQ5jMvG4FOCPlQJPiHQZo+2cc3HbktvvSJzIhkWQJdmvrA== - dependencies: - web3-core-helpers "1.2.11" - xhr2-cookies "1.1.0" - -web3-providers-http@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.3.0.tgz#88227f64c88b32abed4359383c2663616e0dc531" - integrity sha512-cMKhUI6PqlY/EC+ZDacAxajySBu8AzW8jOjt1Pe/mbRQgS0rcZyvLePGTTuoyaA8C21F8UW+EE5jj7YsNgOuqA== - dependencies: - web3-core-helpers "1.3.0" - xhr2-cookies "1.1.0" - -web3-providers-ipc@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.1.tgz#017bfc687a8fc5398df2241eb98f135e3edd672c" - integrity sha512-oPEuOCwxVx8L4CPD0TUdnlOUZwGBSRKScCz/Ws2YHdr9Ium+whm+0NLmOZjkjQp5wovQbyBzNa6zJz1noFRvFA== - dependencies: - oboe "2.1.4" - underscore "1.9.1" - web3-core-helpers "1.2.1" - -web3-providers-ipc@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.11.tgz#d16d6c9be1be6e0b4f4536c4acc16b0f4f27ef21" - integrity sha512-yhc7Y/k8hBV/KlELxynWjJDzmgDEDjIjBzXK+e0rHBsYEhdCNdIH5Psa456c+l0qTEU2YzycF8VAjYpWfPnBpQ== - dependencies: - oboe "2.1.4" - underscore "1.9.1" - web3-core-helpers "1.2.11" - -web3-providers-ipc@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.3.0.tgz#d7c2b203733b46f7b4e7b15633d891648cf9a293" - integrity sha512-0CrLuRofR+1J38nEj4WsId/oolwQEM6Yl1sOt41S/6bNI7htdkwgVhSloFIMJMDFHtRw229QIJ6wIaKQz0X1Og== - dependencies: - oboe "2.1.5" - underscore "1.9.1" - web3-core-helpers "1.3.0" - -web3-providers-ws@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.1.tgz#2d941eaf3d5a8caa3214eff8dc16d96252b842cb" - integrity sha512-oqsQXzu+ejJACVHy864WwIyw+oB21nw/pI65/sD95Zi98+/HQzFfNcIFneF1NC4bVF3VNX4YHTNq2I2o97LAiA== - dependencies: - underscore "1.9.1" - web3-core-helpers "1.2.1" - websocket "github:web3-js/WebSocket-Node#polyfill/globalThis" - -web3-providers-ws@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.11.tgz#a1dfd6d9778d840561d9ec13dd453046451a96bb" - integrity sha512-ZxnjIY1Er8Ty+cE4migzr43zA/+72AF1myzsLaU5eVgdsfV7Jqx7Dix1hbevNZDKFlSoEyq/3j/jYalh3So1Zg== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.2.11" - websocket "^1.0.31" - -web3-providers-ws@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.3.0.tgz#84adeff65acd4624d7f5bb43c5b2b22d8f0f63a4" - integrity sha512-Im5MthhJnJst8nSoq0TgbyOdaiFQFa5r6sHPOVllhgIgViDqzbnlAFW9sNzQ0Q8VXPNfPIQKi9cOrHlSRNPjRw== - dependencies: - eventemitter3 "4.0.4" - underscore "1.9.1" - web3-core-helpers "1.3.0" - websocket "^1.0.32" - -web3-shh@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.1.tgz#4460e3c1e07faf73ddec24ccd00da46f89152b0c" - integrity sha512-/3Cl04nza5kuFn25bV3FJWa0s3Vafr5BlT933h26xovQ6HIIz61LmvNQlvX1AhFL+SNJOTcQmK1SM59vcyC8bA== - dependencies: - web3-core "1.2.1" - web3-core-method "1.2.1" - web3-core-subscriptions "1.2.1" - web3-net "1.2.1" - -web3-shh@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.11.tgz#f5d086f9621c9a47e98d438010385b5f059fd88f" - integrity sha512-B3OrO3oG1L+bv3E1sTwCx66injW1A8hhwpknDUbV+sw3fehFazA06z9SGXUefuFI1kVs4q2vRi0n4oCcI4dZDg== - dependencies: - web3-core "1.2.11" - web3-core-method "1.2.11" - web3-core-subscriptions "1.2.11" - web3-net "1.2.11" - -web3-shh@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.3.0.tgz#62d15297da8fb5f733dd1b98f9ade300590f4d49" - integrity sha512-IZTojA4VCwVq+7eEIHuL1tJXtU+LJDhO8Y2QmuwetEWW1iBgWCGPHZasipWP+7kDpSm/5lo5GRxL72FF/Os/tA== - dependencies: - web3-core "1.3.0" - web3-core-method "1.3.0" - web3-core-subscriptions "1.3.0" - web3-net "1.3.0" - -web3-utils@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.1.tgz#21466e38291551de0ab34558de21512ac4274534" - integrity sha512-Mrcn3l58L+yCKz3zBryM6JZpNruWuT0OCbag8w+reeNROSGVlXzUQkU+gtAwc9JCZ7tKUyg67+2YUGqUjVcyBA== - dependencies: - bn.js "4.11.8" - eth-lib "0.2.7" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randomhex "0.1.5" - underscore "1.9.1" - utf8 "3.0.0" - -web3-utils@1.2.11: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.11.tgz#af1942aead3fb166ae851a985bed8ef2c2d95a82" - integrity sha512-3Tq09izhD+ThqHEaWYX4VOT7dNPdZiO+c/1QMA0s5X2lDFKK/xHJb7cyTRRVzN2LvlHbR7baS1tmQhSua51TcQ== - dependencies: - bn.js "^4.11.9" - eth-lib "0.2.8" - ethereum-bloom-filters "^1.0.6" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - underscore "1.9.1" - utf8 "3.0.0" - -web3-utils@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.0.tgz#5bac16e5e0ec9fe7bdcfadb621655e8aa3cf14e1" - integrity sha512-2mS5axFCbkhicmoDRuJeuo0TVGQDgC2sPi/5dblfVC+PMtX0efrb8Xlttv/eGkq7X4E83Pds34FH98TP2WOUZA== - dependencies: - bn.js "^4.11.9" - eth-lib "0.2.8" - ethereum-bloom-filters "^1.0.6" - ethjs-unit "0.1.6" - number-to-bn "1.7.0" - randombytes "^2.1.0" - underscore "1.9.1" - utf8 "3.0.0" - -web3@*, web3@^1.0.0-beta.34: - version "1.2.11" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.11.tgz#50f458b2e8b11aa37302071c170ed61cff332975" - integrity sha512-mjQ8HeU41G6hgOYm1pmeH0mRAeNKJGnJEUzDMoerkpw7QUQT4exVREgF1MYPvL/z6vAshOXei25LE/t/Bxl8yQ== - dependencies: - web3-bzz "1.2.11" - web3-core "1.2.11" - web3-eth "1.2.11" - web3-eth-personal "1.2.11" - web3-net "1.2.11" - web3-shh "1.2.11" - web3-utils "1.2.11" - -web3@0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/web3/-/web3-0.15.1.tgz#65b17fd3be991de4983c3558cc1f0b9aab3a0a10" - integrity sha1-ZbF/076ZHeSYPDVYzB8Lmqs6ChA= - dependencies: - bignumber.js debris/bignumber.js#master - crypto-js "^3.1.4" - utf8 "^2.1.1" - xmlhttprequest "*" - -web3@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.1.tgz#5d8158bcca47838ab8c2b784a2dee4c3ceb4179b" - integrity sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw== - dependencies: - web3-bzz "1.2.1" - web3-core "1.2.1" - web3-eth "1.2.1" - web3-eth-personal "1.2.1" - web3-net "1.2.1" - web3-shh "1.2.1" - web3-utils "1.2.1" - -web3@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.3.0.tgz#8fe4cd6e2a21c91904f343ba75717ee4c76bb349" - integrity sha512-4q9dna0RecnrlgD/bD1C5S+81Untbd6Z/TBD7rb+D5Bvvc0Wxjr4OP70x+LlnwuRDjDtzBwJbNUblh2grlVArw== - dependencies: - web3-bzz "1.3.0" - web3-core "1.3.0" - web3-eth "1.3.0" - web3-eth-personal "1.3.0" - web3-net "1.3.0" - web3-shh "1.3.0" - web3-utils "1.3.0" - -websocket@^1.0.31: - version "1.0.31" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.31.tgz#e5d0f16c3340ed87670e489ecae6144c79358730" - integrity sha512-VAouplvGKPiKFDTeCCO65vYHsyay8DqoBSlzIO3fayrfOgU94lQN5a1uWVnFrMLceTJw/+fQXR5PGbUVRaHshQ== - dependencies: - debug "^2.2.0" - es5-ext "^0.10.50" - nan "^2.14.0" - typedarray-to-buffer "^3.1.5" - yaeti "^0.0.6" - -websocket@^1.0.32: - version "1.0.32" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.32.tgz#1f16ddab3a21a2d929dec1687ab21cfdc6d3dbb1" - integrity sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q== - dependencies: - bufferutil "^4.0.1" - debug "^2.2.0" - es5-ext "^0.10.50" - typedarray-to-buffer "^3.1.5" - utf-8-validate "^5.0.2" - yaeti "^0.0.6" - -websocket@^1.0.33: - version "1.0.33" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.33.tgz#407f763fc58e74a3fa41ca3ae5d78d3f5e3b82a5" - integrity sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA== - dependencies: - bufferutil "^4.0.1" - debug "^2.2.0" - es5-ext "^0.10.50" - typedarray-to-buffer "^3.1.5" - utf-8-validate "^5.0.2" - yaeti "^0.0.6" - -"websocket@github:web3-js/WebSocket-Node#polyfill/globalThis": - version "1.0.29" - resolved "https://codeload.github.com/web3-js/WebSocket-Node/tar.gz/ef5ea2f41daf4a2113b80c9223df884b4d56c400" - dependencies: - debug "^2.2.0" - es5-ext "^0.10.50" - nan "^2.14.0" - typedarray-to-buffer "^3.1.5" - yaeti "^0.0.6" - -whatwg-fetch@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" - integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -workerpool@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.0.tgz#85aad67fa1a2c8ef9386a1b43539900f61d03d58" - integrity sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA== - -workerpool@6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.2.tgz#e241b43d8d033f1beb52c7851069456039d1d438" - integrity sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q== - -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@^3.0.0: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -ws@^5.1.1: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== - dependencies: - async-limiter "~1.0.0" - -xhr-request-promise@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" - integrity sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg== - dependencies: - xhr-request "^1.1.0" - -xhr-request@^1.0.1, xhr-request@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" - integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== - dependencies: - buffer-to-arraybuffer "^0.0.5" - object-assign "^4.1.1" - query-string "^5.0.1" - simple-get "^2.7.0" - timed-out "^4.0.1" - url-set-query "^1.0.0" - xhr "^2.0.4" - -xhr2-cookies@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" - integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= - dependencies: - cookiejar "^2.1.1" - -xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: - version "2.5.0" - resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.5.0.tgz#bed8d1676d5ca36108667692b74b316c496e49dd" - integrity sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ== - dependencies: - global "~4.3.0" - is-function "^1.0.1" - parse-headers "^2.0.0" - xtend "^4.0.0" - -xmlhttprequest@*, xmlhttprequest@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= - -xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -xtend@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" - integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os= - dependencies: - object-keys "~0.4.0" - -xxhashjs@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/xxhashjs/-/xxhashjs-0.2.2.tgz#8a6251567621a1c46a5ae204da0249c7f8caa9d8" - integrity sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw== - dependencies: - cuint "^0.2.2" - -y18n@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" - integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== - -yaeti@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" - integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= - -yallist@^3.0.0, yallist@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yargs-parser@13.1.2, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== - dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" - -yargs-unparser@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" - integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== - dependencies: - camelcase "^6.0.0" - decamelize "^4.0.0" - flat "^5.0.2" - is-plain-obj "^2.1.0" - -yargs@13.3.2, yargs@^13.3.0: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - -yauzl@^2.4.2: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -yn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" - integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= diff --git a/ts-tests/upgrade-tester/package.json b/ts-tests/upgrade-tester/package.json index 402125ec..08b583db 100644 --- a/ts-tests/upgrade-tester/package.json +++ b/ts-tests/upgrade-tester/package.json @@ -16,11 +16,12 @@ "generate-chainspec": "ts-node src/scripts/forker.ts" }, "dependencies": { - "@edgeware/node-types": "^3.1.0-beta.14", - "@polkadot/api": "3.2.4-3", - "@polkadot/keyring": "^5.2.2", - "@polkadot/util": "^5.2.2", - "@polkadot/util-crypto": "^5.2.2", + "@edgeware/node-types": "3.6.0-erup-4.1", + "@polkadot/api": "^4.12.1", + "@polkadot/keyring": "^6.6.1", + "@polkadot/util": "^6.6.1", + "@polkadot/util-crypto": "^6.6.1", + "@polkadot/wasm-crypto": "^4.0.2", "@types/chai": "^4.2.11", "@types/rimraf": "^3.0.0", "@types/underscore": "^1.10.24", diff --git a/ts-tests/upgrade-tester/src/index.ts b/ts-tests/upgrade-tester/src/index.ts index cdeda433..87c89983 100644 --- a/ts-tests/upgrade-tester/src/index.ts +++ b/ts-tests/upgrade-tester/src/index.ts @@ -6,8 +6,8 @@ import { factory, formatFilename } from './logging'; const log = factory.getLogger(formatFilename(__filename)); const CHAINSPEC = `${__dirname}/scripts/forker-data/fork.json`; -// const BINARY_PATH = '../../../edgeware-node-3.1.0/target/release/edgeware'; -const BINARY_PATH = '../../target/release/edgeware'; +const BINARY_PATH = '../../../../edgeware-node/target/release/edgeware'; +// const BINARY_PATH = '../../target/release/edgeware'; const CHAIN_BASE_PATH = `${__dirname}/../db`; const ACCOUNTS = [ '//Alice' ]; const SS58_PREFIX = 7; // edgeware ss58 @@ -26,12 +26,12 @@ async function main() { // TODO: make this a part of the arg initialization const tests: StateTest[] = []; tests.push( - new ((await import('./tests/staking')).default)(), - new ((await import('./tests/identity')).default)(), - new ((await import('./tests/democracy')).default)(), + // new ((await import('./tests/staking')).default)(), + // new ((await import('./tests/identity')).default)(), + // new ((await import('./tests/democracy')).default)(), new ((await import('./tests/council')).default)(), - new ((await import('./tests/treasury')).default)(), - new ((await import('./tests/storage')).default)(), + // new ((await import('./tests/treasury')).default)(), + // new ((await import('./tests/storage')).default)(), ); // construct tester diff --git a/ts-tests/upgrade-tester/src/scripts/forker.ts b/ts-tests/upgrade-tester/src/scripts/forker.ts index d5f5b4a5..a9fc174b 100644 --- a/ts-tests/upgrade-tester/src/scripts/forker.ts +++ b/ts-tests/upgrade-tester/src/scripts/forker.ts @@ -10,7 +10,7 @@ import { execFileSync, execSync } from 'child_process'; // input paths const binaryPath = '../../target/release/edgeware'; -const wasmPath = '../../../edgeware-node-3.1.0/edgeware_runtime.wasm'; +const wasmPath = '../../../../edgeware-node/edgeware_runtime.wasm'; // output paths const outputDir = path.join(__dirname, 'forker-data'); diff --git a/ts-tests/upgrade-tester/src/stateTest.ts b/ts-tests/upgrade-tester/src/stateTest.ts index 6a28a996..aa98243b 100644 --- a/ts-tests/upgrade-tester/src/stateTest.ts +++ b/ts-tests/upgrade-tester/src/stateTest.ts @@ -12,7 +12,7 @@ abstract class StateTest { // the publicly-displayable name of the test (usually set in the `super` call) public readonly name: string, ) { - this.accounts = createTestPairs(); + this.accounts = createTestPairs({ ss58Format: 7 }); } // checks if the test has completed diff --git a/ts-tests/upgrade-tester/src/testRunner.ts b/ts-tests/upgrade-tester/src/testRunner.ts index e83caf57..b6a0b6cc 100644 --- a/ts-tests/upgrade-tester/src/testRunner.ts +++ b/ts-tests/upgrade-tester/src/testRunner.ts @@ -140,6 +140,7 @@ class TestRunner { '--force-authoring', '--no-telemetry', '--no-prometheus', + '-linfo', ]; log.info(`Executing ${this.options.binaryPath} with args ${JSON.stringify(args)}`); this._chainProcess = child_process.spawn( @@ -338,7 +339,7 @@ class TestRunner { } // [5.] Upgrade chain via API - await this._doUpgrade(); + await this._doUpgrade(false); // [6.] Restart chain with upgraded binary (if needed) if (this.options.upgrade.binaryPath diff --git a/ts-tests/upgrade-tester/src/tests/council.ts b/ts-tests/upgrade-tester/src/tests/council.ts index 3511f89f..aab7f7ec 100644 --- a/ts-tests/upgrade-tester/src/tests/council.ts +++ b/ts-tests/upgrade-tester/src/tests/council.ts @@ -1,5 +1,5 @@ import { ApiPromise } from '@polkadot/api'; -import { BalanceOf, AccountId } from '@polkadot/types/interfaces'; +import { BalanceOf, AccountId, Voter } from '@polkadot/types/interfaces'; import { Vec } from '@polkadot/types'; import { ITuple } from '@polkadot/types/types'; import { assert } from 'chai'; @@ -9,7 +9,7 @@ import { makeTx } from '../util'; export default class extends StateTest { private _candidates: string[]; private _council: string[]; - private _charlieVotes: ITuple<[BalanceOf, Vec]>; + private _charlieVotes: Voter; constructor() { super('council test'); @@ -36,16 +36,18 @@ export default class extends StateTest { public async after(api: ApiPromise) { // confirm candidates unchanged - const candidates = (await api.query.elections.candidates()).map((c) => c.toString()); + const candidates = (await api.query.elections.candidates()).map((c) => c[0].toString()); assert.sameMembers(candidates, this._candidates); // confirm vote unchanged const charlieVotes = await api.query.elections.voting(this.accounts.charlie.address); - assert.equal(+charlieVotes[0], +this._charlieVotes[0]); - assert.sameMembers(charlieVotes[1].map((c) => c.toString()), this._charlieVotes[1].map((c) => c.toString())); + console.log(charlieVotes.toHuman(), this._charlieVotes.toHuman()); + assert.equal(+charlieVotes.deposit, +this._charlieVotes[0]); + assert.sameMembers(charlieVotes.votes.map((c) => c.toString()), this._charlieVotes[1].map((c) => c.toString())); // confirm council unchanged const council = (await api.query.council.members()).map((c) => c.toString()); + console.log('Council', council, this._council); assert.sameMembers(council, this._council); await super.after(api); } diff --git a/ts-tests/upgrade-tester/yarn.lock b/ts-tests/upgrade-tester/yarn.lock index ab5f744a..68b8fc67 100644 --- a/ts-tests/upgrade-tester/yarn.lock +++ b/ts-tests/upgrade-tester/yarn.lock @@ -23,231 +23,255 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/runtime@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" - integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg== +"@babel/runtime@^7.13.9": + version "7.13.17" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.17.tgz#8966d1fc9593bf848602f0662d6b4d0069e3a7ec" + integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== dependencies: regenerator-runtime "^0.13.4" -"@edgeware/node-types@^3.1.0-beta.14": - version "3.1.0-beta.14" - resolved "https://registry.yarnpkg.com/@edgeware/node-types/-/node-types-3.1.0-beta.14.tgz#d55b01c5bcc5e5201d74a4259258aece5f3fcc07" - integrity sha512-Iz7nzUnNbAw46aAfVwioceNsaT0DKTJUqrDsILY/7lXCZeclaibyXuHghBkCHRSDnztYxCG/8gfjyHH6+s16rQ== - -"@polkadot/api-derive@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-3.2.4-3.tgz#451ac9906ddf88e55cbc331ac264eddbeb1a757d" - integrity sha512-iNtbFetZsta1SMkGcJWxV1EDB3FrXreXC3w2JhEwZ9BdZV+P8WnLKWP2q96aERlHff2792QbtdNyXtHPLgWprA== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/api" "3.2.4-3" - "@polkadot/rpc-core" "3.2.4-3" - "@polkadot/types" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" - "@polkadot/x-rxjs" "3.2.4-3" +"@babel/runtime@^7.14.0": + version "7.14.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6" + integrity sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA== + dependencies: + regenerator-runtime "^0.13.4" + +"@edgeware/node-types@3.6.0-erup-4.1": + version "3.6.0-erup-4.1" + resolved "https://registry.yarnpkg.com/@edgeware/node-types/-/node-types-3.6.0-erup-4.1.tgz#a651c91770f67aaddb128cb64b5ff9d09c4bf284" + integrity sha512-/plWyFDdOU5ZN9ePMI6EYQYaegnR2JOG4NNc9GmZBLO3/yuj+3UY44N73q5NDROEBSrqA859NJSvqGEbTGKbTQ== + +"@polkadot/api-derive@4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-4.12.1.tgz#463a9e83757a7a693d6a6fb21d5ada659b2d731b" + integrity sha512-u2o4fVyBHfoD7P6xWLhjqvvdlkDjjb0gs5quxYbiBSpPpc4itNdnvwJESjRl4Yx1PgnstnD9GVg65iMJR0j4QA== + dependencies: + "@babel/runtime" "^7.14.0" + "@polkadot/api" "4.12.1" + "@polkadot/rpc-core" "4.12.1" + "@polkadot/types" "4.12.1" + "@polkadot/util" "^6.6.1" + "@polkadot/util-crypto" "^6.6.1" + "@polkadot/x-rxjs" "^6.6.1" bn.js "^4.11.9" -"@polkadot/api@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-3.2.4-3.tgz#947508eef3d19a9c527dbf268cde411a14e09118" - integrity sha512-FTtQYtRZ0JLIbvGMlL8U4QDOZI3LxNiKvqDHgao+LJg0d+ZwawWlF6ZOJpJ84mW96dEzRIhhuhY299jQvLpbXA== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/api-derive" "3.2.4-3" - "@polkadot/keyring" "^5.2.2" - "@polkadot/metadata" "3.2.4-3" - "@polkadot/rpc-core" "3.2.4-3" - "@polkadot/rpc-provider" "3.2.4-3" - "@polkadot/types" "3.2.4-3" - "@polkadot/types-known" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" - "@polkadot/x-rxjs" "3.2.4-3" +"@polkadot/api@4.12.1", "@polkadot/api@^4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-4.12.1.tgz#dbdc35f15b8a51e971754feaa714f685eed6f167" + integrity sha512-YHm/CD32/rgNlm3UIspiMYEqouT1zj0qrMYzUJXQK/xfmrXczCxgJFEgaAfi7oIVWNYfb/vma6xT8Swv7EoRFg== + dependencies: + "@babel/runtime" "^7.14.0" + "@polkadot/api-derive" "4.12.1" + "@polkadot/keyring" "^6.6.1" + "@polkadot/metadata" "4.12.1" + "@polkadot/rpc-core" "4.12.1" + "@polkadot/rpc-provider" "4.12.1" + "@polkadot/types" "4.12.1" + "@polkadot/types-known" "4.12.1" + "@polkadot/util" "^6.6.1" + "@polkadot/util-crypto" "^6.6.1" + "@polkadot/x-rxjs" "^6.6.1" bn.js "^4.11.9" eventemitter3 "^4.0.7" -"@polkadot/keyring@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-5.2.2.tgz#1b011d9ad96ce142ee21183c2e76cbc0c7c5c39b" - integrity sha512-HZ+CABf0hC1P2ySHN/EP2ldiUa9jKo33Gg5lsOos4MjlsCrqhTB/LBg9dSYVO8Z215wpty7KBHvPYQv4XRXO7Q== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/util" "5.2.2" - "@polkadot/util-crypto" "5.2.2" - -"@polkadot/metadata@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-3.2.4-3.tgz#aeb975d0700ec26f46d27110e9e578fcafc0df0e" - integrity sha512-YgeO2cGNAMEvK+kKS5m9MYnhx7L/D71/fUO96FFJUgKentV3ofxsc6TdSE2B8bnl5jxI5zmlC6UvzMfB72tKjA== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/types" "3.2.4-3" - "@polkadot/types-known" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" +"@polkadot/keyring@^6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-6.6.1.tgz#66fb4fa3079ef79fe39560ccfa9bfffe28321796" + integrity sha512-nN6sI46Xe8l57NAq8E8WS+Z+rHxmeJhlB5Pfyd2/FjjhsC7Y/IOfG4YKJTGzFIsRj5O07BaKYr2Y+jT3XZfAkQ== + dependencies: + "@babel/runtime" "^7.14.0" + "@polkadot/util" "6.6.1" + "@polkadot/util-crypto" "6.6.1" + +"@polkadot/metadata@4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-4.12.1.tgz#2f775181886b91b55c8c283a30a605233d00132f" + integrity sha512-BUitrRMlWmkPSUQFOG7Io6TMKQxbWQxfjSm3baeO5T2AxpaRxRZEaX4KYy9W1sZFWBgVzxdidcBImV/Bz5mBTA== + dependencies: + "@babel/runtime" "^7.14.0" + "@polkadot/types" "4.12.1" + "@polkadot/types-known" "4.12.1" + "@polkadot/util" "^6.6.1" + "@polkadot/util-crypto" "^6.6.1" bn.js "^4.11.9" -"@polkadot/networks@5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-5.2.2.tgz#465fd0984f1a161803c4c605d6931f90ad0b966f" - integrity sha512-rffpQNldyajuGrqNzNsQiGyupFv7TDUZ4Pm1kGAToMipd9IfJQFRs9TxeCvP7qwsWmsAPBe3YN6GHRNtS9TdEg== - dependencies: - "@babel/runtime" "^7.12.5" - -"@polkadot/rpc-core@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-3.2.4-3.tgz#637175a6b18994788daf5ba62e206947a0e9b79d" - integrity sha512-cK9/ul/4IfzoYExVCONo3ua9YyGCbB3L3tUyDuFfEN6RZj0GtNc558fdMrU2zs1bpRkqElYPoRIY5y6OUsIAKQ== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/metadata" "3.2.4-3" - "@polkadot/rpc-provider" "3.2.4-3" - "@polkadot/types" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/x-rxjs" "3.2.4-3" - -"@polkadot/rpc-provider@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-3.2.4-3.tgz#592e580d47b471d9f41cd0aa84d347f6ceeb4da7" - integrity sha512-92n/VGFlDK+vj++W9rxoJ0xSKRwBYCHta3hp/adUGYThXGBZWcpkOqtrvXdlKk8bxXWrj+ASUXSXS0QsYqHvlw== - dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/types" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" - "@polkadot/x-fetch" "^5.2.2" - "@polkadot/x-ws" "^5.2.2" +"@polkadot/networks@6.6.1", "@polkadot/networks@^6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-6.6.1.tgz#ceeb9c720218414b09cea7949e321c38f76c37ff" + integrity sha512-tvQdtH2m9ZBWCLBRLP+dvfyJ/CBqCU7TkJSNQCg9RaKkwLRQ+Vl4HKNbXai9jAGXDQmxLYIkxu89VRNksQrBRw== + dependencies: + "@babel/runtime" "^7.14.0" + +"@polkadot/rpc-core@4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-4.12.1.tgz#f58422890b66b91e8055f9b16cc5482a0da189d5" + integrity sha512-vauY3nc7KbR0D7MkFR6Et7mOr3nXaHq88X2nwTV7w7sAJeJujs7fxtVb+8CUYVN9Nu0IPSShV1QYhgTv8TEB1g== + dependencies: + "@babel/runtime" "^7.14.0" + "@polkadot/metadata" "4.12.1" + "@polkadot/rpc-provider" "4.12.1" + "@polkadot/types" "4.12.1" + "@polkadot/util" "^6.6.1" + "@polkadot/x-rxjs" "^6.6.1" + +"@polkadot/rpc-provider@4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-4.12.1.tgz#cfe22ac590b042f684ce426ba5f603d91ae2e185" + integrity sha512-WF7bTu06305hHROhqgx4/bPoeG4f7gHH2G2nXpRU/l3TfXaR1WpofsEHjwOsWo2d/F3381tai1tmQ3Rt/2HUwA== + dependencies: + "@babel/runtime" "^7.14.0" + "@polkadot/types" "4.12.1" + "@polkadot/util" "^6.6.1" + "@polkadot/util-crypto" "^6.6.1" + "@polkadot/x-fetch" "^6.6.1" + "@polkadot/x-global" "^6.6.1" + "@polkadot/x-ws" "^6.6.1" bn.js "^4.11.9" eventemitter3 "^4.0.7" -"@polkadot/types-known@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-3.2.4-3.tgz#21bcb0e22cdc5386bf80745120674f0bb04d9275" - integrity sha512-FaAmfgrNrRjibm2WfJ/KtO86U3JZLSSJUB52hq3U7HAL52BG0e10qOqXrik2nXM7GrzPXm8pVpiUWjCldJ95YQ== +"@polkadot/types-known@4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-4.12.1.tgz#743a03c34b74399f8768b61fb5fced7a16faef33" + integrity sha512-6zU8sA5GYja50qPakK06iwknRs/N18TfMswzmku7Zks2iZnEzCD4Yw1eMgzl3E807ScWoB1KpH1VVqcNLeneSA== dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/types" "3.2.4-3" - "@polkadot/util" "^5.2.2" + "@babel/runtime" "^7.14.0" + "@polkadot/networks" "^6.6.1" + "@polkadot/types" "4.12.1" + "@polkadot/util" "^6.6.1" bn.js "^4.11.9" -"@polkadot/types@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-3.2.4-3.tgz#58006660b9e8e4d2a0d43b4a125621d63999eaa0" - integrity sha512-izRz/Z3KCGl1wpKTJMBZRf/hdSZOX3zks1AUQT4uuuc/k96oQf/JTMZUT1FSxaKZ0r6kVQKHfOeduQfREdQ0zQ== +"@polkadot/types@4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-4.12.1.tgz#dc9ec69d7c0d77c7edc338180f334ac2bac003d5" + integrity sha512-BYzE9xedfV4mOA9g0Ge4DHI4lameQrrVZg3aaN4GvpZzrox1xAzon7vhZqXfe1452avu/ivaoxxnLHze4tI+hA== dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/metadata" "3.2.4-3" - "@polkadot/util" "^5.2.2" - "@polkadot/util-crypto" "^5.2.2" - "@polkadot/x-rxjs" "3.2.4-3" + "@babel/runtime" "^7.14.0" + "@polkadot/metadata" "4.12.1" + "@polkadot/util" "^6.6.1" + "@polkadot/util-crypto" "^6.6.1" + "@polkadot/x-rxjs" "^6.6.1" "@types/bn.js" "^4.11.6" bn.js "^4.11.9" -"@polkadot/util-crypto@5.2.2", "@polkadot/util-crypto@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-5.2.2.tgz#103d6ccda64c72c2e971028b0ec7e74ffb4acd8c" - integrity sha512-U/QX5cwhFQgd448LVbJRP8IR9UeUNOH//Dv+ZhoCcqLXkVxMotF8BJjRUzkQVrORIlP0miWlwxygb4xzNsYhsw== +"@polkadot/util-crypto@6.6.1", "@polkadot/util-crypto@^6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-6.6.1.tgz#5065e3cd18b06b804b0ac151d6b00fe853c96c85" + integrity sha512-aD2Nr2Hb92Ev9w9yY5IRdVBlISRMAI3dokXXTpYIC+GVVH0i5bKA1KtO8eOhzh44/eujc7DUNB5wAXdl8rCCOQ== dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/networks" "5.2.2" - "@polkadot/util" "5.2.2" - "@polkadot/wasm-crypto" "^3.1.1" - "@polkadot/x-randomvalues" "5.2.2" + "@babel/runtime" "^7.14.0" + "@polkadot/networks" "6.6.1" + "@polkadot/util" "6.6.1" + "@polkadot/wasm-crypto" "^4.0.2" + "@polkadot/x-randomvalues" "6.6.1" base-x "^3.0.8" + base64-js "^1.5.1" blakejs "^1.1.0" bn.js "^4.11.9" create-hash "^1.2.0" - elliptic "^6.5.3" + elliptic "^6.5.4" hash.js "^1.1.7" js-sha3 "^0.8.0" scryptsy "^2.1.0" tweetnacl "^1.0.3" xxhashjs "^0.2.2" -"@polkadot/util@5.2.2", "@polkadot/util@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-5.2.2.tgz#c673a8b260fa29eadb4a95748cd675325b22e3b1" - integrity sha512-kUtQ3Jv+9xCMZOoXwFXVv7xHc5idPCIerbXN44406lvB3dF7G4sMUIG6fx2kCuarL+lF4RK8F4o14SpctK3wCA== +"@polkadot/util@6.6.1", "@polkadot/util@^6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-6.6.1.tgz#baa29a958dbf5843dbb0fb02d8e80c23cb803f58" + integrity sha512-KTHO3tTcmeByEwJoTjV8JFSTe3cFl6/2NUg9q3D4PkyrOEhzXJSNJ1exyXDWSDVS/udcq0TOGuR+NgYWoVuZvQ== dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/x-textdecoder" "5.2.2" - "@polkadot/x-textencoder" "5.2.2" + "@babel/runtime" "^7.14.0" + "@polkadot/x-textdecoder" "6.6.1" + "@polkadot/x-textencoder" "6.6.1" "@types/bn.js" "^4.11.6" bn.js "^4.11.9" camelcase "^5.3.1" - ip-regex "^4.2.0" + ip-regex "^4.3.0" -"@polkadot/wasm-crypto-asmjs@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-3.1.1.tgz#391e1be6f7d65552b09c2e2486d108c379e46dc6" - integrity sha512-7Lt4B/6dwUhb5OAuSes0qMd83TpkngvEpiXTt2ccf/t2OvAXY9msfeJ9as3dI2jvjA9edD//jiejJ0BHJgpuXw== +"@polkadot/wasm-crypto-asmjs@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-4.0.2.tgz#f42c353a64e1243841daf90e4bd54eff01a4e3cf" + integrity sha512-hlebqtGvfjg2ZNm4scwBGVHwOwfUhy2yw5RBHmPwkccUif3sIy4SAzstpcVBIVMdAEvo746bPWEInA8zJRcgJA== dependencies: - "@babel/runtime" "^7.12.5" + "@babel/runtime" "^7.13.9" -"@polkadot/wasm-crypto-wasm@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-3.1.1.tgz#94638daa7642e6a9681cb854757d98401913f087" - integrity sha512-KaP1Ojf889ZeXHGPmyFTj0Qxr/jQ4yfpaGiEOCvYKXRYsDsbZKfxcb96PFil/x0yoZswWG3TX2S3hebnAzkmBg== +"@polkadot/wasm-crypto-wasm@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-4.0.2.tgz#89f9e0a1e4d076784d4a42bea37fc8b06bdd8bb6" + integrity sha512-de/AfNPZ0uDKFWzOZ1rJCtaUbakGN29ks6IRYu6HZTRg7+RtqvE1rIkxabBvYgQVHIesmNwvEA9DlIkS6hYRFQ== dependencies: - "@babel/runtime" "^7.12.5" + "@babel/runtime" "^7.13.9" -"@polkadot/wasm-crypto@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-3.1.1.tgz#e9ec63204f508541dfda72f0b6b98be40e27de50" - integrity sha512-uApLRojJY9Q7Arji6w9/eOYEu8Pg8dm+zt+640QLzC4KVVCpbdMmrcFAXCZXeOIJwsKveZsNehGUCcG77ypVPg== +"@polkadot/wasm-crypto@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-4.0.2.tgz#9649057adee8383cc86433d107ba526b718c5a3b" + integrity sha512-2h9FuQFkBc+B3TwSapt6LtyPvgtd0Hq9QsHW8g8FrmKBFRiiFKYRpfJKHCk0aCZzuRf9h95bQl/X6IXAIWF2ng== dependencies: - "@babel/runtime" "^7.12.5" - "@polkadot/wasm-crypto-asmjs" "^3.1.1" - "@polkadot/wasm-crypto-wasm" "^3.1.1" + "@babel/runtime" "^7.13.9" + "@polkadot/wasm-crypto-asmjs" "^4.0.2" + "@polkadot/wasm-crypto-wasm" "^4.0.2" -"@polkadot/x-fetch@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-5.2.2.tgz#8e2e39f3872b1ffcc18767282b3afb1786ff938f" - integrity sha512-u1fd8woiE8l6xn9QXpdFhhaYIarShtDJTBgGKH3PFuQVrPjrTT3iA+OIHB4jpM8FFZyPG6rCdk6N9EFp/3neFA== +"@polkadot/x-fetch@^6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-6.6.1.tgz#208cb7c2e6410bbfc8c15a75e9917a8cbda60956" + integrity sha512-C18/iKYwiCMnNHyxvdyy7xRGaIRJuKmpm6Wxrv4iwBXlNAHVWkbjbuHuXKArg2+aL2hcMzulYobeKkDtu4rDDw== dependencies: - "@babel/runtime" "^7.12.5" - "@types/node-fetch" "^2.5.7" + "@babel/runtime" "^7.14.0" + "@polkadot/x-global" "6.6.1" + "@types/node-fetch" "^2.5.10" node-fetch "^2.6.1" -"@polkadot/x-randomvalues@5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-5.2.2.tgz#c44e5ea967eac347525604dd43500ae2fb6ec418" - integrity sha512-0aJmWUvOil6SC1At5YDHKFAMTUkvKw9IQC9Qxj0WhaDIY3KETgX+dNWNI8qEeoKsgCXMybPzewI5X9IXl7QItQ== +"@polkadot/x-global@6.6.1", "@polkadot/x-global@^6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-6.6.1.tgz#25539a429f16ad786948f5160f3d3cbe05ec00f3" + integrity sha512-3vM+48JMhzIAKr+AM7AU8Jq1Ok3cKHt8BoLZthrJuWJuzpwS6zWVMj0dpOH7bnk3JxM6D5Nwpwci1yxgyz2teA== dependencies: - "@babel/runtime" "^7.12.5" + "@babel/runtime" "^7.14.0" + "@types/node-fetch" "^2.5.10" + node-fetch "^2.6.1" + +"@polkadot/x-randomvalues@6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-6.6.1.tgz#7fd56f664a4f5a37feab27f9d4570814038778ce" + integrity sha512-CT6fhPVqwxTjhv9cohexIMFgSWdBEIXG8QwY1jMgj0YRKj+4UwnEGRwJksPfOPsV4VU0+tknDeMbhu+eqjid3w== + dependencies: + "@babel/runtime" "^7.14.0" + "@polkadot/x-global" "6.6.1" -"@polkadot/x-rxjs@3.2.4-3": - version "3.2.4-3" - resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-3.2.4-3.tgz#7779998f5d7190c77c8493a41701f5cc4c53edc5" - integrity sha512-EJlm1nyXXQCttvjrS3ss9Aq797HoN5jW+mB0yF6YbeH7nfERifiouykVvASa0PSsb6eITBAZDNvJHt6L0a62Ig== +"@polkadot/x-rxjs@^6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-rxjs/-/x-rxjs-6.6.1.tgz#660d5c1becb74637ff4cec54788e17b11cc5900c" + integrity sha512-SqNrQHgzGgjU6gZnRGUzlCaF/3raeb6eGFTX9FtF5z4YEqtN8qflEs/Av5mok/Qxm1oboqHDZGyNE6b3v5GIvQ== dependencies: - "@babel/runtime" "^7.12.5" - rxjs "^6.6.3" + "@babel/runtime" "^7.14.0" + rxjs "^6.6.7" -"@polkadot/x-textdecoder@5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-5.2.2.tgz#0b412c275107485c36c70dffe67f0cfee8f1e786" - integrity sha512-4ca8oJT/CAXh0XqtKykuHLEubZZP+7KINGOd2NUqxrNQRCgc6iClAiNq+HByPJz4WMTIOTyGcbH2CplzB/GHLg== +"@polkadot/x-textdecoder@6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-6.6.1.tgz#2f005df0e21d3d423395659008a95638e445ea27" + integrity sha512-f6ZjD76RmUqi87ioXE8b1kwy3I7L9pDE/9xAeGyucnYQELUtCvz/4Z8NjYJn05aeq1kHg11Fr0p1dHSArTZHUw== dependencies: - "@babel/runtime" "^7.12.5" + "@babel/runtime" "^7.14.0" + "@polkadot/x-global" "6.6.1" -"@polkadot/x-textencoder@5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-5.2.2.tgz#2c58b9093e33ae3628a8feb1d0bcd25e0c25fcb7" - integrity sha512-HInuKv67Jac6aNFxeQtFaEM97mgLB6shqB7oR5Z8cCL2T+xrdbp+cr5/R392QDt/LY6csFp5hw2YkN+42Yrthg== +"@polkadot/x-textencoder@6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-6.6.1.tgz#d0678aa001af66561fc1913e76c9704567e3df3d" + integrity sha512-HJt5YpvlHpVHP/8a4+FI2oRRQLK7x/j8RNK/e5vfHE1a3jHcrNm7FbS95KwRlaObPgtFIwR7EIkxXq8PHUl8yA== dependencies: - "@babel/runtime" "^7.12.5" + "@babel/runtime" "^7.14.0" + "@polkadot/x-global" "6.6.1" -"@polkadot/x-ws@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-5.2.2.tgz#71f992a6b7b6677451d37e064134ec42d6ac7268" - integrity sha512-UitnCF7THR/NFhZq26znBhUJUt9bynlX1G6s3gxvtJaibmTVdsAW2ZiBO8GuoR0DiWRPn037QYXBLigQEDaWCw== +"@polkadot/x-ws@^6.6.1": + version "6.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-6.6.1.tgz#9af80746f130b00b9f1e57354ce4fd2ae212161f" + integrity sha512-KLdDo4wHE3tiKbAoCPswX/a/SjfegvBCsgXhiwVwyvMFqd37Y7/LI9A0P+djlIYpkiPCjQpWDKNLA6r7kBdN8Q== dependencies: - "@babel/runtime" "^7.12.5" - "@types/websocket" "^1.0.1" - websocket "^1.0.33" + "@babel/runtime" "^7.14.0" + "@polkadot/x-global" "6.6.1" + "@types/websocket" "^1.0.2" + websocket "^1.0.34" "@types/bn.js@^4.11.6": version "4.11.6" @@ -294,10 +318,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node-fetch@^2.5.7": - version "2.5.7" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" - integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== +"@types/node-fetch@^2.5.10": + version "2.5.10" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.10.tgz#9b4d4a0425562f9fcea70b12cb3fcdd946ca8132" + integrity sha512-IpkX0AasN44hgEad0gEF/V6EgR5n69VEqPEgnmoM8GsIGro3PowbWs4tR6IhxUTyPLpOn+fiGG6nrQhcmoCuIQ== dependencies: "@types/node" "*" form-data "^3.0.0" @@ -320,10 +344,10 @@ resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.10.24.tgz#dede004deed3b3f99c4db0bdb9ee21cae25befdd" integrity sha512-T3NQD8hXNW2sRsSbLNjF/aBo18MyJlbw0lSpQHB/eZZtScPdexN4HSa8cByYwTw9Wy7KuOFr81mlDQcQQaZ79w== -"@types/websocket@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.1.tgz#039272c196c2c0e4868a0d8a1a27bbb86e9e9138" - integrity sha512-f5WLMpezwVxCLm1xQe/kdPpQIOmL0TXYx2O15VYfYzc7hTIdxiOoOvez+McSIw3b7z/1zGovew9YSL7+h4h7/Q== +"@types/websocket@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.2.tgz#d2855c6a312b7da73ed16ba6781815bf30c6187a" + integrity sha512-B5m9aq7cbbD/5/jThEr33nUY8WEfVi6A2YKCTOvw5Ldy7mtsOkqRvGjnzy6g7iMMDsgu7xREuCzqATLDLQVKcQ== dependencies: "@types/node" "*" @@ -493,6 +517,11 @@ base-x@^3.0.8: dependencies: safe-buffer "^5.0.1" +base64-js@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + blakejs@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.1.0.tgz#69df92ef953aa88ca51a32df6ab1c54a155fc7a5" @@ -727,7 +756,7 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -elliptic@^6.5.3: +elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -1171,10 +1200,10 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -ip-regex@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.2.0.tgz#a03f5eb661d9a154e3973a03de8b23dd0ad6892e" - integrity sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A== +ip-regex@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" + integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== is-arrayish@^0.2.1: version "0.2.1" @@ -1623,10 +1652,10 @@ ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rxjs@^6.6.3: - version "6.6.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" - integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== +rxjs@^6.6.7: + version "6.6.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" @@ -1969,10 +1998,10 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -websocket@^1.0.33: - version "1.0.33" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.33.tgz#407f763fc58e74a3fa41ca3ae5d78d3f5e3b82a5" - integrity sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA== +websocket@^1.0.34: + version "1.0.34" + resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" + integrity sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ== dependencies: bufferutil "^4.0.1" debug "^2.2.0" diff --git a/types/v46.json b/types/v46.json new file mode 100644 index 00000000..180ea5c9 --- /dev/null +++ b/types/v46.json @@ -0,0 +1,43 @@ +{ + "HashFunction": { + "_enum": ["PoseidonDefault", "PoseidonExp3", "PoseidonExp5", "PoseidonExp17", "MiMC", "Blake2", "Sha256"] + }, + "TreeId": "u32", + "Manager": { + "accountId": "AccountId", + "required": "bool" + }, + "MerkleTree": { + "leaf_count": "u32", + "max_leaves": "u32", + "depth": "u8", + "root_hash": "ScalarData", + "edge_nodes": "Vec", + "hasher": "HashFunction", + "should_store_leaves": "bool" + }, + "CurrencyId": "u64", + "Amount": "i128", + "AmountOf": "Amount", + "CurrencyIdOf": "CurrencyId", + "ScalarData": "[u8; 32]", + "Nullifier": "ScalarData", + "Commitment": "ScalarData", + "MixerInfo": { + "minimum_deposit_length_for_reward": "BlockNumber", + "fixed_deposit_size": "Balance", + "currency_id": "CurrencyIdOf" + }, + "WithdrawProof": { + "mixer_id": "TreeId", + "cached_block": "BlockNumber", + "cached_root": "ScalarData", + "comms": "Vec", + "nullifier_hash": "ScalarData", + "proof_bytes": "Vec", + "leaf_index_commitments": "Vec", + "proof_commitments": "Vec", + "recipient": "Option", + "relayer": "Option" + } +} \ No newline at end of file