Unverified Commit 3eb6eb06 authored by Andrew Jones's avatar Andrew Jones Committed by GitHub
Browse files

Introduce entrance crate (#1223)



* Add ink entrance crate

* Use entrance crate from lang codegen

* Use entrance crate for ink_storage

* Update primitives and storage

* Fix primitive macro

* Move unique_topics test to ink crate

* Update ink crate versions

* Use umbrella crate in ink primitives macro

* Use umbrella crate in storage derive macros

* Use umbrella crate in storage doc tests

* Use umbrella crate in lang codegen

* Fix storage doc tests

* Update erc20 example

* Remove scale libs from entrance crate

* Rename ink_lang crate to ink

* Reexport sub crates from main ink crate

* Metadata std

* Fix up some examples

* Fix up delegator example

* Fix up more examples

* Fix up more examples

* Fix up more examples

* Remove some ink_lang as ink from tests

* Update env_access docs

* Fix up more doc examples

* Remove ink_lang import from some tests

* UI tests

* Fix UI tests

* Remove more ink_lang aliases

* Fix contract-terminate tests

* Fmt

* Attempt to fix CI and ARCHITECTURE doc

* Update crates list

* Restore unique_topics test

* Remove ink_lang from unique_topics test

* Fix typo

* UI tests

* UI tests

* Fmt examples

* Fmt UI tests

* More fmt UI tests

* Fix storage tests

* Fix example tests

* Fix examplesl

* Fix example test

* Examples fmt

* Fix erc20

* Fmt erc20

* Fix doc test

* Move unique_topics test

* Fix UI tests

* Revert CHANGELOG.md

* Use cargo-contract branch in examples-contract-build

* Add ink-debug feature to top level ink crate

* Update CHANGELOG.md

* Rename all ink_lang_* crates to ink_*

* Replace remaining ink_lang_macro refs

* Update CHANGELOG.md
Co-authored-by: Michael Müller's avatarMichael Müller <mich@elmueller.net>

* Update CHANGELOG
Co-authored-by: Michael Müller's avatarMichael Müller <mich@elmueller.net>
parent c9c81c79
Pipeline #215138 passed with stages
in 20 minutes and 56 seconds
......@@ -29,8 +29,8 @@ variables:
# CI_IMAGE is changed to "-:staging" when the CI image gets rebuilt
# read more https://github.com/paritytech/scripts/pull/244
CI_IMAGE: "paritytech/ink-ci-linux:production"
PURELY_STD_CRATES: "lang/codegen storage/traits/codegen metadata engine"
ALSO_WASM_CRATES: "env storage storage/traits storage/traits/derive allocator prelude primitives lang lang/macro lang/ir"
PURELY_STD_CRATES: "ink/codegen storage/traits/codegen metadata engine"
ALSO_WASM_CRATES: "env storage storage/traits storage/traits/derive allocator prelude primitives ink ink/macro ink/ir"
ALL_CRATES: "${PURELY_STD_CRATES} ${ALSO_WASM_CRATES}"
DELEGATOR_SUBCONTRACTS: "accumulator adder subber"
UPGRADEABLE_CONTRACTS: "forward-calls set-code-hash"
......@@ -112,8 +112,8 @@ fmt:
script:
- cargo +nightly fmt --verbose --all -- --check
# For the UI tests we need to disable the license check
- cargo +nightly fmt --verbose --all -- --check ./crates/lang/tests/ui/contract/{pass,fail}/*.rs
- cargo +nightly fmt --verbose --all -- --check ./crates/lang/tests/ui/trait_def/{pass,fail}/*.rs
- cargo +nightly fmt --verbose --all -- --check ./crates/ink/tests/ui/contract/{pass,fail}/*.rs
- cargo +nightly fmt --verbose --all -- --check ./crates/ink/tests/ui/trait_def/{pass,fail}/*.rs
allow_failure: true
examples-fmt:
......@@ -289,7 +289,7 @@ docs:
-p scale-info -p ink_metadata -p ink_env
-p ink_storage -p ink_storage_traits -p ink_storage_codegen -p ink_storage_derive
-p ink_primitives -p ink_prelude
-p ink_lang -p ink_lang_macro -p ink_lang_ir -p ink_lang_codegen
-p ink -p ink_macro -p ink_ir -p ink_codegen
- mv ${CARGO_TARGET_DIR}/doc ./crate-docs
# FIXME: remove me after CI image gets nonroot
- chown -R nonroot:nonroot ./crate-docs
......@@ -367,7 +367,7 @@ examples-contract-build:
<<: *test-refs
script:
- rustup component add rust-src --toolchain stable
- cargo install cargo-contract --version 2.0.0-alpha.1 --force
- cargo install cargo-contract --git https://github.com/paritytech/cargo-contract --branch aj/ink_crate --force
- cargo contract -V
- for example in examples/*/; do
if [ "$example" = "examples/upgradeable-contracts/" ]; then continue; fi;
......
......@@ -15,7 +15,7 @@ You can find the crate documentation on docs.rs or for our
ink! is composed of a number of crates that are all found in the
`crates/` folder. On a high-level those can be grouped as:
* [`lang`](https://github.com/paritytech/ink/tree/master/crates/lang):
* [`ink`](https://github.com/paritytech/ink/tree/master/crates/ink):
The ink! language itself.
* [`allocator`](https://github.com/paritytech/ink/tree/master/crates/allocator):
The allocator used for dynamic memory allocation in a contract.
......@@ -70,11 +70,11 @@ The central delegating crate for the ink! eDSL is `ink_lang`.
In the `crates/lang/` folder you'll find three separate
crates on which `ink_lang` relies heavily:
* `ink_lang_macro`: The procedural macros, they take code annotated with e.g.
`[ink::contract]` and forwards it to `ink_lang_ir`.
* `ink_lang_ir`: Defines everything the procedural macro needs in order to
* `ink_macro`: The procedural macros, they take code annotated with e.g.
`[ink::contract]` and forwards it to `ink_ir`.
* `ink_ir`: Defines everything the procedural macro needs in order to
parse, analyze and generate code for ink! smart contracts.
* `ink_lang_codegen`: Generates Rust code from the ink! IR.
* `ink_codegen`: Generates Rust code from the ink! IR.
## Building ink! contracts
......
......@@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Breaking Changes
#### New `ink` crate
The `ink_lang` crate has been replaced in [#1223](https://github.com/paritytech/ink/pull/1223) by a new top level `ink`
crate. All existing sub-crates are reexported and should be used via the new `ink` crate, so e.g. `ink::env` instead of
`ink_env`. Contract authors should now import the top level `ink` crate instead of the individual crates.
##### Migration
- In `Cargo.toml` Replace all individual `ink_*` crate dependencies with the `ink` crate.
- In the contract source:
- Remove the commonly used `use ink_lang as ink` idiom.
- Replace all usages of individual crates with reexports, e.g. `ink_env``ink::env`.
## Version 4.0.0-alpha.1
### Compatibility
......
[workspace]
resolver = "2"
members = [
"crates/ink",
"crates/metadata",
"crates/allocator",
"crates/lang",
"crates/lang/macro",
"crates/lang/ir",
"crates/lang/codegen",
"crates/lang/macro",
"crates/ink",
"crates/ink/macro",
"crates/ink/ir",
"crates/ink/codegen",
"crates/ink/macro",
"crates/prelude",
"crates/primitives",
"crates/engine",
......
......@@ -125,8 +125,6 @@ It provides methods to
Below you can see the code using the `ink_lang` version of ink!.
```rust
use ink_lang as ink;
#[ink::contract]
mod flipper {
/// The storage of the flipper contract.
......@@ -164,8 +162,7 @@ mod flipper {
#[cfg(test)]
mod tests {
use super::*;
use ink_lang as ink;
#[ink::test]
fn it_works() {
let mut flipper = Flipper::new(false);
......
......@@ -41,7 +41,7 @@ pub mod state {
/// # Note
///
/// This is needed because of conflicting implementations of `From<T> for T`
/// in the generated code of `ink_lang`.
/// in the generated code of `ink`.
pub trait FromAccountId<T>
where
T: Environment,
......
......@@ -15,7 +15,7 @@
//! Definitions and utilities for calling chain extension methods.
//!
//! Users should not use these types and definitions directly but rather use the provided
//! `#[ink::chain_extension]` procedural macro defined in the `ink_lang` crate.
//! `#[ink::chain_extension]` procedural macro defined in the `ink` crate.
use crate::{
backend::EnvBackend,
......
[package]
name = "ink_lang"
name = "ink"
version = "4.0.0-alpha.1"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
edition = "2021"
......@@ -20,13 +20,13 @@ ink_storage = { version = "4.0.0-alpha.1", path = "../storage", default-features
ink_primitives = { version = "4.0.0-alpha.1", path = "../primitives", default-features = false }
ink_metadata = { version = "4.0.0-alpha.1", path = "../metadata", default-features = false, optional = true }
ink_prelude = { version = "4.0.0-alpha.1", path = "../prelude", default-features = false }
ink_lang_macro = { version = "4.0.0-alpha.1", path = "macro", default-features = false }
ink_macro = { version = "4.0.0-alpha.1", path = "macro", default-features = false }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
derive_more = { version = "0.99", default-features = false, features = ["from"] }
[dev-dependencies]
ink_lang_ir = { path = "./ir" }
ink_ir = { path = "./ir" }
ink_metadata = { path = "../metadata", default-features = false }
trybuild = { version = "1.0.60", features = ["diff"] }
......@@ -41,7 +41,11 @@ std = [
"ink_primitives/std",
"ink_env/std",
"ink_storage/std",
"ink_lang_macro/std",
"ink_macro/std",
"scale/std",
]
# Enable contract debug messages via `debug_print!` and `debug_println!`.
ink-debug = [
"ink_env/ink-debug",
]
show-codegen-docs = []
[package]
name = "ink_lang_codegen"
name = "ink_codegen"
version = "4.0.0-alpha.1"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
edition = "2021"
......@@ -7,7 +7,7 @@ edition = "2021"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/paritytech/ink"
documentation = "https://docs.rs/ink_lang_codegen/"
documentation = "https://docs.rs/ink_codegen/"
homepage = "https://www.parity.io/"
description = "data structures and algorithms for generating ink! IR code"
keywords = ["wasm", "parity", "webassembly", "blockchain", "edsl"]
......@@ -15,11 +15,11 @@ categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]
[lib]
name = "ink_lang_codegen"
name = "ink_codegen"
[dependencies]
ink_primitives = { version = "4.0.0-alpha.1", path = "../../primitives" }
ir = { version = "4.0.0-alpha.1", package = "ink_lang_ir", path = "../ir", default-features = false }
ir = { version = "4.0.0-alpha.1", package = "ink_ir", path = "../ir", default-features = false }
quote = "1"
syn = { version = "1.0", features = ["parsing", "full", "extra-traits"] }
proc-macro2 = "1.0"
......
......@@ -77,11 +77,11 @@ where
{
use syn::spanned::Spanned as _;
args.into_iter().fold(
quote! { ::ink_env::call::utils::EmptyArgumentList },
quote! { ::ink::env::call::utils::EmptyArgumentList },
|rest, arg| {
let span = arg.span();
quote_spanned!(span=>
::ink_env::call::utils::ArgumentList<::ink_env::call::utils::Argument<#arg>, #rest>
::ink::env::call::utils::ArgumentList<::ink::env::call::utils::Argument<#arg>, #rest>
)
}
)
......@@ -98,7 +98,7 @@ pub fn generate_reference_to_trait_info(
trait_path: &syn::Path,
) -> TokenStream2 {
quote_spanned!(span=>
<<::ink_lang::reflect::TraitDefinitionRegistry<Environment>
as #trait_path>::__ink_TraitInfo as ::ink_lang::reflect::TraitInfo>::ID
<<::ink::reflect::TraitDefinitionRegistry<Environment>
as #trait_path>::__ink_TraitInfo as ::ink::reflect::TraitInfo>::ID
)
}
......@@ -67,7 +67,7 @@ impl CallBuilder<'_> {
/// This identifier must not be used outside of the generated `const`
/// block in which the call builder type is going to be defined.
/// In order to refer to the call builder of an ink! smart contract
/// use the [`ink_lang::TraitCallBuilder`] trait implementation.
/// use the [`ink::TraitCallBuilder`] trait implementation.
fn call_builder_ident() -> syn::Ident {
format_ident!("CallBuilder")
}
......@@ -84,7 +84,7 @@ impl CallBuilder<'_> {
#[repr(transparent)]
#[cfg_attr(feature = "std", derive(
::scale_info::TypeInfo,
::ink_storage::traits::StorageLayout,
::ink::storage::traits::StorageLayout,
))]
#[derive(
::core::fmt::Debug,
......@@ -100,12 +100,12 @@ impl CallBuilder<'_> {
}
const _: () = {
impl ::ink_lang::codegen::ContractCallBuilder for #storage_ident {
impl ::ink::codegen::ContractCallBuilder for #storage_ident {
type Type = #cb_ident;
}
impl ::ink_lang::reflect::ContractEnv for #cb_ident {
type Env = <#storage_ident as ::ink_lang::reflect::ContractEnv>::Env;
impl ::ink::reflect::ContractEnv for #cb_ident {
type Env = <#storage_ident as ::ink::reflect::ContractEnv>::Env;
}
};
)
......@@ -119,14 +119,14 @@ impl CallBuilder<'_> {
let span = self.contract.module().storage().span();
let cb_ident = Self::call_builder_ident();
quote_spanned!(span=>
impl ::ink_env::call::FromAccountId<Environment> for #cb_ident {
impl ::ink::env::call::FromAccountId<Environment> for #cb_ident {
#[inline]
fn from_account_id(account_id: AccountId) -> Self {
Self { account_id }
}
}
impl ::ink_lang::ToAccountId<Environment> for #cb_ident {
impl ::ink::ToAccountId<Environment> for #cb_ident {
#[inline]
fn to_account_id(&self) -> AccountId {
<AccountId as ::core::clone::Clone>::clone(&self.account_id)
......@@ -183,8 +183,8 @@ impl CallBuilder<'_> {
let trait_info_id = generator::generate_reference_to_trait_info(span, trait_path);
quote_spanned!(span=>
#[doc(hidden)]
impl ::ink_lang::codegen::TraitCallForwarderFor<{#trait_info_id}> for #cb_ident {
type Forwarder = <<Self as #trait_path>::__ink_TraitInfo as ::ink_lang::codegen::TraitCallForwarder>::Forwarder;
impl ::ink::codegen::TraitCallForwarderFor<{#trait_info_id}> for #cb_ident {
type Forwarder = <<Self as #trait_path>::__ink_TraitInfo as ::ink::codegen::TraitCallForwarder>::Forwarder;
#[inline]
fn forward(&self) -> &Self::Forwarder {
......@@ -213,18 +213,18 @@ impl CallBuilder<'_> {
}
#[inline]
fn build(&self) -> &<Self::Forwarder as ::ink_lang::codegen::TraitCallBuilder>::Builder {
<_ as ::ink_lang::codegen::TraitCallBuilder>::call(
<Self as ::ink_lang::codegen::TraitCallForwarderFor<{#trait_info_id}>>::forward(self)
fn build(&self) -> &<Self::Forwarder as ::ink::codegen::TraitCallBuilder>::Builder {
<_ as ::ink::codegen::TraitCallBuilder>::call(
<Self as ::ink::codegen::TraitCallForwarderFor<{#trait_info_id}>>::forward(self)
)
}
#[inline]
fn build_mut(&mut self)
-> &mut <Self::Forwarder as ::ink_lang::codegen::TraitCallBuilder>::Builder
-> &mut <Self::Forwarder as ::ink::codegen::TraitCallBuilder>::Builder
{
<_ as ::ink_lang::codegen::TraitCallBuilder>::call_mut(
<Self as ::ink_lang::codegen::TraitCallForwarderFor<{#trait_info_id}>>::forward_mut(self)
<_ as ::ink::codegen::TraitCallBuilder>::call_mut(
<Self as ::ink::codegen::TraitCallForwarderFor<{#trait_info_id}>>::forward_mut(self)
)
}
}
......@@ -244,7 +244,7 @@ impl CallBuilder<'_> {
.map(|message| self.generate_ink_trait_impl_for_message(trait_path, message));
quote_spanned!(span=>
impl #trait_path for #cb_ident {
type __ink_TraitInfo = <::ink_lang::reflect::TraitDefinitionRegistry<Environment>
type __ink_TraitInfo = <::ink::reflect::TraitDefinitionRegistry<Environment>
as #trait_path>::__ink_TraitInfo;
#( #messages )*
......@@ -285,8 +285,8 @@ impl CallBuilder<'_> {
quote_spanned!(span=>
type #output_ident = <<<
Self
as ::ink_lang::codegen::TraitCallForwarderFor<{#trait_info_id}>>::Forwarder
as ::ink_lang::codegen::TraitCallBuilder>::Builder
as ::ink::codegen::TraitCallForwarderFor<{#trait_info_id}>>::Forwarder
as ::ink::codegen::TraitCallBuilder>::Builder
as #trait_path>::#output_ident;
#[inline]
......@@ -296,7 +296,7 @@ impl CallBuilder<'_> {
#( , #input_bindings: #input_types )*
) -> Self::#output_ident {
<_ as #trait_path>::#message_ident(
<Self as ::ink_lang::codegen::TraitCallForwarderFor<{#trait_info_id}>>::#build_cmd(self)
<Self as ::ink::codegen::TraitCallForwarderFor<{#trait_info_id}>>::#build_cmd(self)
#( , #input_bindings )*
)
}
......@@ -374,11 +374,11 @@ impl CallBuilder<'_> {
output.map_or_else(|| quote! { () }, |output| quote! { #output });
let output_span = output.span();
let output_type = quote_spanned!(output_span=>
::ink_env::call::CallBuilder<
::ink::env::call::CallBuilder<
Environment,
::ink_env::call::utils::Set< ::ink_env::call::Call< Environment > >,
::ink_env::call::utils::Set< ::ink_env::call::ExecutionInput<#arg_list> >,
::ink_env::call::utils::Set< ::ink_env::call::utils::ReturnType<#return_type> >,
::ink::env::call::utils::Set< ::ink::env::call::Call< Environment > >,
::ink::env::call::utils::Set< ::ink::env::call::ExecutionInput<#arg_list> >,
::ink::env::call::utils::Set< ::ink::env::call::utils::ReturnType<#return_type> >,
>
);
quote_spanned!(span=>
......@@ -389,11 +389,11 @@ impl CallBuilder<'_> {
& #mut_tok self
#( , #input_bindings : #input_types )*
) -> #output_type {
::ink_env::call::build_call::<Environment>()
.call_type(::ink_env::call::Call::new().callee(::ink_lang::ToAccountId::to_account_id(self)))
::ink::env::call::build_call::<Environment>()
.call_type(::ink::env::call::Call::new().callee(::ink::ToAccountId::to_account_id(self)))
.exec_input(
::ink_env::call::ExecutionInput::new(
::ink_env::call::Selector::new([ #( #selector_bytes ),* ])
::ink::env::call::ExecutionInput::new(
::ink::env::call::Selector::new([ #( #selector_bytes ),* ])
)
#(
.push_arg(#input_bindings)
......
......@@ -88,7 +88,7 @@ impl ContractRef<'_> {
quote_spanned!(span=>
#[cfg_attr(feature = "std", derive(
::scale_info::TypeInfo,
::ink_storage::traits::StorageLayout,
::ink::storage::traits::StorageLayout,
))]
#[derive(
::core::fmt::Debug,
......@@ -101,16 +101,16 @@ impl ContractRef<'_> {
)]
#( #doc_attrs )*
pub struct #ref_ident {
inner: <#storage_ident as ::ink_lang::codegen::ContractCallBuilder>::Type,
inner: <#storage_ident as ::ink::codegen::ContractCallBuilder>::Type,
}
const _: () = {
impl ::ink_lang::reflect::ContractReference for #storage_ident {
impl ::ink::reflect::ContractReference for #storage_ident {
type Type = #ref_ident;
}
impl ::ink_lang::reflect::ContractEnv for #ref_ident {
type Env = <#storage_ident as ::ink_lang::reflect::ContractEnv>::Env;
impl ::ink::reflect::ContractEnv for #ref_ident {
type Env = <#storage_ident as ::ink::reflect::ContractEnv>::Env;
}
};
)
......@@ -125,21 +125,21 @@ impl ContractRef<'_> {
let storage_ident = self.contract.module().storage().ident();
let ref_ident = self.generate_contract_ref_ident();
quote_spanned!(span=>
impl ::ink_env::call::FromAccountId<Environment> for #ref_ident {
impl ::ink::env::call::FromAccountId<Environment> for #ref_ident {
#[inline]
fn from_account_id(account_id: AccountId) -> Self {
Self { inner: <<#storage_ident
as ::ink_lang::codegen::ContractCallBuilder>::Type
as ::ink_env::call::FromAccountId<Environment>>::from_account_id(account_id)
as ::ink::codegen::ContractCallBuilder>::Type
as ::ink::env::call::FromAccountId<Environment>>::from_account_id(account_id)
}
}
}
impl ::ink_lang::ToAccountId<Environment> for #ref_ident {
impl ::ink::ToAccountId<Environment> for #ref_ident {
#[inline]
fn to_account_id(&self) -> AccountId {
<<#storage_ident as ::ink_lang::codegen::ContractCallBuilder>::Type
as ::ink_lang::ToAccountId<Environment>>::to_account_id(&self.inner)
<<#storage_ident as ::ink::codegen::ContractCallBuilder>::Type
as ::ink::ToAccountId<Environment>>::to_account_id(&self.inner)
}
}
)
......@@ -155,8 +155,8 @@ impl ContractRef<'_> {
let storage_ident = self.contract.module().storage().ident();
quote_spanned!(span=>
const _: () = {
impl ::ink_lang::codegen::TraitCallBuilder for #ref_ident {
type Builder = <#storage_ident as ::ink_lang::codegen::ContractCallBuilder>::Type;
impl ::ink::codegen::TraitCallBuilder for #ref_ident {
type Builder = <#storage_ident as ::ink::codegen::ContractCallBuilder>::Type;
#[inline]
fn call(&self) -> &Self::Builder {
......@@ -207,7 +207,7 @@ impl ContractRef<'_> {
quote_spanned!(span=>
#( #attrs )*
impl #trait_path for #forwarder_ident {
type __ink_TraitInfo = <::ink_lang::reflect::TraitDefinitionRegistry<Environment>
type __ink_TraitInfo = <::ink::reflect::TraitDefinitionRegistry<Environment>
as #trait_path>::__ink_TraitInfo;
#messages
......@@ -255,7 +255,7 @@ impl ContractRef<'_> {
let input_types = message.inputs().map(|input| &input.ty).collect::<Vec<_>>();
quote_spanned!(span=>
type #output_ident =
<<Self::__ink_TraitInfo as ::ink_lang::codegen::TraitCallForwarder>::Forwarder as #trait_path>::#output_ident;
<<Self::__ink_TraitInfo as ::ink::codegen::TraitCallForwarder>::Forwarder as #trait_path>::#output_ident;
#[inline]
fn #message_ident(
......@@ -263,8 +263,8 @@ impl ContractRef<'_> {
#( , #input_bindings : #input_types )*
) -> Self::#output_ident {
<_ as #trait_path>::#message_ident(
<_ as ::ink_lang::codegen::TraitCallForwarderFor<{#trait_info_id}>>::#forward_operator(
<Self as ::ink_lang::codegen::TraitCallBuilder>::#call_operator(self),
<_ as ::ink::codegen::TraitCallForwarderFor<{#trait_info_id}>>::#forward_operator(
<Self as ::ink::codegen::TraitCallBuilder>::#call_operator(self),
)
#( , #input_bindings )*
)
......@@ -351,7 +351,7 @@ impl ContractRef<'_> {
& #mut_token self
#( , #input_bindings : #input_types )*
) #output_type {
<Self as ::ink_lang::codegen::TraitCallBuilder>::#call_operator(self)
<Self as ::ink::codegen::TraitCallBuilder>::#call_operator(self)
.#message_ident( #( #input_bindings ),* )
.fire()
.unwrap_or_else(|error| ::core::panic!(
......@@ -392,19 +392,19 @@ impl ContractRef<'_> {
#[allow(clippy::type_complexity)]
pub fn #constructor_ident(
#( #input_bindings : #input_types ),*
) -> ::ink_env::call::CreateBuilder<
) -> ::ink::env::call::CreateBuilder<
Environment,
::ink_env::call::utils::Unset<Hash>,
::ink_env::call::utils::Unset<u64>,
::ink_env::call::utils::Unset<Balance>,
::ink_env::call::utils::Set<::ink_env::call::ExecutionInput<#arg_list>>,
::ink_env::call::utils::Unset<::ink_env::call::state::Salt>,
::ink::env::call::utils::Unset<Hash>,
::ink::env::call::utils::Unset<u64>,
::ink::env::call::utils::Unset<Balance>,
::ink::env::call::utils::Set<::ink::env::call::ExecutionInput<#arg_list>>,
::ink::env::call::utils::Unset<::ink::env::call::state::Salt>,
Self,
> {
::ink_env::call::build_create::<Environment, Self>()
::ink::env::call::build_create::<Environment, Self>()
.exec_input(
::ink_env::call::ExecutionInput::new(
::ink_env::call::Selector::new([ #( #selector_bytes ),* ])
::ink::env::call::ExecutionInput::new(
::ink::env::call::Selector::new([ #( #selector_bytes ),* ])
)
#(
.push_arg(#input_bindings)
......
......@@ -88,8 +88,8 @@ impl ChainExtension<'_> {
let result_handling = if returns_result {
quote_spanned!(span=>
.output_result::<
<#output_type as ::ink_lang::IsResultType>::Ok,
<#output_type as ::ink_lang::IsResultType>::Err,
<#output_type as ::ink::IsResultType>::Ok,
<#output_type as ::ink::IsResultType>::Err,
>()
)
} else {
......@@ -112,12 +112,12 @@ impl ChainExtension<'_> {
};
let where_output_is_result = Some(quote_spanned!(span=>
#output_type: ::ink_lang::IsResultType,
#output_type: ::ink::IsResultType,
))
.filter(|_| returns_result);
let where_output_impls_from_error_code = Some(quote_spanned!(span=>
<#output_type as ::ink_lang::IsResultType>::Err: ::core::convert::From<#error_code>,
<#output_type as ::ink::IsResultType>::Err: ::core::convert::From<#error_code>,
)).filter(|_| returns_result && handle_status);
quote_spanned!(span=>
......@@ -128,7 +128,7 @@ impl ChainExtension<'_> {
#where_output_is_result
#where_output_impls_from_error_code
{
::ink_env::chain_extension::ChainExtensionMethod::build(#func_id)
::ink::env::chain_extension::ChainExtensionMethod::build(#func_id)
.input::<#compound_input_type>()
#result_handling
#error_code_handling
......@@ -165,7 +165,7 @@ impl GenerateCode for ChainExtension<'_> {
#( #instance_methods )*
}
impl ::ink_lang::ChainExtensionInstance for #ident {
impl ::ink::ChainExtensionInstance for #ident {
type Instance = #instance_ident;
fn instantiate() -> Self::Instance {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment