Update dependencies of pallet_contracts (#8637)

* Update parity-wasm

* Cleanup Cargo.toml files

- Sort dependencies
- Remove minor and fix version where they are not necessary

* Update pretty_assertions

* Update rand
This commit is contained in:
Alexander Theißen
2021-04-19 12:47:46 +02:00
committed by GitHub
parent ea10494ca9
commit 18000a9ae8
9 changed files with 126 additions and 77 deletions
@@ -128,14 +128,14 @@ where
let mut contract = parity_wasm::builder::module()
// deploy function (first internal function)
.function()
.signature().with_return_type(None).build()
.signature().build()
.with_body(def.deploy_body.unwrap_or_else(||
FuncBody::new(Vec::new(), Instructions::empty())
))
.build()
// call function (second internal function)
.function()
.signature().with_return_type(None).build()
.signature().build()
.with_body(def.call_body.unwrap_or_else(||
FuncBody::new(Vec::new(), Instructions::empty())
))
@@ -147,7 +147,7 @@ where
if let Some(body) = def.aux_body {
let mut signature = contract
.function()
.signature().with_return_type(None);
.signature();
for _ in 0 .. def.aux_arg_num {
signature = signature.with_param(ValueType::I64);
}
@@ -166,7 +166,7 @@ where
for func in def.imported_functions {
let sig = parity_wasm::builder::signature()
.with_params(func.params)
.with_return_type(func.return_type)
.with_results(func.return_type.into_iter().collect())
.build_sig();
let sig = contract.push_signature(sig);
contract = contract.import()
@@ -450,11 +450,11 @@ pub mod body {
vec![Instruction::I32Const(current as i32)]
},
DynInstr::RandomUnaligned(low, high) => {
let unaligned = rng.gen_range(*low, *high) | 1;
let unaligned = rng.gen_range(*low..*high) | 1;
vec![Instruction::I32Const(unaligned as i32)]
},
DynInstr::RandomI32(low, high) => {
vec![Instruction::I32Const(rng.gen_range(*low, *high))]
vec![Instruction::I32Const(rng.gen_range(*low..*high))]
},
DynInstr::RandomI32Repeated(num) => {
(&mut rng).sample_iter(Standard).take(*num).map(|val|
@@ -469,19 +469,19 @@ pub mod body {
.collect()
},
DynInstr::RandomGetLocal(low, high) => {
vec![Instruction::GetLocal(rng.gen_range(*low, *high))]
vec![Instruction::GetLocal(rng.gen_range(*low..*high))]
},
DynInstr::RandomSetLocal(low, high) => {
vec![Instruction::SetLocal(rng.gen_range(*low, *high))]
vec![Instruction::SetLocal(rng.gen_range(*low..*high))]
},
DynInstr::RandomTeeLocal(low, high) => {
vec![Instruction::TeeLocal(rng.gen_range(*low, *high))]
vec![Instruction::TeeLocal(rng.gen_range(*low..*high))]
},
DynInstr::RandomGetGlobal(low, high) => {
vec![Instruction::GetGlobal(rng.gen_range(*low, *high))]
vec![Instruction::GetGlobal(rng.gen_range(*low..*high))]
},
DynInstr::RandomSetGlobal(low, high) => {
vec![Instruction::SetGlobal(rng.gen_range(*low, *high))]
vec![Instruction::SetGlobal(rng.gen_range(*low..*high))]
},
}
)