1. 09 Jul, 2021 2 commits
    • Karel L. Kubat's avatar
      Implement binary_search for `collections::Vec` (#836) · 36bbdec1
      Karel L. Kubat authored
      
      
      * [storage] Implement binary_search
      
      * [storage] Add binary_search testcase for missing smaller element
      
      * [storage] use indexing instead of Vec::get
      Co-authored-by: Hero Bird's avatarRobin Freyler <robbepop@web.de>
      
      * [storage] Port binary_search tests from core
      
      * [storage] Format tests
      
      * [storage] Format tests
      
      * Remove old comment
      Co-authored-by: Hero Bird's avatarRobin Freyler <robbepop@web.de>
      
      * [storage] Incorporate review feedback
      
      * [CI] add comparator to spellcheck
      
      Porting binary_search to the storage Vec, including the documentation found in core, led to a failure in spellcheck. Since core is considered to be correct, it is updated on spellcheck.
      
      * incorporate review feedback
      
      * add permalink to stdlib source
      
      * Split long line
      
      * fix examples
      
      * RustFmt the doc examples
      Co-authored-by: Hero Bird's avatarRobin Freyler <robbepop@web.de>
      Co-authored-by: default avatarHernando Castano <hernando@hcastano.com>
      36bbdec1
    • Michael Müller's avatar
      Use different mechanism to trigger `ink-waterfall` CI (#851) · 1747b345
      Michael Müller authored
      * Move `pre_cache` script to hidden folder
      
      * Add `trigger_pipeline` script from Polkadot
      
      * Use `trigger_pipeline` to trigger `ink-waterfall` CI
      
      * Update GitLab config
      
      * Update GitLab config
      
      * Add debug output
      
      * Revert me: Remove all other stages
      
      * More debugging
      
      * More debugging
      
      * More debugging
      
      * More debugging
      
      * Fix syntax
      
      * Check for env variable
      
      * Revert "Revert me: Remove all other stages"
      
      This reverts commit a15ec5b0.
      
      * Decrease response time
      
      * Remove unnecessary variables
      
      * Fix link
      
      * CI: chore
      
      * CI: add rules everywhere
      
      * CI: add rust info
      
      * Add image name and tag
      
      * Revert "Add image name and tag"
      
      This reverts commit 88cd94f0
      
      .
      
      * CI: add image to run in k8s
      Co-authored-by: Denis_P's avatarDenis P <denis.pisarev@parity.io>
      1747b345
  2. 08 Jul, 2021 4 commits
    • Michael Müller's avatar
      Fix Discord link (#848) · 5c79f3b8
      Michael Müller authored
      5c79f3b8
    • Hernando Castano's avatar
      ERC-1155 Example (#800) · afc48714
      Hernando Castano authored
      
      
      * Add basic contract skeleton
      
      * Add dummy ERC-1155 trait implementations
      
      * Implement `balance_of` method
      
      * First attempt at `balance_of_batch` implementation
      
      I'm not sure if the output format is correct, need to read the docs
      more closely
      
      * Implement simple token transfer
      
      * Flatten balances BTreeMap
      
      * Clean up account usage in tests
      
      * Implement approval mechanism
      
      * Fix bug when sending tokens to an account with zero balance
      
      * Check approvals before sending tokens
      
      * Suppress warnings
      
      * Appease Clippy
      
      * Add crude support for token transfers to smart contracts
      
      * Simplify check for smart contract-ness
      
      * Handle receiving tokens as a smart contract
      
      * Implement `safe_transfer_from` method
      
      * Only do approval and recipient checks during in batch transfers
      
      * I was wrong about the compiler's cleverness...
      
      * Add documentation about interface
      
      * Make better use of some imports
      
      * Disallow owners from approving themselves for token tranfers
      
      * Allow creating and minting tokens
      
      * Derive default for storage struct
      
      * Add note on on-chain panic
      
      * Remove `with_balances` constructor
      
      It wasn't ERC-1155 compliant (no transfer events emitted) and it
      also leaked the internal structure of how balances were tracked.
      
      * RustFmt with Nightly
      
      Not sure I like some of the decisions though...
      
      * Tag on_received messages with selectors
      
      * Add missing event
      
      * Index topics in events
      
      * Remove note on BTreeSet usage
      
      Can't figure out how to get tests to compile with it.
      
      * Stop panicking on cross-contract call error
      
      However, this is only because I have no feedback on why this call
      is actually failing. This behaviour should be added back.
      
      * Nightly RustFmt
      
      * Fix RustDoc links
      
      * Remove inline questions
      
      * Remove unused `data` argument from `create/mint`
      
      * Rename magic value contants
      
      * Remove data argument from `mint/create` tests
      
      * Use entry API when decreasing account balance
      
      * Extract approvals pairs into struct
      
      This is better in terms of type safety and ease of use
      
      * Improve some of the panic messages
      
      * Cache calls to `self.env().caller()`
      
      * Allow `TransferSingle` events to contain Optional addresses
      
      This slightly deviates from the spec which says we should use the `0x00`
      address during certain operations, but this is more idiomatic Rust.
      
      * Add logging around calls to `onERC1155Received`
      
      * Improve debug message when receiving cross-contract results
      
      * Move warning lints to specific lines of code
      
      * Format code
      
      * Remove backticks from URLs
      Co-authored-by: Michael Müller's avatarMichael Müller <michi@parity.io>
      
      * Fix comment wording/typo
      
      * Add expected panic messages to tests
      
      * Move imports related to x-contract calls closer to use site
      
      * Change selector bytes to hex for the humans
      
      * Remove incorrect comment about off-chain environment testing
      
      * Add documentation for `TokenId`
      
      This will make sure that it doesn't show up as `u128` in
      the generated docs.
      
      * Nightly RustFmt
      
      * Uppercase selector bytes
      
      * Don't repeat `erc_1155` in `Erc1155TokenReceiver` methods
      
      * Nightly RustFmt
      
      * Appease the spellchecker
      
      * Use Environment typedef
      
      * Allow tests to run in stable and experimental off-chain envs
      
      * Add explanation as to why we don't accept tokens
      
      * Return `Result` when minting tokens
      
      * Allow (most) errors to be handled gracefully by caller
      
      * Nightly RustFmt
      
      * Add shorthand zero-address to allowed spelling list
      
      * Run tests with `--features ink-experimental-engine` in CI
      
      * Perform batch balance checks before trying to transfer tokens
      
      * Move smart contract transfer checks to their own helper function
      
      * Appease Clippy
      
      * Make `ensure` macro definition more explicit
      Co-authored-by: default avatarRobin Freyler <robin.freyler@gmail.com>
      
      * Iterate over values instead of references
      Co-authored-by: default avatarRobin Freyler <robin.freyler@gmail.com>
      
      * Iterate over references again
      
      * Return a value from `on_batch_received`
      
      * Don't collect into intermediate Vec
      
      * Wrap 0x00 in code blocks
      
      This way the spellchecker will ignore it and we
      can avoid adding it to our dictionary.
      Co-authored-by: Michael Müller's avatarMichael Müller <michi@parity.io>
      Co-authored-by: default avatarRobin Freyler <robin.freyler@gmail.com>
      afc48714
    • Karel L. Kubat's avatar
      [lang] catch illegal struct destructuring pattern in ink! message arguments. (#846) · 4e2c7c30
      Karel L. Kubat authored
      * [lang] catch illegal struct destructuring pattern in ink! message arguments.
      
      * fmt
      4e2c7c30
    • Michael Müller's avatar
      Add `ink-waterfall` to CI (#844) · 011bae31
      Michael Müller authored
      011bae31
  3. 02 Jul, 2021 1 commit
    • Michael Müller's avatar
      Add example usage comments to `EnvAccess` methods (#797) · da5a1247
      Michael Müller authored
      * Add example usage comments to env methods
      
      * Remove superfluous line
      
      * wip
      
      * Remove debug code
      
      * Make doc comment examples compile
      
      * Remove superfluous line
      
      * Surround with complete contract code
      
      * Experiment with macro to reduce code duplication
      
      * Revert "Experiment with macro to reduce code duplication"
      
      This reverts commit f7319126
      
      .
      
      * Add complete contract code in doc tests
      
      * Remove unnecessary `[dev-dependencies]`
      
      * Improve code in doc tests
      
      * Fix doc tests
      
      * Improve code appearance
      
      * Add better doc test examples
      
      * Make `gas` be of type `u64` instead of `Balance`
      
      * Make `gas` be of type `u64` instead of `Balance`
      
      * Make `gas` be of type `u64` instead of `Balance`
      
      * Apply suggestions from code review
      Co-authored-by: default avatarRobin Freyler <robin.freyler@gmail.com>
      
      * Add simple access permission contract
      
      * Fix syntax
      Co-authored-by: default avatarRobin Freyler <robin.freyler@gmail.com>
      da5a1247
  4. 28 Jun, 2021 1 commit
    • Hernando Castano's avatar
      Actually add `refcount` as word (#830) · 056cf4c2
      Hernando Castano authored
      * Actually add `refcount` as word
      
      * Bump `cargo-spellcheck` verbosity
      
      * Make CI spellcheck runs deterministic
      
      * Add more words to dictionary
      
      * Allow `parameterized` and `parameterizes`
      
      * Add more words to dictionary
      056cf4c2
  5. 25 Jun, 2021 1 commit
    • Hernando Castano's avatar
      Update Spelling List (#828) · 98bf5a99
      Hernando Castano authored
      * Add `refcount` and `postfix` as real words
      
      Also sorts the spellcheck dictionary for your viewing pleasure
      
      * Fix a couple of typos
      
      * Nightly RustFmt
      
      Sorry, I have it set to stable by default
      98bf5a99
  6. 17 Jun, 2021 2 commits
    • Michael Müller's avatar
      Fix bugs in two examples + Fix `master` CI (#820) · 41aa104f
      Michael Müller authored
      * Enable debug output for `contract-transfer` example
      
      It uses `debug_println!`.
      
      * Enable sending payments to `fn invoke_transaction()`
      
      It needs to be possible to send value with the transaction,
      because `t.transferred_value` in this function could be set
      to > 0.
      
      * Rename `Error::UnknownError` to `Error::Unknown`
      
      Clippy fails otherwise:
      
      	= note: `-D clippy::enum-variant-names` implied by `-D warnings`
      	= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
      
      * Revert "Enable sending payments to `fn invoke_transaction()`"
      
      This reverts commit 9b051d2c.
      
      * Require sending transaction payment to `fn invoke_transaction()`
      
      It needs to be possible to send value with the transaction,
      because `t.transferred_value` in this function could be set
      to > 0.
      
      * Fix interpunctuation
      
      * Introduce `ink-debug` feature
      
      * Revert "Introduce `ink-debug...
      41aa104f
    • Michael Müller's avatar
      Enable `spellcheck` CI stage (#822) · 9b7b92c1
      Michael Müller authored
      * Enable `spellcheck` CI job
      
      * Fix spellchecking mistakes
      
      * Implement review suggestion
      
      * Reword `>= 2`
      9b7b92c1
  7. 09 Jun, 2021 3 commits
  8. 07 Jun, 2021 1 commit
    • Sacha L's avatar
      Fix URL (#803) · d4fd3f78
      Sacha L authored
      Fix link for FRAME in Substrate.dev Knowledgebase
      d4fd3f78
  9. 27 May, 2021 1 commit
    • Michael Müller's avatar
      Implement `seal_rent_status` (#798) · 2310400c
      Michael Müller authored
      * Implement `seal_rent_status`
      
      * Add `at_refcount: Option<u32>` param
      
      * Fix param
      
      * Improve `at_refcount` comment
      
      * Replace `u32` with `core::num::NonZeroU32`
      2310400c
  10. 26 May, 2021 2 commits
  11. 25 May, 2021 1 commit
  12. 21 May, 2021 1 commit
  13. 17 May, 2021 1 commit
  14. 11 May, 2021 2 commits
  15. 10 May, 2021 3 commits
    • Michael Müller's avatar
      Improve `contract-transfer` example (#789) · 342d79e0
      Michael Müller authored
      * Improve `contract-transfer` example
      
      * Test for assertion
      342d79e0
    • Michael Müller's avatar
      Enable dependabot for examples (#780) · 4c4c1fbd
      Michael Müller authored
      * Create workspace for examples
      
      * Enable dependabot for examples
      
      * Choose unique package names in workspace
      
      * Prevent nested workspaces
      
      * Add comments
      
      * Make crate and lib name equal
      4c4c1fbd
    • 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
  16. 30 Apr, 2021 1 commit
  17. 29 Apr, 2021 1 commit
  18. 21 Apr, 2021 3 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
    • Michael Müller's avatar
      Polish readme (#774) · c0d9b789
      Michael Müller authored
      c0d9b789
  19. 19 Apr, 2021 2 commits
  20. 16 Apr, 2021 2 commits
  21. 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
  22. 14 Apr, 2021 2 commits
  23. 07 Apr, 2021 1 commit