diff --git a/target_chains/stylus/Cargo.lock b/target_chains/stylus/Cargo.lock index 1bc6581fd7..bd55d021f0 100644 --- a/target_chains/stylus/Cargo.lock +++ b/target_chains/stylus/Cargo.lock @@ -3611,6 +3611,13 @@ dependencies = [ "unarray", ] +[[package]] +name = "pyth-types" +version = "0.1.0" +dependencies = [ + "stylus-sdk 0.6.0", +] + [[package]] name = "quick-error" version = "1.2.3" diff --git a/target_chains/stylus/Cargo.toml b/target_chains/stylus/Cargo.toml index c89d2fc067..5467994bc2 100644 --- a/target_chains/stylus/Cargo.toml +++ b/target_chains/stylus/Cargo.toml @@ -1,8 +1,8 @@ [workspace] members = [ "contracts/wormhole", - "contracts/pyth-receiver" -] + "contracts/pyth-receiver", + "contracts/pyth-types"] resolver = "2" [workspace.package] diff --git a/target_chains/stylus/contracts/pyth-types/Cargo.toml b/target_chains/stylus/contracts/pyth-types/Cargo.toml new file mode 100644 index 0000000000..24ddc05bb5 --- /dev/null +++ b/target_chains/stylus/contracts/pyth-types/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "pyth-types" +edition.workspace = true +license.workspace = true +repository.workspace = true +version.workspace = true + +[dependencies] +stylus-sdk = { workspace = true, default-features = false } \ No newline at end of file diff --git a/target_chains/stylus/contracts/pyth-types/src/lib.rs b/target_chains/stylus/contracts/pyth-types/src/lib.rs new file mode 100644 index 0000000000..21dddd75f8 --- /dev/null +++ b/target_chains/stylus/contracts/pyth-types/src/lib.rs @@ -0,0 +1,30 @@ +use stylus_sdk::{ + alloy_primitives::{Address, FixedBytes}, +}; + +#[derive(Clone, PartialEq, Default)] +pub struct GuardianSet { + pub keys: Vec
, + pub expiration_time: u32, +} + +#[derive(Clone)] +pub struct GuardianSignature { + pub guardian_index: u8, + pub signature: FixedBytes<65>, +} + +#[derive(Clone)] +pub struct VerifiedVM { + pub version: u8, + pub guardian_set_index: u32, + pub signatures: Vec