This project is mirrored from https://github.com/paritytech/ink.git. Pull mirroring updated .
  1. 25 Oct, 2021 1 commit
  2. 23 Oct, 2021 1 commit
    • Robin Freyler's avatar
      Add SpreadAllocate and PackedAllocate traits and impls (#978) · 4b5d91a8
      Robin Freyler authored
      * improve docs of PackedLayout methods
      
      * add SpreadAllocate trait
      
      Note: We cannot add allocate_spread to SpreadLayout trait since certain types (such as Result<T, E>) that implement SpreadLayout cannot implement SpreadAllocate; OR certain types can trivially implement SpreadLayout but are constraint with respect to SpreadAllocate and vice versa.
      
      * add PackedAllocate trait
      
      * add utility methods for SpreadAllocate and PackedAllocate traits
      
      * improve macro hygiene of some trait impl code dupe macros
      
      * normalize some import statement
      
      * apply rustfmt
      
      * implement {Spread,Packed}Allocate traits for primitive and prelude types
      
      * implement {Packed,Spread}Allocate for std collections
      
      * implement {Packed,Spread}Allocate for array primitives
      
      * improve Codec impl for ink_storage::Pack<T>
      
      * add {Packed,Spread}Allocate impl for ink_storage::Pack<T>
      
      * add {Packed,Spread}Allocate impl for ink_storage::Memory
      
      * add missing #[inline] annotations to ink_storage::Memory<T>
      
      * implement {Packed,Spread}Allocate for tuple types
      
      * add {Spread,Packed}Allocate impl for lazy storage abstractions
      
      * add some #[inline] annotations
      
      * add SpreadAllocate impl for Lazy<T>
      
      * add SpreadAllocate impl for StorageVec
      
      * add SpreadAllocate impl for StorageStash
      
      * derive Default for Header
      
      * remove unused import
      
      * implement SpreadAllocate for the rest of the ink! storage collections
      4b5d91a8
  3. 22 Oct, 2021 1 commit
    • Michael Müller's avatar
      Upgrade `libsecp256k1` from 0.3.5 ➔ 0.7.0 (#967) · 4534c4a1
      Michael Müller authored
      * Upgrade `libsecp256k1` from `0.3.5` ➔ `0.7.0`
      
      * Include off-chain dependencies only when necessary
      
      * Include off-chain dependency only when necessary
      
      * Include off-chain dependency only when necessary
      
      * Switch to `secp256k1` for `eth_compatibility` crate
      
      * Remove conditional dependency
      
      * Fix serialize
      
      * Switch to `secp256k1` crate everywhere
      
      * Switch to `secp256k1` crate everywhere
      
      * Fix compilation for `wasm32` target
      
      * Ensure enabled features are not merged for targets
      
      * Make clippy happy
      
      * Use resolver `2` in all examples
      
      * Switch to `libsecp256k1` 0.7.0
      
      * Use default features
      
      * Bring comment back
      
      * Reduce diff
      
      * Remove unnecessary import
      
      * Update rustfmt config to edition 2018
      
      * Use resolver `2` for workspace
      4534c4a1
  4. 21 Oct, 2021 4 commits
    • Robin Freyler's avatar
      Use edition 2021 (#977) · c90da116
      Robin Freyler authored
      * update Rust edition 2018 -> 2021
      
      * fix some doc tests due to Rust edition 2021 upgrade
      c90da116
    • Robin Freyler's avatar
      Always revert state upon encountering Result::Err (#975) · ddf40e9c
      Robin Freyler authored
      * always revert state upon encountering Result::Err
      
      This fixes some misconception between ink! and SEAL.
      
      * fix UI test
      
      * decode result in case callee reverted
      
      * compile fixes
      
      * fix UI test
      
      * fix UI test
      ddf40e9c
    • Robin Freyler's avatar
      Optimize get property for most primitive types (#974) · 764a44a9
      Robin Freyler authored
      * implement get_propery optimization for caller, gas_left and account_id
      
      * implement optimization for little-endian types
      
      * make most of the property query functions infallible
      
      * adjust ERC-20 example for changes
      
      * apply rustfmt
      
      * fix ink_lang_macro doc tests
      
      * fix contract-terminate example contract
      
      * fix contract-transfer example
      
      * fix ERC-20 and trait-ERC-20 example contracts
      
      * fix ERC-721 example
      
      * fix UI test
      
      * fix some off-chain tests
      
      * apply rustfmt
      764a44a9
    • Robin Freyler's avatar
      Base Key on [u8; 32] (#971) · ee9015df
      Robin Freyler authored
      * implement new Key2 primitive that is based on [u8; 32]
      
      * implement Key::add_assign_u64_using method
      
      * integrate new Key type into the rest of the ink! codebase
      
      * rename key2.rs -> key.rs
      
      * fix some Wasm build bugs with new Key type integration
      
      * add #[inline] to Key::add_assign_u64_using method
      
      * optimize Key add assign methods
      
      Somehow those new implementations optimize better ...
      
      * apply rustfmt
      
      * fix hunspell issues
      
      * fix clippy issues
      
      * improve LazyArray and LazyIndexMap impls
      
      * rename add_assign_u64_using to add_assign_using and make it generic
      
      Generic over T where T: Into<u64> so it accepts u32 as well etc.
      
      * remove unnecessary cast
      ee9015df
  5. 20 Oct, 2021 2 commits
    • Robin Freyler's avatar
      Implement new trait definition codegen 🚀 (#665) · e8d47396
      Robin Freyler authored
      * fix spelling error in docs
      
      * remove commented-out code
      
      * move query_amount_{constructors,messages} utilities into own functions
      
      * implement codegen for constructor decoder enum type
      
      * slightly refactor AcceptsPayments and EnablesDynamicStorageAllocator
      
      * fix bug that spans of ink! trait messages have not been registered
      
      * add codegen for ExecuteDispatchable for constructor decoder
      
      * add codegen for expr to query if any ink! message if payable
      
      * implement preliminary codegen for new ink! dispatch entry points
      
      * add ink_lang::execute_constructor_2 utility dispatch function
      
      * demand ExecuteDispatch trait impl from generated decoder types
      
      * trait-incrementer constructor now takes and sets initial value
      
      * apply rustfmt
      
      * implement message decoder type codegen for new dispatch
      
      * enable entry point codegen for new dispatch
      
      * fix doc comment
      
      * remove old dispatch codegen
      
      * rename dispatch2 module to dispatch
      
      * apply rustfmt
      
      * generate dispatch info trait impls always
      
      They are useful generally and not only when compiled as root contract.
      
      * no longer generate unnecessary braces in new dispatch codegen
      
      * adjust UI tests for new dispatch codegen
      
      * no longer derive core::fmt::Debug for dispatch decoder types
      
      This fixes a doc test since this implied a Debug bound on all message and constructor inputs.
      
      * fix bug in dispatcher utility method
      
      * remove all no longer needed types and traits from ink_lang crate
      
      Due to the new ink! codegen many of these definitions have become deprecated or obsolete.
      
      * fix UI test
      
      * silence non-minimal bool clippy warning in expanded code
      
      * fix bug in dispatch codegen
      
      Only check for payment if message is not payable and not all messages are not payable, too.
      
      * add IsDocAttribute::extract_docs utility method for ink! IR
      
      * overhaul ink! metadata codegen
      
      This now properly takes into consideration the payable and selector properties of ink! trait messages.
      
      * silence bad clippy warning
      
      * rename execute_{message_2, constructor_2} to execute_{message, constructor}
      
      * make ink! root contract messages revert state when returning Result::Err(_)
      
      * fix some formatting issues
      
      * extend is_result_{type, err} unit tests
      
      * improve error messages for invalid ink! input and output types
      
      This checks for ink! constructor and message inputs to be scale::Decode + 'static and for ink! output types to be scale::Encode + 'static.
      Also added new UI tests to assert that this works for ink! message and constructor inputs.
      
      * add missing UI test expectation files
      
      * add UI tests for many ink! message and constructor inputs and outputs
      
      * move noop contract UI test
      
      * normalize UI test
      
      * add passing UI tests for payable and selector properties
      
      * improve passing ink! message selector UI test
      
      * add passing UI test for ink! constructor selector property
      
      * add UI tests for ink! storage structs with various fields
      
      * add passing UI tests for ink! events
      
      * add passing packed ink! storage struct UI test
      
      * improve macro hygiene in StorageLayout derive impl
      
      * add no-implicit-prelude passing UI test
      
      Currently disabled since static_assertions dependency has macro hygiene problems with respect to no_implicit_prelude.
      
      * add impl alias passing UI test
      
      * modernize passing UI test for ink! storage struct derives
      
      * modernize flipper example contract passing UI test
      
      * add new trait-flipper example passing UI test
      
      * add new passing UI test for #[ink(impl)] property
      
      * rename 03-incrementer-contract UI test
      
      * modernize example incrementer passing UI test
      
      * apply rustfmt to UI test
      
      * fix a doc test in ink_storage_derive crate
      
      * add passing UI test for trait based incrementer example ink! smart contract
      
      * apply rustfmt to UI test
      
      * add passing UI tests for #[ink::contract] configs
      
      * add passing UI test for #[ink::contract(env = ..)] config
      
      * modernize env-access passing UI test
      
      * modernize passing UI test to assert Rust items are properly expanded
      
      * add passing UI test to assert existence of aliases for all env types
      
      * rename remaining passing UI tests
      
      * move commented out UI test to top
      
      * move passing UI contract example tests to end
      
      * fix StorageLayout derive unit tests
      
      * replace vec! by plain old arrays in StorageLayout derive expansion
      
      * remove plenty of usages of vec! macro in the ink! codebase
      
      * improve macro hygiene in call_builder codegen
      
      * slightly reformat erc20 UI test
      
      * add ink! event passing UI tests
      
      * move minimal ink! smart contract UI test case to front
      
      * modernize simple definition UI test
      
      * add simple no-implicit-prelude UI test for ink::trait_definition macro
      
      The test case is disabled for now since the currently used parity-scale-codec produces macro hygiene errors.
      
      * add some #[ink::trait_definition] UI tests
      
      * rename #[ink::trait_definition] UI tests
      
      * add UI tests for #[ink::trait_definition] with async and const messages
      
      * add more UI tests for #[ink::trait_definition]
      
      * normalize #[ink::trait_definition] UI tests
      
      * normalize some UI tests
      
      * add new UI tests for #[ink::trait_definition]
      
      * add more UI tests for #[ink::trait_definition]
      
      * add more UI tests for #[ink::trait_definition]
      
      * generate guards for scale::Codec message inputs and outputs for ink! trait definitions
      
      * add UI tests for non-codec message inputs and outputs for #[ink::trait_definition]
      
      * fix spelling issue
      
      * apply rustfmt to test case
      
      * fix some spelling issues
      
      * implement ink! trait message selector and payable property guards
      
      * add UI tests for ink! trait message payable and selector property guards
      
      * add passing UI tests for payable and selector property guards
      
      * fix ERC-1155 example ink! smart contract
      
      The contract broke due to ink! now checking if selectors of ink! trait message definitions and implemented ink! trait messages match.
      
      * disallow #[ink(namespace)] property on ink! trait impl blocks
      
      * add UI tests for #[ink(namespace)] attribute
      
      * fix unit tests that make use of #[ink(namespace = ..)]
      
      * update UI test case expectations
      
      * use "diff" crate feature of trybuild crate
      
      * fix some ink! specific error messages
      
      * fix and improve some attribute error messages
      
      * modernize failing #[ink::contract] UI tests
      
      * fix some UI tests
      
      * use wildcards in UI test inclusion pattern
      
      * rename InkTraitDefinitionRegistry -> TraitDefinitionRegistry
      
      * fix some tests
      
      * apply rustfmt
      
      * rename ink_lang::type_check module to codegen and make it a folder
      
      * rename BaseEvent trait to ContractEventBase
      
      * replace static_assertions usage by custom solution
      
      This leads to fewer dependencies and also to better error messages.
      
      * remove static_assertions dependency from ink_lang
      
      * apply rustfmt
      
      * fix some examples
      
      * move TraitMessage{Payable,Selector} into codegen submodule
      
      * remove superflous True trait from ink_lang
      
      * add ExecuteMessageConfig
      
      * refactor ink_lang dispatch definitions
      
      * add show-codegen-docs crate feature to ink_lang to unhide the codegen module
      
      * fix docs and add doc example tests to IsSameType
      
      * add doc example tests to DispatchInput and DispatchOutput types
      
      * fix spelling issues
      
      * fix trait definition UI tests
      
      * rename TraitImplementer -> TraitImplementedById and move into codegen module
      
      * apply rustfmt
      
      * move ImpliesReturn to ink_lang::codegen module and improve doc comments
      
      * remove re-export of ImpliesReturn from ink_lang
      
      It is now exported from the ink_lang::codegen sub module.
      
      * fix spelling issues
      
      * fix UI tests
      
      * move ink! trait definition codegen definitions into trait_def submodule
      
      * move TraitDefinitionRegistry into new ink_lang::reflect module
      
      * unhide docs for TraitDefinitionRegistry
      
      * enable no-implicit-prelude UI test
      
      * add doc comment to reflect module
      
      * update docs of TraitDefinitionRegistry
      
      * move definitions for dispatch reflections into reflect submodule
      
      * add usage example to COntractAmountDispatchables reflect trait
      
      * add doc comment note to ContractAmountDispatchables trait
      
      * add enforced newline to docs
      
      * improve docs
      
      * update docs for ContractDispatchableMessages trait
      
      * improve doc test
      
      * update docs of ContractDispatchableConstructors trait
      
      * apply rustfmt
      
      * fix hunspell dict
      
      * remove non-existing optional UI test comments
      
      * merge UI tests into one fat one
      
      This (hopefully) fixes the flaky codecov CI for now ...
      
      * use new selector_id! macro instead of raw values in doc tests
      
      * add usage docs to DispatchableMessageInfo trait
      
      * improve doc test
      
      * add usage example to DispatchableConstructorInfo trait docs
      
      * add note and usage example for ContractMessageDecoder docs
      
      * add usage example to ContractConstructorDecoder docs
      
      * improve docs of some reflect types in ink_lang
      
      * improve docs
      
      * move TraitMessageInfo into reflect submodule
      
      * remove invalid static_assertions imports
      
      * take &mut [u8; 32] instead of &mut [u8] for blake2b output
      
      * make local_id of trait_def equal to selector of the message identifier
      
      * modernize payable_message UI trait_def passing test
      
      * add usage example to TraitMessageInfo trait
      
      * fix composed selector calculation for empty ink! trait namespaces
      
      * apply rustfmt
      
      * extend usage example for TraitMessageInfo trait docs
      
      * hopefully fix some weird spelling issues
      
      * make ink! trait definitions actually use the namespace config
      
      * extend usage example for TraitMessageInfo docs
      
      * rework some ink! trait definition passing UI tests
      
      * add new passing UI test for ink! trait definitions concerning namespaces
      
      * add fail UI tests for ink! trait definitions concerning overlapping selectors
      
      * move ContractName into reflect sub-module and add docs and usage example
      
      * move ContractEnv trait to reflect module and add extensive docs and usage examples
      
      * apply clippy suggestions
      
      * move ContractReference trait to reflect module
      
      * apply rustfmt
      
      * fix some usage doc tests
      
      * add extensive docs and usage example to ContractReference trait
      
      * improve docs
      
      * improve docs (2)
      
      * move DispatchError to the reflect submodule
      
      * add new event topic guards codegen to ink! codegen
      
      * apply rustfmt and fix PhantomData import
      
      * re-export RespectTopicLimit trait
      
      * modernize trait_erc20 example contract
      
      * move Env and StaticEnv into ink_lang::codegen module
      
      * conditionally import EmitEvent trait anonymously for ink! impl blocks
      
      * fix some UI tests
      
      * move EmitEvent trait to ink_lang::codegen module
      
      * fix UI tests
      
      * fix UI tests
      
      * add passing UI test for self.env() and Self::env() syntax
      
      * add failing UI tests for missing #[ink(impl)] annotation
      
      * move ContractEventBase trait to ink_lang::reflect submodule
      
      * apply rustfmt
      
      * add usage example to ContractEventBase docs
      
      * move TraitModulePath to ink_lang::reflect submodule
      
      * move ink! trait call builder codegen facilities to ink_lang::codegen submodule
      
      * move ContractCallBuilder to ink_lang::codegen submodule
      
      * move IsSameType and identity_type into ink_lang::codegen::utils module
      
      * rename identity_type to consume_type
      
      * apply rustfmt
      
      * add usage examples to consume_type docs (+ missing rename)
      
      * fix codegen to allow for environmental type usage in ink! trait definitions
      
      * add UI test that uses environmental types in ink! trait definition
      
      * apply rustfmt
      
      * remove unused Selector::unique_id method
      
      * remove Selector::from_bytes
      
      Users should use Selector's From<[u8;4]> implementation instead.
      
      * rename Selector::new -> Selector::compute
      
      * fix some UI tests for rename
      
      * change API: Selector::as_bytes -> Selector::to_bytes and return by value
      
      * add payability to hunspell dict
      
      * use ink! trait info object instead of uniqe trait ID for TraitCallForwarderFor trait
      
      * adjust UI tests
      
      * apply rustfmt
      
      * remove TraitUniqueId trait
      
      * remove TraitImplementedById and utilities to compute ink! trait verify hash
      
      * remove unused CannotCallTraitConstructor variant
      
      * Update to using trybuild version 1.0.49
      
      This forces most or all of the failure UI tests to be adjusted slightly.
      
      * add comment that explains why we have both result checks in execution
      
      * introduce DecodeDispatch trait
      
      This replaces the bare use of scale::Decode for ink! constructor and message decoders.
      The advantage is that it can return DispatchError instead of scale::Error.
      Also adds new UI test and docs with a usage example.
      
      * use selector_bytes! in UI test
      
      * slightly improve fail UI tests
      
      * fix warning in passing UI test
      
      * add new UI test to guard against trait message selector overlaps
      
      * move UI tests from ink_lang_macro to ink_lang crate directory
      
      * adjust UI tests after moving
      
      * remove unused dev-dependencies from ink_lang_macro after moving UI tests
      
      * fix compilation error with Wasm target
      
      * fix CI with formatting checks for UI tests
      
      * add unpayable to hunspell dictionary
      
      * fix hunspell spelling issues
      
      * move ink-experimental-engine to ink_lang crate
      
      Used by unique topics test.
      
      * update UI tests for new nightly compiler
      
      * add missing fixed UI tests
      
      * fix spelling issue in UI test
      
      * add docs explaining usage of AccumulatorRef et.al. in delegator example
      
      * extend is_result unit tests
      
      * re-add pretty assertions
      
      * normalize used version in ink-metadata crate
      
      * add skeleton for ink! 3.0-rc7 in RELEASES
      
      * add release information about this PR to RELEASES.md
      
      * use ink! 3.0-rc6 in multisig example contract
      
      * fix docs
      
      * remove commented out code
      
      * use unzip to partition input_bindings and input_types (thanks andrew!)
      
      * improve #[ink(extension)] missing parameter error message
      e8d47396
    • Michael Müller's avatar
      Add compatibility notes for rc6 (#969) · d85565ee
      Michael Müller authored
      * Add compatibility notes for rc6
      
      * Add word 'versioned' to dictionary
      
      * Add compatible scale version
      d85565ee
  6. 19 Oct, 2021 2 commits
  7. 18 Oct, 2021 2 commits
  8. 15 Oct, 2021 1 commit
  9. 14 Oct, 2021 2 commits
    • GreenBaneling | Supercolony's avatar
      Implemented ECDSA recover function. (#914) · 284e4e55
      GreenBaneling | Supercolony authored
      * Implemented ecdsa recovery function.
      Added method `to_eth_address` and `to_account_id`.
      Added tests.
      
      * Cargo fmt
      
      * Added `ECDSA` and `Ethereum` to dictionary
      
      * Fixed comments according a new spellcheck
      
      * Fixes according comments in review.
      
      * Fixed build issue for wasm
      
      * Use struct instead of alias for `EthereumAddress`.
      
      * cargo fmt --all
      
      * Simplified `ecdsa_recover`.
      USed symbolic links instead files.
      
      * Added documentation for `to_eth_address` and `to_account_id` methods.
      
      * Renamed `to_account_id` into `to_default_account_id`
      
      * Cargo fmt
      
      * Removed DeRef trait. Now field of `EthereumAddress` and `ECDSAPublicKey` is private.
      
      * Fixed doc test for ecdsa_recover in EnvAccess
      284e4e55
    • Dan Shields's avatar
      move to substrate.io (#957) · 2f4f4f05
      Dan Shields authored
      
      Co-authored-by: default avatarDan Shields <danwshields@gmail.com>
      2f4f4f05
  10. 11 Oct, 2021 1 commit
  11. 10 Oct, 2021 2 commits
  12. 09 Oct, 2021 1 commit
  13. 05 Oct, 2021 1 commit
  14. 04 Oct, 2021 1 commit
    • Robin Freyler's avatar
      Implement selector_id!, selector_bytes! and blake2x256! macros (#947) · bd4b51e3
      Robin Freyler authored
      * add selector_id! and selector_bytes! proc macros
      
      * implement blake2x256! macro
      
      * re-export blake2x256! macro from ink_lang crate
      
      * apply rustfmt
      
      * add BLAKE2b to hunspell dictionary
      
      * add UI tests for blake2x256! macro
      
      * improve span for non-literal inputs to blake2x256! macro
      
      * add non-literal input failure UI test to blake2x256! macro
      
      * improve error span for non-literal selector_{id,bytes}! macro inputs
      
      * rename UI test blake2x256 -> blake2x256_macro
      
      * rename UI test
      
      * add UI tests for selector_id! proc. macro
      
      * fix UI test
      
      * fix UI test expectation
      
      * add UI tests for seletor_bytes! macro
      
      * make flaky and broken codecov CI happy again ...
      bd4b51e3
  15. 29 Sep, 2021 1 commit
  16. 28 Sep, 2021 1 commit
  17. 27 Sep, 2021 1 commit
    • tash-2s's avatar
      [storage] Allow one variant enum to derive SpreadLayout (#942) · fd94d383
      tash-2s authored
      
      
      * [storage] Allow one variant enum to derive SpreadLayout
      
      I have an enum that has only one variant, and I want to store the enum value in the storage. I might add new variants later in development, so the enum is not useless.
      
      The current implementation doesn't allow to derive the `SpreadLayout` trait for one variant enums, and I fixed it on this PR.
      
      # Sample code
      
      ```rust
      #![cfg_attr(not(feature = "std"), no_std)]
      
      use ink_lang as ink;
      
      #[derive(
          Copy,
          Clone,
          scale::Encode,
          scale::Decode,
          ink_storage::traits::SpreadLayout,
          ink_storage::traits::PackedLayout,
      )]
      #[cfg_attr(
          feature = "std",
          derive(scale_info::TypeInfo, ink_storage::traits::StorageLayout)
      )]
      pub enum MyEnum {
          A,
      }
      
      #[ink::contract]
      mod enum_test {
          use super::MyEnum;
      
          #[ink(storage)]
          pub struct EnumTest {
              value: MyEnum,
          }
      
          impl EnumTest {
              #[ink(constructor)]
              pub fn new() -> Self {
                  Self { value: MyEnum::A }
              }
      
              #[ink(message)]
              pub fn get(&self) -> MyEnum {
                  self.value
              }
          }
      }
      ```
      
      Without this change, I get this error.
      
      ```
      $ cargo +nightly contract build
       [1/5] Building cargo project
          Updating crates.io index
         Compiling enum_test v0.1.0 (/private/var/folders/zn/l2f569z56vnghtt524x1mv6w0000gn/T/cargo-contract_FM50JF)
      error: proc-macro derive panicked
        --> /snip/enum_test/lib.rs:10:5
         |
      10 |     ink_storage::traits::SpreadLayout,
         |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: message: can only operate on enums
      ```
      
      * Update crates/storage/derive/src/spread_layout.rs
      Co-authored-by: Hero Bird's avatarRobin Freyler <robbepop@web.de>
      
      * cargo fmt
      Co-authored-by: Hero Bird's avatarRobin Freyler <robbepop@web.de>
      fd94d383
  18. 23 Sep, 2021 2 commits
  19. 22 Sep, 2021 2 commits
    • Robin Freyler's avatar
    • Michael Müller's avatar
      Fix code coverage (#917) · 511b9c68
      Michael Müller authored
      * Add `-Clink-dead-code`
      
      * Test trait cross-call only when not measuring code coverage
      
      Otherwise a linker error will happen due
      to `__ink_enforce_error` being included.
      
      * Fix `clippy::derivable_impls`
      
      * Fix `dead_code`
      
      The `struct` is only a public-facing API.
      
      * Fix yaml
      
      * Remove `allow(dead_code)`
      
      * Actually use `$POLL_SLEEP`
      
      * Produce `unreachable!` instead of linker error for `codecov` CI stage
      
      * Move `if` condition outside of `quote`
      
      * Improve macro hygiene
      
      * Reduce code duplication
      511b9c68
  20. 21 Sep, 2021 7 commits
    • Robin Freyler's avatar
      Misc cleanups in ink! codegen (#935) · b4e2781c
      Robin Freyler authored
      * remove some duplicated AsRef impl code in generators
      
      * improve #[ink::test] macro hygiene and error message upon failure
      
      * import standard ink! traits anonymously in codegen
      
      * modernize and improve macro hygiene of metadata codegen
      
      * modernize and simplify and improve macro hygiene of storage codegen
      
      * extend selector_works unit test
      
      * fix minor error in item impl error message
      b4e2781c
    • Robin Freyler's avatar
      Move ink_lang_macro UI tests into macro-specific folders (#934) · 87867ef8
      Robin Freyler authored
      * move ink_lang_macro UI tests into macro-specific folders
      
      * fix GitLab CI formatting pass
      
      * migrate back to a single trybuild test case
      
      This is because our CI currently fails if we have multiple test cases.
      87867ef8
    • Robin Freyler's avatar
      Add trait-incrementer example smart contract (#932) · 7577c678
      Robin Freyler authored
      * add trait-incrementer example smart contract
      
      * apply review comments
      7577c678
    • Robin Freyler's avatar
      Refactor and modernize dispatch codegen (#933) · 0270add0
      Robin Freyler authored
      * implement Display for ink_lang::Error
      
      * re-export HexLiteral trait from ink_lang_ir crate
      
      * use big-letters for hex-encoded message and constructor identifiers in codegen
      
      * improve panic messages in dispatch codegen for call and deploy fns
      
      * improve macro hygiene in dispatch codegen
      
      * add ir::Selector::into_be_u32 method
      
      * improve and modernize dispatch selector namespace codegen
      0270add0
    • Michael Müller's avatar
      Fix script which triggers downstream pipelines (#929) · b9eb9bec
      Michael Müller authored
      * Exit with 1 in case of timeout
      
      * Increase timeout to 1h, make configuration easier
      
      * Echo timeout
      b9eb9bec
    • Robin Freyler's avatar
      Check namespace argument is identifier (#931) · 41b0a1c0
      Robin Freyler authored
      * check that argument in #[ink(namespace = "argument")] is a Rust identifier
      
      * add UI tests for #[ink(namespace = "..")] ink! property
      
      # Conflicts:
      #	crates/lang/macro/tests/compile_tests.rs
      #	crates/lang/macro/tests/ui/fail/N-01-namespace-invalid-identifier.rs
      #	crates/lang/macro/tests/ui/fail/N-01-namespace-invalid-identifier.stderr
      #	crates/lang/macro/tests/ui/fail/N-02-namespace-invalid-type.rs
      #	crates/lang/macro/tests/ui/fail/N-02-namespace-invalid-type.stderr
      #	crates/lang/macro/tests/ui/fail/N-03-namespace-missing-argument.rs
      #	crates/lang/macro/tests/ui/fail/N-03-namespace-missing-argument.stderr
      
      * fix error message for non-identifier namespace argument
      41b0a1c0
    • Robin Freyler's avatar
      09ec050e
  21. 20 Sep, 2021 3 commits
    • Robin Freyler's avatar
      Expand selectors as hex-encoded literals in metadata (#927) · 725c2f70
      Robin Freyler authored
      * add HexLiteral utility trait to expand hex-encoded integer literals
      
      * add ir::Selector::hex_lits method
      
      * expand into hex-encoded integer literals for metadata selectors
      
      * simplify Selector::hex_lits method using array::map API
      
      * add unit test for Selector::hex_lits method
      725c2f70
    • Robin Freyler's avatar
      Improve SpreadLayout and StorageLayout derive macro hygiene (#926) · 9bab4838
      Robin Freyler authored
      * miscellaneous improvements to macro hygiene in derive macros
      
      * fix storage_derive UI tests
      9bab4838
    • Robin Freyler's avatar
      Make #[ink(selector = ..)] take a u32 parameter instead of a string (#928) · c9a97bbe
      Robin Freyler authored
      * make #[ink(selector = ..)] take an integer instead of a string
      
      Also warn about deprecation if a user still uses the old string parameter.
      
      * update tests for new selector int parameter
      
      * update contract examples for new selector int parameter
      
      * remove unused regex dependency from ink_lang_ir
      
      Also remove unnecessary regex dependency from ink_lang_codegen
      
      * update README for new selector int parameter
      
      Also update namespace parameter description.
      
      * update preliminary release notes
      
      * update spellcheck dict
      c9a97bbe
  22. 17 Sep, 2021 1 commit