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

[pallet-revive] bugfix decoding 64bit args in the decoder #6695

Merged
merged 5 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading