Commit e7ebf759 authored by Robin Freyler's avatar Robin Freyler

[lang2/macro] "fix" a bug in cross-calling codegen

The fix is actually a hack that we should remove again as soon as possible by a proper solution.
parent 1c207d7e
......@@ -145,6 +145,10 @@ impl CrossCalling<'_> {
quote! {
#( #attrs )*
#[derive(Clone, Debug, scale::Encode, scale::Decode)]
#[cfg_attr(
feature = "ink-generate-abi",
derive(type_metadata::Metadata)
)]
pub struct StorageAsDependency {
account_id: AccountId,
}
......@@ -160,6 +164,27 @@ impl CrossCalling<'_> {
}
}
#[cfg(feature = "ink-generate-abi")]
impl ink_core::storage::alloc::AllocateUsing for StorageAsDependency {
unsafe fn allocate_using<A>(alloc: &mut A) -> Self
where
A: ink_core::storage::alloc::Allocate,
{
// We don't want to carry this implementation arround.
// Please remove as soon as possible.
unimplemented!()
}
}
#[cfg(feature = "ink-generate-abi")]
impl ink_abi::HasLayout for StorageAsDependency {
fn layout(&self) -> ink_abi::StorageLayout {
ink_abi::LayoutStruct::new(
<Self as type_metadata::Metadata>::meta_type(), vec![]
).into()
}
}
impl ink_core::env2::call::FromAccountId<Env> for StorageAsDependency {
#[inline]
fn from_account_id(account_id: AccountId) -> Self {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment