Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Salt in code generation during build_create #842

Merged
3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ variables:
GIT_DEPTH: 100
CARGO_INCREMENTAL: 0
CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
CI_IMAGE: "paritytech/ink-ci-linux:production"
CI_IMAGE: "paritytech/ink-ci-linux:staging"
xgreenx marked this conversation as resolved.
Show resolved Hide resolved
PURELY_STD_CRATES: "lang/codegen metadata"
ALSO_WASM_CRATES: "env storage storage/derive allocator prelude primitives lang lang/macro lang/ir"
# this var is changed to "-:staging" when the CI image gets rebuilt
Expand All @@ -40,6 +40,7 @@ workflow:
- artifacts/

.rust-info-script: &rust-info-script
- cc --version
xgreenx marked this conversation as resolved.
Show resolved Hide resolved
- rustup show
- cargo --version
- rustup +nightly show
Expand Down
2 changes: 1 addition & 1 deletion crates/lang/codegen/src/generator/cross_calling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),* ])
Expand Down
7 changes: 4 additions & 3 deletions crates/lang/macro/tests/compile_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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() {}