From 68411e7e92b11e6316c269d4f7ccae86cd37cfaf Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:21:40 +1000 Subject: [PATCH] Add test demonstrating issue with using Option inside an enum --- soroban-sdk/src/tests.rs | 1 + soroban-sdk/src/tests/contract_udt_enum_option.rs | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 soroban-sdk/src/tests/contract_udt_enum_option.rs diff --git a/soroban-sdk/src/tests.rs b/soroban-sdk/src/tests.rs index 6cb330d43..ed1640269 100644 --- a/soroban-sdk/src/tests.rs +++ b/soroban-sdk/src/tests.rs @@ -17,6 +17,7 @@ mod contract_snapshot; mod contract_store; mod contract_timepoint; mod contract_udt_enum; +mod contract_udt_enum_option; mod contract_udt_option; mod contract_udt_struct; mod contract_udt_struct_tuple; diff --git a/soroban-sdk/src/tests/contract_udt_enum_option.rs b/soroban-sdk/src/tests/contract_udt_enum_option.rs new file mode 100644 index 000000000..e7fb1ef08 --- /dev/null +++ b/soroban-sdk/src/tests/contract_udt_enum_option.rs @@ -0,0 +1,8 @@ +use crate::{self as soroban_sdk}; +use soroban_sdk::{contracttype, Address}; + +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum Test { + Variant(Option
, Address, i128), +}