Skip to content

Commit

Permalink
Add test demonstrating issue with using Option inside an enum (#1380)
Browse files Browse the repository at this point in the history
### What
Add test demonstrating issue with using Option inside an enum.

(cherry picked from commit 68411e7)

### Why
This was added to a patch release recently and we should retain the test
in main.
  • Loading branch information
leighmcculloch authored Oct 23, 2024
1 parent 050af58 commit 2a78fb7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions soroban-sdk/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mod contract_store;
mod contract_timepoint;
mod contract_udt_enum;
mod contract_udt_enum_error;
mod contract_udt_enum_option;
mod contract_udt_option;
mod contract_udt_struct;
mod contract_udt_struct_tuple;
Expand Down
8 changes: 8 additions & 0 deletions soroban-sdk/src/tests/contract_udt_enum_option.rs
Original file line number Diff line number Diff line change
@@ -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>, Address, i128),
}

0 comments on commit 2a78fb7

Please sign in to comment.