Skip to content

Commit

Permalink
[pallet-revive] bugfix decoding 64bit args in the decoder (#6695)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
3 people authored Nov 28, 2024
1 parent fdb264d commit 6416b28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions prdoc/pr_6695.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: '[pallet-revive] bugfix decoding 64bit args in the decoder'
doc:
- audience: Runtime Dev
description: The argument index of the next argument is dictated by the size of
the current one.
crates:
- name: pallet-revive-proc-macro
bump: patch
4 changes: 3 additions & 1 deletion substrate/frame/revive/proc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ where
const ALLOWED_REGISTERS: u32 = 6;
let mut registers_used = 0;
let mut bindings = vec![];
for (idx, (name, ty)) in param_names.clone().zip(param_types.clone()).enumerate() {
let mut idx = 0;
for (name, ty) in param_names.clone().zip(param_types.clone()) {
let syn::Type::Path(path) = &**ty else {
panic!("Type needs to be path");
};
Expand Down Expand Up @@ -380,6 +381,7 @@ where
}
};
bindings.push(binding);
idx += size;
}
quote! {
#( #bindings )*
Expand Down

0 comments on commit 6416b28

Please sign in to comment.