Skip to content

Commit

Permalink
Implement CI fixes for #1930 (#1935)
Browse files Browse the repository at this point in the history
* Fix `clippy` warning

* Rename `encode::tests::incrementer` to prevent build conflict with `verify::tests::incrementer`
  • Loading branch information
cmichi authored Feb 5, 2025
1 parent 172e456 commit d2b1bc4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/cargo-contract/tests/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ fn encode_works() {
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#[ink::contract]
mod incrementer {
mod incrementer_encode {
#[ink(storage)]
pub struct Incrementer {
pub struct IncrementerEncode {
value: i32,
}
impl Incrementer {
impl IncrementerEncode {
#[ink(constructor)]
pub fn new(init_value: i32) -> Self {
Self { value: init_value }
Expand All @@ -49,7 +49,7 @@ fn encode_works() {
#[ink(message, selector = 0xBABABABA)]
pub fn inc(&mut self, by: i32) {
self.value.saturating_add(by);
let _ = self.value.saturating_add(by);
}
#[ink(message, selector = 0xCACACACA)]
Expand All @@ -67,11 +67,11 @@ fn encode_works() {
// cargo contract new decode_test
cargo_contract(tmp_dir.path())
.arg("new")
.arg("incrementer")
.arg("incrementer_encode")
.assert()
.success();

let project_dir = tmp_dir.path().to_path_buf().join("incrementer");
let project_dir = tmp_dir.path().to_path_buf().join("incrementer_encode");

let lib = project_dir.join("lib.rs");
std::fs::write(lib, contract).expect("Failed to write contract lib.rs");
Expand Down

0 comments on commit d2b1bc4

Please sign in to comment.