- 28 Sep, 2022 1 commit
-
-
Michael Müller authored
* Add missing words to spellcheck dictionary * Add `contracts-node.scale` metadata Has been exported via cargo install subxt-cli subxt metadata > contracts-node.scale For `substrate-contracts-node` v0.20.0. * Run `substrate-contracts-node` in CI * Invoke `cargo doc` separately for each crate * Add MVP for E2E testing framework * Add E2E tests for `contract-transfer` example * Add ToDo comment for migration to `state_call` RPC * Update to new `ink` entrance crate * Add ToDo for `node_log_contains` * Update to `ink` entrance crate * Migrate to `state_call` RPC * Always initialize `env_logger` * Use latest `subxt` release * Remove superfluous TODO * Apply `cargo fmt` * Adapt test fixtures
-
- 05 Sep, 2022 1 commit
-
-
GreenBaneling | Supercolony authored
* Import new unstable functions with transparent hashing. Updated the API to work with the generic key `K: Encode` instead of the old `Key`. Also, the change contains optimization to reduce the size of contracts. In most cases, it is `#[inline(always)]`; but `return_value` also got small optimization; removed usage of `extract_from_slice` where it is not needed. * primitives crate: Removed old 32 bytes `Key`. Replaced it with `u32`. Added `KeyComposer`, it is a helper struct that does all manipulation with the storage key. It allows concat two storage keys into one, compute storage key for fields based on the filed, struct, enum, variants names. Removed all tests and benches. Didn't add it for new primitives because the key is standard `u32` and all keys are calculated during compilation. storage crate: Removed `SpreadLayout`, `PackedLayout`, `SpreadAllocate`, `PackedAllocate`, and all related helper functions. Removed `Packed` struct cause it is the default behavior for storage right now. Added `Lazy` struct that allows `get`/`set` value from/into the storage. It is similar to `Mapping` but works with one storage key and one value. Introduced new main traits to work with storage in `storage/src/traits/storage.rs`. Also added a new `OnCallInitializer` trait to improve the flow with upgradable contracts and support initialization on demand by default. Added `pull_or_init` macro that inits the storage struct if it is impossible to load it. It also can be used as optimization for contracts without an explicit constructor. Replaced implementation of old traits for main primitives with a new one. Added blanket implementation of new traits for structures that are `Packed` by default. It reduces the amount of code and adds support of generic structures but adds problems with tuples(now tuples implement new traits only if inner items are `Packed`). Introduced `AutoKey` and `ManualKey` that allows specifying which key the user wants to use. Added support of it into all traits and structures. Refactored `Mapping` to follow new rules. * metadata crate: Updated storage layout in the metadata. Introduces the concept of roots and leafs. Root defines the storage key for all sub-tree until there will be another Root. Leafs are common types that are part of the sub-tree and serialized/deserialized together into one storage key. Replaced 32 bytes storage key with `u32`. Added validation that all root storage keys don't overlap. Maybe better to add that error or reuse that validator on the `cargo-contract` side to show a more user-friendly error. `RootLayout` and validator are used in codegen(next commit). The contract is wrapped into `RootLayout`, and we do validation for that tree. Metadata now contains name for each struct/enum/variant/field. It is useful information because now the storage key is calculated based on the name of struct/enum/variant/field. storage crate: Added a new helper crate `storage/codegen`. It contains some useful functional that is used in `ink_storage_derive` and in `ink_lang_codegen` crates. It has a method that returns all types of the struct/enum/unit and a method that finds "salt" in the generics of the struct/enum. It uses magic constant "KeyHolder"(about that you can read in issue) to find salt, so I tried to have only one place where we are using that constant. Replaced derive implementation of old trait with new one. You can check the tests to see how the implementation looks like. `Storable` recursively call `encode` and `decode` for all fields. `KeyHolder` return key of the salt. `Item` uses `AutoKey` or key specified by the user. I want to highlight that `PreferredKey` only is used with the `AutoItem` trait. If `PreferredKey` is `AutoKey`, then `AutoItem<AutoGenerated>` select auto-generated key, otherwise preferred. So `AutoItem` trait decides that key to use. It is why derive macro only set `PreferredKey`. Updated drive for `StorageLayout`, now it uses `u32` and pass name of the struct into metadata. * Removed `initialize_contract` and related to initialization stuff. Now the codegen uses `pull_or_init` in the `call`. Updated `execute_constructor` to work with new storage methods. Allowed usage of generics during the declaration of the primary contract storage. Users can specify the default storage key with `KeyHolder` via generic. Added parser for `storage_item` macro with its config. * Removed the old codegen related to spread and packed layout. If some object implements `Decode` and `Encode`, it is `Packed`, and it uses the blanket implementation of new traits. In dispatch, codegen started to use a new method to work with storage. In metadata codegen added usage of new `RootLayout`. We wrap the contract into that layout because the contract has its storage key for all inner fields by default. Also added a run of validation logic during metadata generation. Added `storage_item` macro. It transforms all types from autokey into manual key(if types support it). It calculates the storage key based on the name(it uses the `KeyComposer::compute_key` function from the primitives crate). Also, macro generates an additional `Check` structure that includes all raw fields. It helps show correct errors to the user in case of typos, wrong types, etc. * Updated all examples to use a new API. Simplified delegate call example very well causes of new `OnCallInitializer` trait and support of manual specifying key. * UI tests for a new codegen. Can't highlight something unusual here=) * Apply all suggestion from the review * Make CI happy * Fix tests * Fix tests * Fix tests * Fix tests * Apply suggestions: - In most cases it is comments=) - Moved `pull_or_init` on one level upper. - Put the tests into the `impls/mod.rs` * Fix doc * Add comment to autoref specialisation * Suggestion from the review * Revert back u8 * Remove unwrap * Collapse if let * Fixed overflow for enums * Fixing comments * Renamed `Item` to `StorableHint` and `AutoItem` to `AutoStorableHint` * Fix test * Renamed key_holder. Add UI test for double storage_item. Applied suggestion from the review. * Nightly fmt * Remove `Packed` path * Fix doc test * Apply suggestions from hte review * Fixed build * Fix build * Removed `initialize_contract` from linting and deleted all tests * Fix doc link * Fix mapping example * Applied suggestion. Removed `delegate-call` example with `OnCallInitializer` * Removed `delegate-calls` from the CI. Replaced it with `set-code-hash` * fix test * fix test * Fix CI to use stable for contract build * Fix CI to use stable for examples
-
- 12 Aug, 2022 1 commit
-
-
Michael Müller authored
* Add initial architecture document * Apply suggestions from code review Co-authored-by:
Hernando Castano <HCastano@users.noreply.github.com> * Move text to `codegen` crate docs * Update text * Add 'v1' and 'v2' to spellcheck dic * Add text about execution environment * Apply suggestions from code review Co-authored-by:
Hernando Castano <HCastano@users.noreply.github.com> * Minor clarification Co-authored-by:
Hernando Castano <HCastano@users.noreply.github.com>
-
- 21 Jun, 2022 1 commit
-
-
Sasha Gryaznov authored
-
- 20 Jun, 2022 1 commit
-
-
Sasha Gryaznov authored
-
- 09 Nov, 2021 2 commits
-
-
Robin Freyler authored
* implement const_fn Key::new constructor * add ContractRootKey trait to ink_lang crate * use qualified path * re-export ContractRootKey trait * automatically implement ContractRootKey for ink! contracts * implement #[derive(SpreadAllocate)] macro & tests * re-export #[derive(SpreadAllocate)] macro from ink_storage::traits * automatically implement SpreadAllocate for the ink! storage struct * extend execute_constructor to work with fallible ink! constructors Note that this commit does not yet allow to write fallible ink! constructors. * add initialize_contract utility method * re-export initialize_contract utility method * adjust ink! codegen for recent changes with execute_constructor * fix clippy warning * fix hunspell dictionary * add missing docs to codegen types * fix UI test * remove automatic SpreadAllocate implementation This is due to the fact that trivial_bounds feature is not yet stable. Otherwise this automatically generated implementation would be totally fine. We can re-add this feature once Rust adds trivial trait bounds. * Satisfy OCD in test * Remove mention of `enum`s from `derive_struct()` * Remove outdated comment about Clippy lint * RustFmt Co-authored-by:
Hernando Castano <hernando@hcastano.com>
-
Michael Müller authored
* Update `seal_call` to `__unstable__` version * Add `Debug` derive * Make `cargo-spellcheck` happy * Make `into_u32` take `self` * Update release notes * Fix crate docs link * Use type-system encoded version of empty `ExecutionInput` * Add `const` for getters and setters * Shorten if-branches logic * Update release notes * Remove dead code * Improve release notes
-
- 21 Oct, 2021 1 commit
-
-
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
-
- 20 Oct, 2021 2 commits
-
-
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
-
Michael Müller authored
* Add compatibility notes for rc6 * Add word 'versioned' to dictionary * Add compatible scale version
-
- 14 Oct, 2021 1 commit
-
-
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
-
- 11 Oct, 2021 1 commit
-
-
Andrew Jones authored
* Bump scale-info requirement to 0.9 * Update manual TypeInfo impls * Use decode feature of scale-info * scale-info 1.0 * Fix tests, 0 indexing on type registry * Update some missing examples * TMP: use ink rc5 for compat with cargo-contract * Update RELEASES.md * Bump versions back to 1.0 * Introduce versioning of ink metadata format * Update RELEASES.md Co-authored-by:
Michael Müller <michi@parity.io> * Update crates/metadata/src/lib.rs Co-authored-by:
Michael Müller <michi@parity.io> * Clippy: allow large enum variant * [storage] Allow one variant enum to derive SpreadLayout (#942) * [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:
Robin Freyler <robbepop@web.de> * cargo fmt Co-authored-by:
Robin Freyler <robbepop@web.de> * CI: remove gcda files from cache (#943) * Update pretty_assertions requirement from 0.7.1 to 1.0.0 (#944) Updates the requirements on [pretty_assertions](https://github.com/colin-kiegel/rust-pretty-assertions) to permit the latest version. - [Release notes](https://github.com/colin-kiegel/rust-pretty-assertions/releases) - [Changelog](https://github.com/colin-kiegel/rust-pretty-assertions/blob/main/CHANGELOG.md) - [Commits](https://github.com/colin-kiegel/rust-pretty-assertions/compare/v0.7.1...v1.0.0 ) --- updated-dependencies: - dependency-name: pretty_assertions dependency-type: direct:production ... Signed-off-by:
dependabot[bot] <support@github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add 'versioning' to spellcheck dict Co-authored-by:
Michael Müller <michi@parity.io> Co-authored-by:
tash-2s <81064017+tash-2s@users.noreply.github.com> Co-authored-by:
Robin Freyler <robbepop@web.de> Co-authored-by:
Denis Pisarev <denis.pisarev@parity.io> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
- 04 Oct, 2021 1 commit
-
-
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 ...
-
- 20 Sep, 2021 1 commit
-
-
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
-
- 22 Jul, 2021 1 commit
-
-
Michael Müller authored
* Utilize `--recursive` instead of loop * Increase verbosity level * Add missing words to dictionary
-
- 19 Jul, 2021 1 commit
-
-
Michael Müller authored
-
- 13 Jul, 2021 1 commit
-
-
Michael Müller authored
* Add missing words to dictionary * Fix grammar * Match only `callable's`
-
- 09 Jul, 2021 1 commit
-
-
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:
Robin Freyler <robbepop@web.de> * [storage] Port binary_search tests from core * [storage] Format tests * [storage] Format tests * Remove old comment Co-authored-by:
Robin 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:
Robin Freyler <robbepop@web.de> Co-authored-by:
Hernando Castano <hernando@hcastano.com>
-
- 08 Jul, 2021 2 commits
-
-
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 <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:
Robin Freyler <robin.freyler@gmail.com> * Iterate over values instead of references Co-authored-by:
Robin 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 <michi@parity.io> Co-authored-by:
Robin Freyler <robin.freyler@gmail.com>
-
Michael Müller authored
-
- 28 Jun, 2021 1 commit
-
-
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
-
- 25 Jun, 2021 1 commit
-
-
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
-
- 17 Jun, 2021 1 commit
-
-
Michael Müller authored
* Enable `spellcheck` CI job * Fix spellchecking mistakes * Implement review suggestion * Reword `>= 2`
-
- 09 Jun, 2021 1 commit
-
-
Michael Müller authored
* Spellcheck examples as well * Remove non-existent method * Fix language * Fix clippy `needless_borrow` https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow * Fix spellchecking for examples * Add `block_timestamp` in `engine` * Update examples/erc721/lib.rs Co-authored-by:
Robin Freyler <robin.freyler@gmail.com> * Find solution for words which are non-existent Co-authored-by:
Robin Freyler <robin.freyler@gmail.com>
-
- 12 Mar, 2021 1 commit
-
-
Michael Müller authored
* Add `.config` * Fix hunspell complaints * Run spellcheck in CI * Improve hunspell config * Fix 'pre' prefix * Remove `|` from dictionary * Add missing words to dictionary * Add missing words to dictionary * Add missing words to dictionary * Fix `n`-th → nth * Fix indentation * Remove comment * Fix number * Fix spacing * Remove regex * Apply suggestions from code review Co-authored-by:
Bernhard Schuster <bernhard@ahoi.io> * Fix dictionary * Fix dictionary * Implement review comments * Replace SRML with FRAME * Replace occurrences of 'spreaded' * Tuning text regarding 'spreaded' * Update crates/storage/src/lazy/entry.rs Co-authored-by:
Hero Bird <robin.freyler@gmail.com> Co-authored-by:
Bernhard Schuster <bernhard@ahoi.io> Co-authored-by:
Hero Bird <robin.freyler@gmail.com>
-