Unverified Commit 3e4260df authored by GreenBaneling | Supercolony's avatar GreenBaneling | Supercolony Committed by GitHub
Browse files

Remove `Salt` in code generation during build_create (#842)



* Remove not used Salt

* Updated unit test to cover case with code generation for trait.

* Renamed seconds "new" constructor. Seems the same naming for constructors with different signature causes compilation error on linux platform.

* Let's try to move trait definition into contract. Maybe it will resolve compilation error in CI.

* Moved trait implementation to separate test.

* Changed version of docker image to staging.
Added `cc --version` in info section

* Apply suggestions from code review
Co-authored-by: Michael Müller's avatarMichael Müller <mich@elmueller.net>
Co-authored-by: Michael Müller's avatarMichael Müller <mich@elmueller.net>
parent b0038cf0
Pipeline #147168 failed with stages
in 5 minutes and 43 seconds
......@@ -685,7 +685,7 @@ impl CrossCalling<'_> {
fn #ident(
#( #input_bindings : #input_types ),*
) -> Self::#output_ident {
::ink_env::call::build_create::<Environment, Salt, Self>()
::ink_env::call::build_create::<Environment, Self>()
.exec_input(
::ink_env::call::ExecutionInput::new(
::ink_env::call::Selector::new([ #( #composed_selector ),* ])
......
......@@ -23,9 +23,10 @@ fn compile_tests() {
t.pass("tests/ui/pass/05-erc721-contract.rs");
t.pass("tests/ui/pass/06-non-ink-items.rs");
t.pass("tests/ui/pass/07-flipper-as-dependency.rs");
t.pass("tests/ui/pass/08-static-env.rs");
t.pass("tests/ui/pass/09-derive-for-storage.rs");
t.pass("tests/ui/pass/10-alias-storage-struct-impl.rs");
t.pass("tests/ui/pass/08-flipper-as-dependency-trait.rs");
t.pass("tests/ui/pass/09-static-env.rs");
t.pass("tests/ui/pass/10-derive-for-storage.rs");
t.pass("tests/ui/pass/11-alias-storage-struct-impl.rs");
t.compile_fail("tests/ui/fail/C-00-constructor-self-ref.rs");
t.compile_fail("tests/ui/fail/C-01-constructor-self-mut.rs");
......
use ink_lang as ink;
#[ink::contract(compile_as_dependency = true)]
mod flipper {
#[ink_lang::trait_definition]
pub trait FlipperTrait {
#[ink(constructor)]
fn new() -> Self;
#[ink(message)]
fn flip(&mut self);
#[ink(message)]
fn get(&self) -> bool;
}
#[ink(storage)]
pub struct Flipper {
value: bool,
}
impl FlipperTrait for Flipper {
#[ink(constructor)]
fn new() -> Self {
Self::default()
}
#[ink(message)]
fn flip(&mut self) {
self.value = !self.value;
}
#[ink(message)]
fn get(&self) -> bool {
self.value
}
}
}
fn main() {}
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