1. Sep 29, 2023
    • Muharem Ismailov's avatar
      frame-support: `RuntimeDebug\Eq\PartialEq` impls for `Imbalance` (#1717) · 7d4f8296
      Muharem Ismailov authored
      Derive `RuntimeDebug\Eq\PartialEq` but do not bound any generics.
      
      This achieved by using their equivalent no bound versions:
      `EqNoBound\PartialEqNoBound\RuntimeDebugNoBound`.
      
      Deriving with `Debug`, `Eq`, and `PartialEq` for the `Debt` and `Credit`
      type aliases of `Imbalance` is not feasible due to the `OnDrop` and
      `OppositeOnDrop` generic types lacking implementations of the same
      traits.
      
      This absence posed challenges in testing and any scenarios that demanded
      the traits implementations for the type.
      7d4f8296
    • Sebastian Kunert's avatar
      9485b0b4
    • Ankan's avatar
      [NPoS] Fix for Reward Deficit in the pool (#1255) · f820dc0a
      Ankan authored
      closes https://github.com/paritytech/polkadot-sdk/issues/158.
      partially addresses
      https://github.com/paritytech/polkadot-sdk/issues/226.
      
      Instead of fragile calculation of current balance by looking at `free
      balance - ED`, Nomination Pool now freezes ED in the pool reward account
      to restrict an account from going below minimum balance. This also has a
      nice side effect that if ED changes, we know how much is the imbalance
      in ED frozen in the pool and the current required ED. A pool operator
      can diligently top up the pool with the deficit in ED or vice versa,
      withdraw the excess they transferred to the pool.
      
      ## Notable changes
      - New call `adjust_pool_deposit`: Allows to top up the deficit or
      withdraw the excess deposited funds to the pool.
      - Uses Fungible trait (instead of Currency trait). Since NP was not
      doing any locking/reserving previously, no migration is needed for this.
      - One time migration of freezing ED from each of the existing pools (not
      very PoV friendly but fine for relay chain).
      f820dc0a
    • Piotr Mikołajczyk's avatar
      Enable mocking contracts (#1331) · d8d90a82
      Piotr Mikołajczyk authored
      # Description
      This PR introduces two changes:
      - the previous `Tracing` trait has been modified to accept contract
      address instead of code hash (seems to be way more convenient)
      - a new trait `CallInterceptor` that allows intercepting contract calls;
      in particular the default implementation for `()` will just proceed in a
      standard way (after compilation optimizations, there will be no
      footprint of that); however, implementing type might decide to mock
      invocation and return `ExecResult` instead
      
      Note: one might try merging `before_call` and `intercept_call`. However,
      IMHO this would be bad, since it would mix two completely different
      abstractions - tracing without any effects and actual intervention into
      execution process.
      
      This will unblock working on mocking contracts utility in drink and
      similar tools (https://github.com/Cardinal-Cryptography/drink/issues/33)
      
      # Checklist
      
      - [x] My PR includes a detailed description as outlined in the
      "Description" section above
      - [ ] My PR follows the [labeling
      requirements](https://github.com/paritytech/polkadot-sdk/blob/master/docs/CONTRIBUTING.md#process)
      of this project (at minimum one label for `T` required)
      - [x] I have made corresponding changes to the documentation (if
      applicable)
      - [x] I have added tests that prove my fix is effective or that my
      feature works (if applicable)
      d8d90a82
  2. Sep 28, 2023
  3. Sep 27, 2023
  4. Sep 25, 2023
  5. Sep 22, 2023
  6. Sep 21, 2023
  7. Sep 20, 2023
  8. Sep 18, 2023
  9. Sep 17, 2023
  10. Sep 16, 2023
    • joe petrowski's avatar
      Include `bitvec` in `std` for Broker Pallet (#1558) · 11d1a395
      joe petrowski authored
      When adding this pallet to the [Coretime
      Chain](https://github.com/paritytech/polkadot-sdk/pull/1479), this
      dependency results in conflicting implementations (rustc error below).
      This toml change fixes it.
      
      ```
      error: failed to run custom build command for `coretime-rococo-runtime v1.0.0 (/home/joe/parity/polkadot-sdk/cumulus/parachains/runtimes/coretime/coretime-rococo)`
      
      Caused by:
        process didn't exit successfully: `/home/joe/parity/polkadot-sdk/target/debug/build/coretime-rococo-runtime-7943703d2770a119/build-script-build` (exit status: 1)
        --- stdout
        Information that should be included in a bug report.
        Executing build command: RUSTFLAGS="-C target-cpu=mvp -C target-feature=-sign-ext -C link-arg=--export-table -Clink-arg=--export=__heap_base -C link-arg=--import-memory  " SKIP_WASM_BUILD="" "/home/joe/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/home/joe/parity/polkadot-sdk/target/debug/wbuild/coretime-rococo-runtime/Cargo.toml" "--color=always" "--profile" "release"
        Using rustc version: rustc 1.71.1 (eb26296b5 2023-08-03)
      
      
        --- stderr
           Compiling sp-io v23.0.0 (/home/joe/parity/polkadot-sdk/substrate/primitives/io)
           Compiling coretime-rococo-runtime v1.0.0 (/home/joe/parity/polkadot-sdk/cumulus/parachains/runtimes/coretime/coretime-rococo)
        error[E0152]: found duplicate lang item `panic_impl`
            --> /home/joe/parity/polkadot-sdk/substrate/primitives/io/src/lib.rs:1749:1
             |
        1749 | pub fn panic(info: &core::panic::PanicInfo) -> ! {
             | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             |
             = note: the lang item is first defined in crate `std` (which `bitvec` depends on)
             = note: first definition in `std` loaded from /home/joe/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libstd-67dfbacfb4b441ef.rlib
             = note: second definition in the local crate (`sp_io`)
      
        For more information about this error, try `rustc --explain E0152`.
      ```
      11d1a395
  11. Sep 15, 2023
  12. Sep 14, 2023
  13. Sep 13, 2023
  14. Sep 12, 2023
  15. Sep 11, 2023
  16. Sep 08, 2023