1. 26 May, 2021 1 commit
    • Michael Müller's avatar
      Implement `seal_rent_params` (#755) · cbf08a02
      Michael Müller authored
      * Fix typo
      
      * Add `seal_rent_params`
      
      * Make `rent_params` only available on `ink-unstable`
      
      * wip
      
      * wip
      
      * Wrap `seal_rent_params` in `__unstable__`
      
      * Add `rent_params` to experimental off-chain env
      
      * Fix return type
      
      * Remove comments
      
      * Remove debugging code
      
      * Remove `ink-unstable` feature
      cbf08a02
  2. 25 May, 2021 1 commit
  3. 21 May, 2021 1 commit
  4. 17 May, 2021 1 commit
  5. 10 May, 2021 1 commit
    • Michael Müller's avatar
      Implement MVP for new off-chain testing engine (#712) · 1a19f937
      Michael Müller authored
      * Add `engine` crate
      
      * Add `env_types` crate
      
      * Adapt `env`, `lang` and `storage`
      
      * Adapt examples
      
      * Adapt CI
      
      * Symlink license and readme
      
      * Throw `TypedEncoded` out of `engine`
      
      * Improve Erc20
      
      * Bump versions to rc3
      
      * Fix clippy error: Manual implementation of `Option::map` (#717)
      
      * Implement comments
      
      * Fix yml
      
      * Improve structure
      
      * Add tests
      
      * Fix function signature
      
      * Get rid of `engine`s singleton
      
      * Revert instantiate stuff
      
      * Implement review comments
      
      * Make `Storage` non-generic
      
      * Improve API for emmitted events
      
      * Migrate to `panic_any`
      
      * Clean up import
      
      * Import `panic_any`
      
      * Implement comments
      
      * Fix param
      
      * Use type
      
      * Store balances in chain storage
      
      * Fix tests
      
      * Use individual storage per contract
      
      * Implement comments
      1a19f937
  6. 21 Apr, 2021 2 commits
    • honeywest's avatar
      Fix prelude0421 (#775) · 5571724f
      honeywest authored
      * add arithmetic test
      
      * optimize code
      5571724f
    • Michael Müller's avatar
      Fix `Greeter` and run documentation tests in CI (#773) · c2e43fc6
      Michael Müller authored
      * Run documentation tests in CI
      
      * Use `format` from `prelude`
      
      The contract build will fail otherwise due to
      the usage of `std::string::String` because of
      `std::format`.
      
      * Remove superfluous mutable
      
      * Reduce amount of fuzz runs
      
      The CI run already takes quite long and I don't think
      it makes that much difference if we reduce the amount
      of runs. The bugs we catched so far were always catched
      with way less runs than even this new number.
      
      * Run documentation tests as part of `test` stage
      c2e43fc6
  7. 19 Apr, 2021 1 commit
  8. 16 Apr, 2021 1 commit
  9. 15 Apr, 2021 2 commits
    • Michael Müller's avatar
      Fix nightly clippy errors (#760) · c50f93ce
      Michael Müller authored
      * Fix `clippy:wrong_self_convention`
      
      error: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value
         --> crates/primitives/src/key.rs:172:21
          |
      172 |     pub fn to_bytes(&self) -> [u8; 32] {
          |                     ^^^^^
          |
          = note: `-D clippy::wrong-self-convention` implied by `-D warnings`
          = help: consider choosing a less ambiguous name
          = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
      
      error: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value
         --> crates/primitives/src/key.rs:186:29
          |
      186 |     fn to_bytes_be_fallback(&self) -> [u8; 32] {
          |                             ^^^^^
          |
          = help: consider choosing a less ambiguous name
          = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
      
      * Fix `clippy:branches_sharing_code` for `bitvec`
      
      error: all if blocks contain the same code at the end
         --> crates/storage/src/collections/bitvec/mod.rs:280:9
          |
      280 | /             *self.len += 1;
      281 | |             if value {
      282 | |                 self.last_mut()
      283 | |                     .expect("must have at least a valid bit in this case")
      284 | |                     .set()
      285 | |             }
      286 | |         }
          | |_________^
          |
          = note: `-D clippy::branches-sharing-code` implied by `-D warnings`
          = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
      
      * Fix `clippy:branches_sharing_code` for `stash`
      
      error: all if blocks contain the same code at the start
         --> crates/storage/src/collections/stash/mod.rs:308:9
          |
      308 | /         if prev_vacant == next_vacant {
      309 | |             // There is only one other vacant entry left.
      310 | |             // We can update the single vacant entry in a single look-up.
      311 | |             let entry = self
      ...   |
      315 | |                 .flatten()
      316 | |                 .expect("`prev` must point to an existing entry at this point");
          | |________________________________________________________________________________^
          |
          = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
      
      * Add benchmark for "Fix `clippy:wrong_self_convention`"
      
      * Revert "Add benchmark for "Fix `clippy:wrong_self_convention`""
      
      This reverts commit 9fabbfd1.
      
      * Remove empty line
      c50f93ce
    • Michael Müller's avatar
      Migrate to `panic_any` (#763) · 1f184b61
      Michael Müller authored
      * Migrate to `panic_any`
      
      * Clean up unnecessary `std`-cfg's in off-chain env
      1f184b61
  10. 07 Apr, 2021 1 commit
  11. 01 Apr, 2021 1 commit
  12. 30 Mar, 2021 1 commit
  13. 25 Mar, 2021 1 commit
  14. 19 Mar, 2021 2 commits
  15. 12 Mar, 2021 1 commit
  16. 09 Mar, 2021 1 commit
  17. 05 Mar, 2021 1 commit
  18. 03 Mar, 2021 1 commit
  19. 02 Mar, 2021 2 commits
    • Hero Bird's avatar
      ink! 3.0-rc3 pre-release changes and adjustments (#713) · ac501b24
      Hero Bird authored
      * adjust rustfmt.toml
      
      * add ink-fizz-tests feature guard to some test API
      
      * update ink! crates to version 3.0.0-rc3
      
      * write release notes for ink! 3.0-rc3
      
      * apply formatting to imports_granularity
      ac501b24
    • Michael Müller's avatar
      Minor improvements (#710) · 2b3d47c7
      Michael Müller authored
      * Fix nightly clippy warning: `inconsistent_struct_constructor`
      
      * Provide suggestion for fixing unitialized execution context
      
      * Ensure consistent versioning
      
      * Fix typos
      2b3d47c7
  20. 22 Feb, 2021 1 commit
  21. 19 Feb, 2021 1 commit
    • Michael Müller's avatar
      Fix build warnings + clippy errors from latest nightly (#686) · 353a840d
      Michael Müller authored
      * Fix build warning
      
      * Fix `warn(clippy::redundant_slicing)`
      
      * Remove unnecessary feature
      
      * Reduce amount of ci fuzz tests, since it times out sometimes
      
      * Apply rustfmt
      
      * Revert "Remove unnecessary feature"
      
      This reverts commit fdad2e89.
      
      * Revert "Fix build warning"
      
      This reverts commit 00ea9038.
      
      * Fix build warning
      
      * Revert me: Hotfix for funty issue
      
      * Remove unstable `panic_any`
      
      * Fix use
      353a840d
  22. 10 Feb, 2021 1 commit
    • Michael Müller's avatar
      Improve ink! linker error protocol (#685) · 8228bf0d
      Michael Müller authored
      * Improve ink! linker error protocol
      
      * Improve order of parameters
      
      * Encode `EnforcedError` object into function signature
      
      * Improve doc comments
      
      * Add doc comment
      
      * Improve doc comment
      8228bf0d
  23. 05 Feb, 2021 2 commits
  24. 04 Feb, 2021 3 commits
    • Michael Müller's avatar
      Evaluate migration of `SmallVec` to `min_const_generics` (#598) · 3d337f46
      Michael Müller authored
      * Get rid of `generic-array`
      
      * Remove comment
      
      * Fmt and get rid of feature flags
      
      * Include Vec
      
      * Make clippy happy
      
      * Add `into_inner` back in
      
      * Do not allocate heap memory
      
      * Use `array_init` for initializing
      
      * Revert me: Activate `const-generics` feature in `array-init`
      
      * Remove `feature(array_map)`
      
      * Remove feature flag, since it is now stable on nightly
      
      * Add feature `ink-unstable`
      
      * Put `LazyArray` behind `ink-unstable` feature
      
      * Remove newline
      
      * Allow dead code in `LazyArray` when `ink-unstable` missing
      
      * Remove unnecessary allow
      3d337f46
    • Hero Bird's avatar
      Use BLAKE2b 256-bit hashes for selectors (#680) · e22a0feb
      Hero Bird authored
      * use BLAKE2b 256-bit hashes for selectors
      
      Before this PR we accidentally used BLAKE2b 512-bit hashing.
      Using 256-bit versions is important for smart contracts so that smart contracts can compute selector hashes on their own through the built-in contracts-pallet hash support which includes BLAKE2b 256-bit but not 512-bit.
      
      * apply rustfmt
      e22a0feb
    • Michael Müller's avatar
      Add generalized collection fuzz testing (#601) · a50bf6d3
      Michael Müller authored
      * Add generalized collection fuzz testing
      
      * Use `StorageHashMap::FromIter`
      
      * Use `saturating_mul`
      
      * Update to new `quickcheck` API
      
      * Adopt year to 2021 in license
      
      * Implement suggestions from review
      a50bf6d3
  25. 03 Feb, 2021 1 commit
  26. 02 Feb, 2021 1 commit
    • Michael Müller's avatar
      Fix broken intra-doc links + add CI stage to test example docs (#606) · 7aaf4dcc
      Michael Müller authored
      * Fix broken intra-doc links
      
      * Fix doc link
      
      * Add CI stage to test example docs
      
      * Revert me: Provoke doc failures in example
      
      * Remove intra-crate link to non-dependency
      
      * Remove `--all-features`
      
      * Revert "Revert me: Provoke doc failures in example"
      
      This reverts commit 563bfeb3.
      
      * Prettify paragraph
      
      * Remove unnecessary imports
      
      * Revert "Remove unnecessary imports"
      
      This reverts commit 05207133
      
      .
      
      * Remove unnecessary imports
      
      * Remove `cfg(doc)` path resolution for doc comments
      
      * Improve language and formatting
      
      * Upgrade `scale` and `scale-info` for `rand-extension`
      
      * Make http link work
      
      * Remove `crate::` prefix from doc links
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarHero Bird <robin.freyler@gmail.com>
      
      Co-authored-by: default avatarHero Bird <robin.freyler@gmail.com>
      7aaf4dcc
  27. 28 Jan, 2021 2 commits
  28. 19 Jan, 2021 1 commit
    • Andrew Jones's avatar
      [env] pass salt argument to instantiate host function (#599) · 1daf6a8e
      Andrew Jones authored
      * WIP
      
      * Add salt argument to instantiate call
      
      * Fix lang compilation
      
      * Fix salt to [u8; 4]
      
      * Make create builder generic over Salt
      
      * Use type state instead of ()
      
      * Rename salt to salt_bytes
      
      * Fmt
      
      * Apply review suggestion: type state enum
      
      * Apply review suggestion: separate impl block for salt_bytes getter
      
      * Apply review suggestion: take salt bytes directly to avoid copy overhead
      
      * Apply review suggestion: use Salt type state instead of leftover concrete type
      
      * Apply review suggestion: fix doc tests
      1daf6a8e
  29. 13 Jan, 2021 1 commit
  30. 12 Jan, 2021 1 commit
    • Hero Bird's avatar
      Implement ink! chain extensions (#592) · 59a7f5ed
      Hero Bird authored
      
      
      * add new tests for #[ink(namespace = ..)] and #[ink(selector = ..)] attrs
      
      * [lang] implement new errors for ink! attributes: namespace, selector
      
      * add #[ink(extension = N: u32)] attribute
      
      * apply rustfmt
      
      * [lang] add initial implementation of chain extension proc. macro
      
      * [lang] rename AttributeArg -> AttributeFrag
      
      * rename AttributeFrag::kind field to arg
      
      * rename AttributeArgKind -> AttributeArg
      
      Also introduce a new AttributeArgKind type and AttributeArg::kind method.
      
      * [lang] apply rustfmt
      
      * add Display impl for AttributeArgKind
      
      * [lang] use AttributeArgKind in sanitize_attributes and ensure_first methods
      
      * [lang/ir] improve error reporting for duplicate ink! attributes
      
      * [lang/ir] refactoring and improvements to chain extension IR impl
      
      * [lang/ir] add tests for IR implementation of chain extensions
      
      * [lang/ir] remove some code dupe
      
      * [lang/ir] add getters to ChainExtension
      
      * [lang/ir] add re-exports for ChainExtension definitions
      
      * [lang/codegen] add initial impl for ChainExtensions
      
      * [env] add ChainExtension assoc type to the Environment trait
      
      * [lang] initial impl to make it possible to use chain extension syntax
      
      * [env] improvements to chain extensions API
      
      Also removes the unstable crate feature guarding the feature.
      
      * [lang/macro] add UI test for chain extension
      
      * [lang/macro] register new UI test
      
      * [lang/codegen] fix some codegen bugs with new chain extension feature
      
      * [lang, env] apply rustfmt
      
      * [lang/ir] apply clippy suggestions and fix outdated error messages
      
      * [lang/ir] fix some tests and incorrect error messages
      
      * [examples] apply clippy suggestion
      
      * add ErrorCode to ink! chain extension trait
      
      * add FromStatusCode trait to ink_lang
      
      * add #[ink(expect_output)] and #[ink(expect_ok)] attributes
      
      Also add their handling for the #[ink::chain_extension] proc. macro.
      
      * add ink_lang::IsResultType trait
      
      * add ChainExtensionMethodInputs iterator
      
      * hide docs for IsResultType trait
      
      * add some docs to chain extension codegen
      
      * implement expect_ok and expect_output where bounds in codegen
      
      * apply code review suggestions by (cmichi)
      
      * add ReturnCode::into_u32 getter
      
      * change return type of ext::call_chain_extension: RetCode -> u32
      
      Chain extensions do not follow the general scheme of error return code because they have their own set of errors that is custom defined by the author of the chain extension.
      
      * [lang] add ChainExtension trait
      
      Not yet sure we need it.
      
      * change EnvBackend::call_chain_extension signature
      
      The new signature is much more low-level and supports all the different ways to call a chain extension method.
      This commit already implements the chain extension call on the on-chain environment.
      More work needs to be done to properly support this for the off-chain environment.
      
      * remove old high-level API for calling chain extension methods
      
      * [env] add new high-level module to handle chain extension calls
      
      * rename ChainExtensionMethodInstance -> ChainExtensionMethod
      
      * [env] add doc examples to chain extension method API
      
      * apply rustfmt
      
      * [env] clippy: allow complex type in ChainExtensionMethod type state
      
      * silence some warnings
      
      * re-export IsResultType from ink_lang crate
      
      * [lang] remove FromStatusCode trait
      
      This trait already exists in the ink_env crate.
      
      * [lang] update codegen for chain extensions
      
      Not yet done but close.
      
      * [lang] update simple chain extension test
      
      Compiles now again.
      
      * apply rustfmt
      
      * update some license headers
      
      * [env] fix where bound
      
      * extend chain extension test case to cover all cases
      
      * add messages for read_small, access and unlock_access
      
      * fix some bugs with chain extension method signatures in test
      
      * fix some bugs and docs in chain extension test
      
      * fix test
      
      * update quickcheck to 1.0
      
      * [env] implement chain extension calling for off-chain env
      
      The new interface is much more lower-level and it is still impossible to use chain state from within the chain extension call. The latter must be fixed as soon as the off-chain environment receives its rework.
      
      * apply rustfmt
      
      * add docs to #[ink::chain_extension] proc. macro
      
      * rename env_types -> env everywhere
      
      * make doc examples for #[ink::chain_extension] compile
      
      * add yet another technical limitation
      
      * make link to simple.rs test case more stable (point to revision)
      
      * fix docs (code suggestion)
      
      Co-authored-by: Michael Müller's avatarMichael Müller <michi@parity.io>
      
      * fix docs (code suggestion)
      
      Co-authored-by: Michael Müller's avatarMichael Müller <michi@parity.io>
      
      * fix docs (code suggestion)
      
      Co-authored-by: Michael Müller's avatarMichael Müller <michi@parity.io>
      
      * fix docs (code suggestion)
      
      Co-authored-by: Michael Müller's avatarMichael Müller <michi@parity.io>
      
      * add dev. note to Backend::call_chain_extension
      
      * fix docs example (code suggestion)
      
      Co-authored-by: Andrew Jones's avatarAndrew Jones <ascjones@gmail.com>
      
      * [env] chain extension: make doc examples/tests compile
      
      * fix some doc comments according to review suggestions
      
      * review suggestion: telling -> meaning
      
      * fix docs (review suggestion)
      
      Co-authored-by: Andrew Jones's avatarAndrew Jones <ascjones@gmail.com>
      
      * fix docs (review suggestion)
      
      Co-authored-by: Andrew Jones's avatarAndrew Jones <ascjones@gmail.com>
      
      * improve docs (review suggestion)
      
      Co-authored-by: Andrew Jones's avatarAndrew Jones <ascjones@gmail.com>
      
      * rename chain extension test file
      
      * analyse_error_code add doc comments for possible errors
      
      * rename expect_ok -> returns_result and expect_output -> handle_status
      
      Some examples and docs might be invalidated or outdated.
      
      * [lang/ir] improve error reporting for ink! namespace attribute with missing parameter
      
      * [lang/*] implement new handle_status and returns_result attributes
      
      * [env] apply rustfmt
      
      Co-authored-by: Michael Müller's avatarMichael Müller <michi@parity.io>
      Co-authored-by: Andrew Jones's avatarAndrew Jones <ascjones@gmail.com>
      59a7f5ed
  31. 05 Jan, 2021 1 commit
  32. 04 Jan, 2021 1 commit