Closed gangov closed 11 months ago
Thanks for reporting the error. Could you share what the type is that the underneath the contracttype
attribute? It's unclear what the type is.
hey @leighmcculloch sorry for the late reply. It looks like the following:
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct VerySpecialStruct {
pub foo: Vec<(u64, u128)>,
}
the above doesn't work.
As a workaround, we changed that to
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct VerySpecialStruct {
pub foo: Vec<OurType>,
}
where OurType is
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct OurType {
x: u64,
y: u128,
}
Ah good catch. I forgot about tuples here. I'll look at this asap.
I've submitted the fix in https://github.com/stellar/rs-soroban-sdk/pull/1125, which does fix the original reported use case of structs containing vecs of tuples.
I discovered though that structs/enums still cannot contain tuple fields because of https://github.com/stellar/rs-soroban-sdk/issues/1124
What problem does your feature solve?
the tuple in question is in a soroban_sdk::Vector within the storage of our contract.
What would you like to see?
SorobanArbitrary to have tuple support
What alternatives are there?
none