Skip to content

Commit 0c4265a

Browse files
xermicusactions-userathei
authored andcommitted
[pallet-revive] bugfix decoding 64bit args in the decoder (paritytech#6695)
The argument index of the next argument is dictated by the size of the current one. --------- Signed-off-by: xermicus <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: Alexander Theißen <[email protected]>
1 parent 7ab3713 commit 0c4265a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

prdoc/pr_6695.prdoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: '[pallet-revive] bugfix decoding 64bit args in the decoder'
2+
doc:
3+
- audience: Runtime Dev
4+
description: The argument index of the next argument is dictated by the size of
5+
the current one.
6+
crates:
7+
- name: pallet-revive-proc-macro
8+
bump: patch

substrate/frame/revive/proc-macro/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ where
342342
const ALLOWED_REGISTERS: u32 = 6;
343343
let mut registers_used = 0;
344344
let mut bindings = vec![];
345-
for (idx, (name, ty)) in param_names.clone().zip(param_types.clone()).enumerate() {
345+
let mut idx = 0;
346+
for (name, ty) in param_names.clone().zip(param_types.clone()) {
346347
let syn::Type::Path(path) = &**ty else {
347348
panic!("Type needs to be path");
348349
};
@@ -380,6 +381,7 @@ where
380381
}
381382
};
382383
bindings.push(binding);
384+
idx += size;
383385
}
384386
quote! {
385387
#( #bindings )*

0 commit comments

Comments
 (0)