Skip to content

Commit e044c3b

Browse files
committed
created crate for shared structs
1 parent 5014fb4 commit e044c3b

File tree

4 files changed

+48
-2
lines changed

4 files changed

+48
-2
lines changed

target_chains/stylus/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

target_chains/stylus/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[workspace]
22
members = [
33
"contracts/wormhole",
4-
"contracts/pyth-receiver"
5-
]
4+
"contracts/pyth-receiver",
5+
"contracts/pyth-types"]
66
resolver = "2"
77

88
[workspace.package]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "pyth-types"
3+
edition.workspace = true
4+
license.workspace = true
5+
repository.workspace = true
6+
version.workspace = true
7+
8+
[dependencies]
9+
stylus-sdk = { workspace = true, default-features = false }
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
use stylus_sdk::{
2+
alloy_primitives::{Address, FixedBytes},
3+
};
4+
5+
#[derive(Clone, PartialEq, Default)]
6+
pub struct GuardianSet {
7+
pub keys: Vec<Address>,
8+
pub expiration_time: u32,
9+
}
10+
11+
#[derive(Clone)]
12+
pub struct GuardianSignature {
13+
pub guardian_index: u8,
14+
pub signature: FixedBytes<65>,
15+
}
16+
17+
#[derive(Clone)]
18+
pub struct VerifiedVM {
19+
pub version: u8,
20+
pub guardian_set_index: u32,
21+
pub signatures: Vec<GuardianSignature>,
22+
pub timestamp: u32,
23+
pub nonce: u32,
24+
pub emitter_chain_id: u16,
25+
pub emitter_address: FixedBytes<32>,
26+
pub sequence: u64,
27+
pub consistency_level: u8,
28+
pub payload: Vec<u8>,
29+
pub hash: FixedBytes<32>,
30+
}

0 commit comments

Comments
 (0)