Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
08abcab
Add ink entrance crate
ascjones Apr 22, 2022
97ad149
Use entrance crate from lang codegen
ascjones Apr 22, 2022
2c3fa98
Use entrance crate for ink_storage
ascjones Apr 22, 2022
48093c4
Update primitives and storage
ascjones Apr 22, 2022
80b734b
Fix primitive macro
ascjones Apr 22, 2022
ef47e73
Move unique_topics test to ink crate
ascjones May 3, 2022
7837470
Merge branch 'master' into aj/ink_crate
ascjones Sep 7, 2022
14d97cf
Update ink crate versions
ascjones Sep 7, 2022
b9795be
Use umbrella crate in ink primitives macro
ascjones Sep 7, 2022
69287ea
Use umbrella crate in storage derive macros
ascjones Sep 7, 2022
1d4df5b
Use umbrella crate in storage doc tests
ascjones Sep 7, 2022
0f0cfc7
Use umbrella crate in lang codegen
ascjones Sep 7, 2022
cd01574
Fix storage doc tests
ascjones Sep 7, 2022
df60392
Update erc20 example
ascjones Sep 7, 2022
4ecf551
Remove scale libs from entrance crate
ascjones Sep 7, 2022
ee819ed
Rename ink_lang crate to ink
ascjones Sep 7, 2022
6f321c5
Reexport sub crates from main ink crate
ascjones Sep 7, 2022
ce6c0fc
Metadata std
ascjones Sep 7, 2022
90c9465
Fix up some examples
ascjones Sep 7, 2022
5658f6e
Fix up delegator example
ascjones Sep 7, 2022
dc9c098
Fix up more examples
ascjones Sep 8, 2022
92e904c
Fix up more examples
ascjones Sep 8, 2022
64827dc
Fix up more examples
ascjones Sep 8, 2022
8b24da7
Remove some ink_lang as ink from tests
ascjones Sep 8, 2022
a25068f
Update env_access docs
ascjones Sep 8, 2022
e2799ee
Fix up more doc examples
ascjones Sep 8, 2022
6dabd38
Remove ink_lang import from some tests
ascjones Sep 8, 2022
93e69e9
UI tests
ascjones Sep 8, 2022
c8c8ee8
Fix UI tests
ascjones Sep 8, 2022
73600ee
Remove more ink_lang aliases
ascjones Sep 8, 2022
0d23e2e
Fix contract-terminate tests
ascjones Sep 8, 2022
58dfca7
Fmt
ascjones Sep 8, 2022
d2b4a04
Attempt to fix CI and ARCHITECTURE doc
ascjones Sep 8, 2022
e5456db
Update crates list
ascjones Sep 8, 2022
893ac29
Restore unique_topics test
ascjones Sep 8, 2022
53e23d3
Remove ink_lang from unique_topics test
ascjones Sep 8, 2022
01b77ef
Merge branch 'master' into aj/ink_crate
ascjones Sep 14, 2022
279d391
Fix typo
ascjones Sep 14, 2022
dae2853
UI tests
ascjones Sep 15, 2022
9ec9898
Merge branch 'master' into aj/ink_crate
ascjones Sep 15, 2022
e757e46
UI tests
ascjones Sep 15, 2022
c832c5e
Fmt examples
ascjones Sep 15, 2022
063d657
Fmt UI tests
ascjones Sep 15, 2022
26b63ee
More fmt UI tests
ascjones Sep 15, 2022
23b7dc0
Fix storage tests
ascjones Sep 15, 2022
4012149
Fix example tests
ascjones Sep 15, 2022
8e43dfe
Fix examplesl
ascjones Sep 15, 2022
a5bb59b
Fix example test
ascjones Sep 15, 2022
bab514b
Examples fmt
ascjones Sep 15, 2022
1602558
Fix erc20
ascjones Sep 15, 2022
e012496
Fmt erc20
ascjones Sep 15, 2022
fcc8fc1
Fix doc test
ascjones Sep 15, 2022
bc61621
Move unique_topics test
ascjones Sep 15, 2022
702272c
Fix UI tests
ascjones Sep 15, 2022
6d78718
Revert CHANGELOG.md
ascjones Sep 15, 2022
d26e1b1
Use cargo-contract branch in examples-contract-build
ascjones Sep 15, 2022
bbd7688
Add ink-debug feature to top level ink crate
ascjones Sep 15, 2022
27bf307
Update CHANGELOG.md
ascjones Sep 15, 2022
9cd7f4f
Rename all ink_lang_* crates to ink_*
ascjones Sep 15, 2022
b60bb60
Replace remaining ink_lang_macro refs
ascjones Sep 15, 2022
8ad695f
Update CHANGELOG.md
ascjones Sep 15, 2022
f523263
Update CHANGELOG
ascjones Sep 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
resolver = "2"
members = [
"crates/ink",
"crates/metadata",
"crates/allocator",
"crates/lang",
Expand Down
40 changes: 40 additions & 0 deletions crates/ink/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
name = "ink"
version = "3.0.1"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/paritytech/ink"
documentation = "https://docs.rs/ink_lang/"
homepage = "https://www.parity.io/"
description = "[ink!] Rust based eDSL for writing smart contracts for Substrate"
keywords = ["wasm", "parity", "webassembly", "blockchain", "edsl"]
categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]

