Contracts: Fix legacy uapi (#3994)

Fix some broken legacy definitions of pallet_contracts_uapi storage host
functions
This commit is contained in:
PG Herveou
2024-04-10 07:05:21 +02:00
committed by GitHub
parent df818d2974
commit 2d927b0772
5 changed files with 112 additions and 131 deletions
@@ -149,3 +149,13 @@ macro_rules! output {
$host_fn($($arg,)* $output);
};
}
/// Similar to `output!` but unwraps the result.
#[macro_export]
macro_rules! unwrap_output {
($output: ident, $buffer: expr, $host_fn:path, $($arg:expr),*) => {
let mut $output = $buffer;
let $output = &mut &mut $output[..];
$host_fn($($arg,)* $output).unwrap();
};
}