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

Fix build warnings + clippy errors from latest nightly #686

Merged
merged 11 commits into from
Feb 19, 2021
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ fuzz-tests:
<<: *docker-env
variables:
# The QUICKCHECK_TESTS default is 100
QUICKCHECK_TESTS: 50000
QUICKCHECK_TESTS: 40000
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
Expand Down
12 changes: 6 additions & 6 deletions crates/env/src/chain_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ where
self.func_id,
input,
ErrorCode::from_status_code,
|output| scale::Decode::decode(&mut &output[..]).map_err(Into::into),
|mut output| scale::Decode::decode(&mut output).map_err(Into::into),
)
})
}
Expand Down Expand Up @@ -323,7 +323,7 @@ where
self.func_id,
input,
|_status_code| Ok(()),
|output| scale::Decode::decode(&mut &output[..]).map_err(Into::into),
|mut output| scale::Decode::decode(&mut output).map_err(Into::into),
)
})
}
Expand Down Expand Up @@ -380,8 +380,8 @@ where
self.func_id,
input,
ErrorCode::from_status_code,
|output| {
let decoded = <O as scale::Decode>::decode(&mut &output[..])
|mut output| {
let decoded = <O as scale::Decode>::decode(&mut output)
.expect("encountered error while decoding chain extension method call return value");
Ok(decoded)
},
Expand Down Expand Up @@ -429,8 +429,8 @@ where
self.func_id,
input,
|_status_code| Ok(()),
|output| {
let decoded = <O as scale::Decode>::decode(&mut &output[..])
|mut output| {
let decoded = <O as scale::Decode>::decode(&mut output)
.expect("encountered error while decoding chain extension method call return value");
Ok(decoded)
},
Expand Down
6 changes: 3 additions & 3 deletions crates/env/src/engine/off_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ impl EnvBackend for EnvInstance {
D: FnOnce(&[u8]) -> ::core::result::Result<T, E>,
{
let encoded_input = input.encode();
let (status_code, output) = self
let (status_code, mut output) = self
.chain_extension_handler
.eval(func_id, &encoded_input)
.expect("encountered unexpected missing chain extension method");
status_to_result(status_code)?;
let decoded = decode_to_result(&mut &output[..])?;
let decoded = decode_to_result(&mut output)?;
Ok(decoded)
}
}
Expand Down Expand Up @@ -277,7 +277,7 @@ impl EnvInstance {
beneficiary,
transferred: all,
};
panic!(scale::Encode::encode(&res));
std::panic::panic_any(scale::Encode::encode(&res))
cmichi marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down