[dependencies]
ink_env = { version = "3.0.1", path = "../env", default-features = false }
ink_storage = { version = "3.0.1", path = "../storage", default-features = false }
ink_primitives = { version = "3.0.1", path = "../primitives", default-features = false }
ink_metadata = { version = "3.0.1", path = "../metadata", default-features = false, optional = true }
ink_prelude = { version = "3.0.1", path = "../prelude", default-features = false }
ink_lang = { version = "3.0.1", path = "../lang", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }

[features]
default = ["std"]
std = [
"ink_metadata/std",
"ink_prelude/std",
"ink_primitives/std",
"ink_env/std",
"ink_storage/std",
"ink_lang/std",
"scale/std",
"scale-info/std",
]
show-codegen-docs = []
1 change: 1 addition & 0 deletions crates/ink/LICENSE
1 change: 1 addition & 0 deletions crates/ink/README
33 changes: 33 additions & 0 deletions crates/ink/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2018-2022 Parity Technologies (UK) Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pub use ink_env as env;
pub use ink_lang as lang;
#[cfg(feature = "std")]
pub use ink_metadata as metadata;
pub use ink_prelude as prelude;
pub use ink_primitives as primitives;
pub use ink_storage as storage;

pub use scale;
#[cfg(feature = "std")]
pub use scale_info;

// The top level macros:
// - `#[ink::contract]`
// - `#[ink::trait_definition]`
pub use self::lang::{
contract,
trait_definition,
};
8 changes: 4 additions & 4 deletions crates/lang/codegen/src/generator/arg_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)
}
)
Expand All @@ -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::lang::reflect::TraitDefinitionRegistry<Environment>
as #trait_path>::__ink_TraitInfo as ::ink::lang::reflect::TraitInfo>::ID
)
}
56 changes: 28 additions & 28 deletions crates/lang/codegen/src/generator/as_dependency/call_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ impl CallBuilder<'_> {
#[repr(transparent)]
#[cfg_attr(feature = "std", derive(
::scale_info::TypeInfo,
::ink_storage::traits::StorageLayout,
::ink::storage::traits::StorageLayout,
))]
#[derive(
::core::fmt::Debug,
::ink_storage::traits::SpreadLayout,
::ink_storage::traits::PackedLayout,
::ink::storage::traits::SpreadLayout,
::ink::storage::traits::PackedLayout,
::scale::Encode,
::scale::Decode,
::core::hash::Hash,
Expand All @@ -102,12 +102,12 @@ impl CallBuilder<'_> {
}

const _: () = {
impl ::ink_lang::codegen::ContractCallBuilder for #storage_ident {
impl ::ink::lang::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::lang::reflect::ContractEnv for #cb_ident {
type Env = <#storage_ident as ::ink::lang::reflect::ContractEnv>::Env;
}
};
)
Expand All @@ -121,14 +121,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::lang::ToAccountId<Environment> for #cb_ident {
#[inline]
fn to_account_id(&self) -> AccountId {
<AccountId as ::core::clone::Clone>::clone(&self.account_id)
Expand Down Expand Up @@ -185,8 +185,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::lang::codegen::TraitCallForwarderFor<{#trait_info_id}> for #cb_ident {
type Forwarder = <<Self as #trait_path>::__ink_TraitInfo as ::ink::lang::codegen::TraitCallForwarder>::Forwarder;

#[inline]
fn forward(&self) -> &Self::Forwarder {
Expand Down Expand Up @@ -215,18 +215,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::lang::codegen::TraitCallBuilder>::Builder {
<_ as ::ink::lang::codegen::TraitCallBuilder>::call(
<Self as ::ink::lang::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::lang::codegen::TraitCallBuilder>::Builder
{
<_ as ::ink_lang::codegen::TraitCallBuilder>::call_mut(
<Self as ::ink_lang::codegen::TraitCallForwarderFor<{#trait_info_id}>>::forward_mut(self)
<_ as ::ink::lang::codegen::TraitCallBuilder>::call_mut(
<Self as ::ink::lang::codegen::TraitCallForwarderFor<{#trait_info_id}>>::forward_mut(self)
)
}
}
Expand All @@ -246,7 +246,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::lang::reflect::TraitDefinitionRegistry<Environment>
as #trait_path>::__ink_TraitInfo;

#( #messages )*
Expand Down Expand Up @@ -287,8 +287,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::lang::codegen::TraitCallForwarderFor<{#trait_info_id}>>::Forwarder
as ::ink::lang::codegen::TraitCallBuilder>::Builder
as #trait_path>::#output_ident;

#[inline]
Expand All @@ -298,7 +298,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::lang::codegen::TraitCallForwarderFor<{#trait_info_id}>>::#build_cmd(self)
#( , #input_bindings )*
)
}
Expand Down Expand Up @@ -376,11 +376,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=>
Expand All @@ -391,11 +391,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::lang::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)
Expand Down
Loading