@@ -6,30 +6,100 @@ pub mod wormhole;
6
6
pub ( crate ) type Pubkey = [ u8 ; 32 ] ;
7
7
pub ( crate ) type PriceId = Pubkey ;
8
8
9
+ /// Official Message Buffer Program Id
10
+ /// pubkey!("Vbmv1jt4vyuqBZcpYPpnVhrqVe5e6ZPb6JxDcffRHUM");
11
+ const MESSAGE_BUFFER_PID : Pubkey = [
12
+ 7 , 83 , 149 , 9 , 30 , 102 , 77 , 194 , 50 , 151 , 133 , 40 , 118 , 10 , 93 , 152 , 174 , 44 , 244 , 56 , 27 , 47 ,
13
+ 234 , 218 , 173 , 153 , 254 , 48 , 102 , 178 , 128 , 18 ,
14
+ ] ;
15
+
9
16
/// Pubkey::find_program_address(&[b"emitter"], &sysvar::accumulator::id());
10
17
/// pubkey!("G9LV2mp9ua1znRAfYwZz5cPiJMAbo1T6mbjdQsDZuMJg");
11
- pub const ACCUMULATOR_EMITTER_ADDR : Pubkey = [
18
+ const ACCUMULATOR_EMITTER_ADDRESS : Pubkey = [
12
19
225 , 1 , 250 , 237 , 172 , 88 , 81 , 227 , 43 , 155 , 35 , 181 , 249 , 65 , 26 , 140 , 43 , 172 , 74 , 174 , 62 ,
13
20
212 , 221 , 123 , 129 , 29 , 209 , 167 , 46 , 164 , 170 , 113 ,
14
21
] ;
15
22
16
- /// Pubkey::find_program_address(&[b"Sequence", &emitter_pda_key.to_bytes()], &WORMHOLE_PID);
17
- /// pubkey!("HiqU8jiyUoFbRjf4YFAKRFWq5NZykEYC6mWhXXnoszJR");
18
- pub const ACCUMULATOR_SEQUENCE_ADDR : Pubkey = [
19
- 248 , 114 , 155 , 82 , 154 , 159 , 139 , 78 , 187 , 144 , 5 , 110 , 22 , 123 , 227 , 191 , 18 , 224 , 118 , 212 ,
20
- 39 , 87 , 137 , 86 , 88 , 211 , 220 , 104 , 229 , 255 , 139 , 70 ,
21
- ] ;
23
+ /// Official Program IDs and Addresses on Pythnet
24
+ pub mod pythnet {
25
+ use super :: Pubkey ;
26
+ /// Official Wormhole Program Address on Pythnet
27
+ /// pubkey!("H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU");
28
+ pub const WORMHOLE_PID : Pubkey = [
29
+ 238 , 106 , 51 , 154 , 165 , 236 , 145 , 158 , 20 , 176 , 156 , 210 , 101 , 132 , 136 , 107 , 95 , 235 , 248 ,
30
+ 189 , 230 , 34 , 185 , 117 , 208 , 26 , 214 , 142 , 191 , 11 , 208 , 35 ,
31
+ ] ;
22
32
23
- /// Official Pyth Program Address
24
- /// pubkey!("FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH ");
25
- pub const PYTH_PID : Pubkey = [
26
- 220 , 229 , 235 , 225 , 228 , 156 , 59 , 159 , 17 , 76 , 181 , 84 , 76 , 80 , 169 , 158 , 192 , 214 , 146 , 214 ,
27
- 63 , 86 , 121 , 90 , 224 , 41 , 172 , 131 , 217 , 234 , 139 , 226 ,
28
- ] ;
33
+ /// Pubkey::find_program_address(&[b"Sequence", &emitter_pda_key.to_bytes()], &WORMHOLE_PID);
34
+ /// pubkey!("HiqU8jiyUoFbRjf4YFAKRFWq5NZykEYC6mWhXXnoszJR ");
35
+ pub const ACCUMULATOR_SEQUENCE_ADDR : Pubkey = [
36
+ 109 , 92 , 198 , 114 , 10 , 119 , 5 , 31 , 13 , 197 , 193 , 195 , 132 , 17 , 12 , 3 , 77 , 111 , 158 , 247 ,
37
+ 194 , 137 , 236 , 50 , 8 , 185 , 1 , 61 , 85 , 94 , 54 , 198 ,
38
+ ] ;
29
39
30
- /// Official Wormhole Program Address
31
- /// pubkey!("worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth");
32
- pub const WORMHOLE_PID : Pubkey = [
33
- 224 , 165 , 137 , 164 , 26 , 85 , 251 , 214 , 108 , 82 , 164 , 117 , 242 , 217 , 42 , 109 , 61 , 201 , 180 , 116 ,
34
- 113 , 20 , 203 , 154 , 248 , 37 , 169 , 139 , 84 , 93 , 60 , 224 ,
35
- ] ;
40
+ /// Official Pyth Oracle Program Id on Pythnet
41
+ /// pubkey!("FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH");
42
+ pub const PYTH_PID : Pubkey = [
43
+ 220 , 229 , 235 , 225 , 228 , 156 , 59 , 159 , 17 , 76 , 181 , 84 , 76 , 80 , 169 , 158 , 192 , 214 , 146 ,
44
+ 214 , 63 , 86 , 121 , 90 , 224 , 41 , 172 , 131 , 217 , 234 , 139 , 226 ,
45
+ ] ;
46
+ }
47
+
48
+ #[ cfg( test) ]
49
+ pub ( crate ) mod tests {
50
+ use super :: * ;
51
+
52
+ #[ test]
53
+ fn test_pubkeys ( ) {
54
+ use solana_sdk:: {
55
+ pubkey,
56
+ pubkey:: Pubkey ,
57
+ } ;
58
+
59
+ let accumulator_emitter_address = pubkey ! ( "G9LV2mp9ua1znRAfYwZz5cPiJMAbo1T6mbjdQsDZuMJg" ) ;
60
+ assert_eq ! (
61
+ ACCUMULATOR_EMITTER_ADDRESS ,
62
+ accumulator_emitter_address. to_bytes( )
63
+ ) ;
64
+
65
+ let pythnet_wormhole_pid = pubkey ! ( "H3fxXJ86ADW2PNuDDmZJg6mzTtPxkYCpNuQUTgmJ7AjU" ) ;
66
+ let ( pythnet_accumulator_sequence_address, _) = Pubkey :: find_program_address (
67
+ & [ b"Sequence" , accumulator_emitter_address. as_ref ( ) ] ,
68
+ & pythnet_wormhole_pid,
69
+ ) ;
70
+
71
+ assert_eq ! ( pythnet:: WORMHOLE_PID , pythnet_wormhole_pid. to_bytes( ) ) ;
72
+ assert_eq ! (
73
+ pythnet:: ACCUMULATOR_SEQUENCE_ADDR ,
74
+ pythnet_accumulator_sequence_address. to_bytes( )
75
+ ) ;
76
+
77
+ let pythtest_wormhole_pid = pubkey ! ( "EUrRARh92Cdc54xrDn6qzaqjA77NRrCcfbr8kPwoTL4z" ) ;
78
+ let pythtest_wormhole_pid_bytes: [ u8 ; 32 ] = [
79
+ 200 , 74 , 124 , 198 , 226 , 194 , 215 , 62 , 43 , 98 , 207 , 184 , 167 , 181 , 175 , 174 , 254 , 192 ,
80
+ 204 , 37 , 26 , 45 , 137 , 21 , 180 , 83 , 228 , 241 , 198 , 180 , 129 , 67 ,
81
+ ] ;
82
+ let ( pythtest_accumulator_sequence_address, _) = Pubkey :: find_program_address (
83
+ & [ b"Sequence" , accumulator_emitter_address. as_ref ( ) ] ,
84
+ & pythtest_wormhole_pid,
85
+ ) ;
86
+
87
+ let pythtest_accumulator_sequence_address_bytes: [ u8 ; 32 ] = [
88
+ 145 , 134 , 75 , 61 , 141 , 252 , 86 , 178 , 3 , 223 , 183 , 153 , 46 , 227 , 25 , 201 , 125 , 199 , 176 ,
89
+ 254 , 164 , 55 , 141 , 20 , 218 , 150 , 11 , 104 , 109 , 137 , 13 , 166 ,
90
+ ] ;
91
+
92
+ assert_eq ! (
93
+ pythtest_wormhole_pid_bytes,
94
+ pythtest_wormhole_pid. to_bytes( )
95
+ ) ;
96
+
97
+ assert_eq ! (
98
+ pythtest_accumulator_sequence_address_bytes,
99
+ pythtest_accumulator_sequence_address. to_bytes( )
100
+ ) ;
101
+
102
+ let message_buffer_program = pubkey ! ( "Vbmv1jt4vyuqBZcpYPpnVhrqVe5e6ZPb6JxDcffRHUM" ) ;
103
+ assert_eq ! ( MESSAGE_BUFFER_PID , message_buffer_program. to_bytes( ) ) ;
104
+ }
105
+ }
0 commit comments