Skip to content

Commit

Permalink
ManagedDecimal type abi fix, proxy update
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed May 30, 2024
1 parent 9100774 commit 0ffc965
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions contracts/feature-tests/abi-tester/src/abi_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,3 +578,12 @@ pub enum ExplicitDiscriminantMixed {
b: u16,
},
}

#[type_abi]
#[derive(TopEncode, TopDecode)]
pub struct ManagedDecimalWrapper<Api>
where
Api: ManagedTypeApi,
{
pub field: ManagedDecimal<Api, ConstDecimals<2>>,
}
7 changes: 7 additions & 0 deletions framework/base/src/types/managed/wrapped/managed_decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ impl<M: ManagedTypeApi, const DECIMALS: NumDecimals> TypeAbi
TypeName::from(alloc::format!("ManagedDecimal<{}>", DECIMALS))
}

fn type_name_rust() -> TypeName {
TypeName::from(alloc::format!(
"ManagedDecimal<$API, ConstDecimals<{}>>",
DECIMALS
))
}

fn is_variadic() -> bool {
false
}
Expand Down

0 comments on commit 0ffc965

Please sign in to comment.