1. 28 Jan, 2021 1 commit
    • Andrew Jones's avatar
      Update to new scale-info and codec releases (#663) · 68318131
      Andrew Jones authored
      * Update to scale-info 0.5
      
      * Update TypeInfo manual impls
      
      * Update parity-scale-code to 2.0
      
      * Add Encode ?Sized bounds
      
      * Change type display name for Key custom TypeInfo impl
      
      * Add missing ?Sized constraint
      
      * Fmt
      
      * Missing ?Sized bound in example
      68318131
  2. 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
  3. 13 Jan, 2021 1 commit
  4. 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
  5. 04 Jan, 2021 1 commit
  6. 28 Dec, 2020 1 commit
  7. 07 Dec, 2020 1 commit
  8. 02 Dec, 2020 1 commit
    • Michael Müller's avatar
      Ensure topics are unique (#594) · 64eec2c2
      Michael Müller authored
      
      
      * Ensure topics are unique
      
      * Remove unavailable method
      
      * Fix salt appending in Wasm
      
      * Remove salt param
      
      * Add missing assignment
      
      * Update crates/lang/src/events.rs
      
      Co-authored-by: default avatarHero Bird <robin.freyler@gmail.com>
      
      * Add suggestions
      
      * Remove always inline
      
      * Fix event hashing in examples
      
      * Make nightly clippy happy
      
      * Remove unnecessary return param
      
      * Do not use internal type for hash calculation
      
      * Hide internal type from docs
      
      * Expose `PrefixedValue` from ink_env::topics
      
      * Apply cargo fmt
      
      * Apply cargo fmt
      
      * Apply comments
      
      * Apply comments
      
      * Apply comments
      
      Co-authored-by: default avatarHero Bird <robin.freyler@gmail.com>
      64eec2c2
  9. 23 Nov, 2020 1 commit
    • Michael Müller's avatar
      Some minor fixes (#587) · fd541250
      Michael Müller authored
      * Fix typo
      
      * Fn does not need to take mutable self
      
      * Fix naming: #[ink(implemenetation)] ➜ #[ink(impl)]
      
      * #[ink(storage)] can not be applied to enum
      
      * Fix typo: accesses ➜ accessed
      
      * Fix typo: sturctures ➜ structures
      fd541250
  10. 11 Nov, 2020 1 commit
    • Michael Müller's avatar
      Make CI check format of UI tests (#534) · fe82d173
      Michael Müller authored
      * [ci] Check format of UI tests as well
      
      * [lang] Apply our formatting guidelines to UI tests
      
      * [ci] Make Gitlab happy
      
      * [ci] Remove superfluous space
      
      * [ci] Output rustfmt version
      
      * [ci] Tune rustfmt params
      
      * Remove todo's
      
      * Migrate erc721 ui test contract to recent example contract
      
      * Remove --version command used to debug
      
      * Apply cargo fmt
      
      * .gitlab-ci.yml formatting
      
      * Add main fn
      
      * Remove todo from stderr expect
      
      * Adapt fixtures
      
      * Revert "Adapt fixtures"
      
      This reverts commit 174c012e.
      
      * Adapt fixtures
      fe82d173
  11. 04 Nov, 2020 1 commit
    • Michael Müller's avatar
      [lang] Improve invalid selector error (#561) · 0eca603f
      Michael Müller authored
      * [lang] Improve invalid selector message
      
      * [lang] Improve span
      
      * [lang] Return syn::Error instead of panicking
      
      * Make clippy happy
      
      * [lang] Reduce code dup with non_hex_err
      
      * [lang] Rename fn
      
      * [lang] Fix err functions
      
      * [lang] Add comments
      
      * [lang] Remove unnecessary lifetime
      0eca603f
  12. 03 Nov, 2020 1 commit
    • Michael Müller's avatar
      Add demonstration how to mock transferred_balance (#555) · a35f76ac
      Michael Müller authored
      * [chores] implicitely ➜ implicitly
      
      * [examples] Add demonstration of how to mock transferred_balance
      
      * [lang] Fix clippy 'needless_lifetimes'
      
      Error was:
      
      explicit lifetimes given in parameter types where they could
      be elided (or replaced with `'_` if needed by type declaration)
      
      * [lang] Apply cargo fmt
      
      * [examples] Fix param
      a35f76ac
  13. 30 Oct, 2020 1 commit
    • Michael Müller's avatar
      Add example which uses ext_transfer + ext_terminate (#554) · 89620e7d
      Michael Müller authored
      
      
      * [chores] Fix typo: invokation ➜ invocation
      
      * [chores] Fix typo: timstamp ➜ timestamp
      
      * [chores] Fix typo: ininitialized ➜ initialized
      
      * [env] Implement terminate_contract in off-chain env
      
      * [examples] Add lock-until
      
      * [env] Implement proper off-chain testing for ext_terminate
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarHero Bird <robin.freyler@gmail.com>
      
      * [env] Fix Environment type
      
      * [env] Derive Balance/AccountId from Environment
      
      * [env] Fix types in macro
      
      * [examples] Remove lock-until
      
      * [examples] Add contract-terminate
      
      * [examples] Add contract-transfer
      
      * [examples] Make clippy happy
      
      * [examples] Fix example name
      
      * [examples] Remove Default impls
      
      * [examples] Move macro to contract-terminate/test_utils
      
      * [env] Migrate macro to fn which gets Environment type param
      
      * [env] Add explanatory dev comment
      
      * [examples] Allow clippy::new_without_default
      
      Co-authored-by: default avatarHero Bird <robin.freyler@gmail.com>
      89620e7d
  14. 26 Oct, 2020 1 commit
  15. 22 Oct, 2020 2 commits
    • Hero Bird's avatar
      Craft ink! 3.0-rc2 release (#536) · 75d3b99c
      Hero Bird authored
      * [releases] add release notes for ink! 3.0-rc2
      
      * [*] bump crate versions to ink! 3.0-rc2
      
      * [releases] add missing ink! 3.0-rc2 release note
      75d3b99c
    • Hero Bird's avatar
      Misc fixes for ink! 3.0-rc1 (#530) · 22b3014a
      Hero Bird authored
      * [benches] fix lazy benchmarks
      
      * [*] fix Cargo.toml documentation links
      
      * [readme] show CI status of master branch always
      
      * [readme] misc improvements
      
      * [storage] make re-export of LazyHashMap inline
      
      * [releases] add notes about ink_core split
      
      * [allocator] add some crate level docs
      
      * [storage] impl scale_info::TypeInfo for ink_storage::alloc::Box
      
      * [metadata] improve docs slightly
      
      * [storage] re-introduce StorageLayout impl for storage::Box
      22b3014a
  16. 09 Oct, 2020 3 commits
  17. 08 Oct, 2020 2 commits
    • Hero Bird's avatar
      Rename EnvTypes -> Env (and many other renamings) (#513) · 8edbfd28
      Hero Bird authored
      * [env] rename Env -> EnvBackend, TypedEnv -> TypedEnvBackend
      
      * [env] rename EnvError -> Error
      
      * [*] rename ink_env::EnvTypes -> Environment
      
      Namely rename:
      ink_env::EnvTypes -> Environment
      ink_env::DefaultEnvTypes -> DefaultEnvironment
      
      * [*] update cfg-if dependency 0.1 -> 1.0
      
      * [alloc] rename ink_alloc -> ink_allocator
      
      * [env] forgot to rename in lib.rs
      
      * [env, lang] fix some bugs with ink_env::EnvError -> Error renaming
      
      * [ci] adjust renaming of ink_alloc -> ink_allocator
      
      * [env] apply rustfmt
      
      * [lang/macro] re-enable disabled UI test
      
      * [examples] DNS: apply rustfmt
      
      * [examples] ERC-20, ERC-721: apply rustfmt
      8edbfd28
    • Hero Bird's avatar
      Implement event topic code generation (#510) · 6f701e50
      Hero Bird authored
      * [env] remove unnecessary copy of no longer used mod.rs
      
      * [env, lang] make crates compile again under newest Rust nightly
      
      * [env] on-chain: enhance ScopedBuffer
      
      Add append_encoded and take_appended methods.
      
      * [env] remove old Topics trait
      
      * [env] add new Topics infrastructure
      
      * [env] implement new Topics infrastructure for on/off chain environments
      
      * [env] remove dummy event
      
      * [env] make env::topics::state mod externally accessible
      
      It stays hidden in docs.
      
      * [lang/codegen] generate proper Topics impls for ink! events
      
      * [env] apply rustfmt
      
      * [lang/codegen] fix codegen for events without topics
      
      * [lang/macro] fix UI test
      
      * [env] off-chain: clean-up slightly
      
      * [examples] ERC-20: improve tests for event topics
      
      * [env] remove commented-out line
      
      * [lang/codegen] include event signature into topics
      
      This is the same as it is done for non-anonymous Solidity events.
      The signature of an ink! event is: ContractName::EventName.
      E.g. for ERC-20's Transfer event it is: Erc20::Transfer
      
      * [examples] ERC-20: adjust test for changes with event topics
      
      * [lang/ir] add support for anonymous events
      
      * [lang/codegen] add codegen for anonymous events
      
      * [lang/ir] apply rustfmt
      
      * [lang/macro] comment out failing unit test
      
      Fails due to rustc version mismatch and some recent error display change.
      
      * [examples] apply rustfmt
      6f701e50
  18. 07 Oct, 2020 1 commit
    • Andrew Jones's avatar
      Deserialize metadata (#488) · d7a47f4a
      Andrew Jones authored
      * Make public fields for InkProject and specs
      
      * Make layout fields public
      
      * Use scale-info from branch
      
      * Add Deserialize derives, use ReadOnlyRegistry
      
      * Deserialize contract metadata specs
      
      * Deserialize layout2 specs
      
      * WIP decode hex
      
      * Use impl_serde crate for hex byte string serde
      
      * Test for selector deserialization
      
      * Fix up custom deserialization
      
      * Export selector and add to_vec impl
      
      * Fmt
      
      * Fix up spec segments IntoCompact
      
      * Make name public
      
      * Update to latest scale-info master
      
      * Replace pub fields with getters
      
      * Replace pub fields with getters in spec
      
      * Fix search replace error with any::TypeId
      
      * Use scale-info 0.4
      
      * Fmt
      
      * Remove commented out getter
      
      * Fix up other scale-info deps
      
      * Clippy
      
      * Fix up message and constructor spec builder method names
      
      * Serialize empty bytes vec without 0x prefix
      d7a47f4a
  19. 05 Oct, 2020 1 commit
  20. 02 Oct, 2020 1 commit
    • Hero Bird's avatar
      Minor API surface clean-up (#502) · 4770498c
      Hero Bird authored
      * [env] remove crate-level re-exports for the hash module
      
      * [env] rename ink_env::println -> debug_println
      
      This makes the usage intent clearer.
      
      * [lang] remove deprecated method
      
      * [lang] hide all definitions that are only needed for codegen purposes
      
      * [lang] remove False, move True
      
      * [lang] remove unnecessary where bounds
      
      * [lang] add EnvAccess forwarding for built-in crypto hashes
      
      * [README] add ink_lang doc link
      
      * [env] fix on-chain compilation
      
      * [lang] apply clippy suggestion
      4770498c
  21. 01 Oct, 2020 1 commit
    • Hero Bird's avatar
      Split ink_core crate into ink_env and ink_storage (#500) · cfe52e98
      Hero Bird authored
      * [*] split ink_core into ink_env and ink_storage
      
      The workspace does not yet compile!
      
      * [env] make compile again
      
      * [env] fix doc tests
      
      * [storage] make crate compile again
      
      * [env] fix some doc comment links
      
      * [README] flipper example: remove unused import
      
      * [storage/derive] fix compilation of generated code
      
      * [README] add ink_storage and ink_env doc links
      
      * [env, primitives, storage] fix docs
      
      * [lang] make compile again
      
      * [lang/codegen] use absolute paths in #[ink::test] proc. macro
      
      * [examples] make compile again
      
      * [*] apply rustfmt
      
      * [env] remove unneeded dependencies
      
      * [storage] remove all unneeded dependencies and crate features
      
      * [*] update outdated dependencies
      
      * [env, lang] remove unused dependencies
      
      * [*] fix comments
      
      * [*] fix some intra doc links
      
      * [ci] adjust to split ink_env and ink_storage crates
      
      * [ci] forgot to handle split ink_env and ink_storage in docs
      
      * [storage] fix fuzz tests
      
      * [examples] apply rustfmt
      
      * [examples] apply rustfmt (ERC-721)
      cfe52e98
  22. 30 Sep, 2020 1 commit
  23. 29 Sep, 2020 1 commit
    • Hero Bird's avatar
      Move all ink! crates into the crates directory (#494) · 31276d89
      Hero Bird authored
      * [*] move all ink! crates into crates/ directory
      
      * [ci] adjust .gitab-ci.yml to crates/ directory
      
      * [ci] fix GitLab .gitlab-ci.yml (attempt #2)
      
      * [ci] forgot some lines in attempt #2
      
      * [examples] fix example smart contracts
      
      They need to readjust their paths for the crates/ directory.
      31276d89