@@ -15,15 +15,11 @@ use wormhole_svm_definitions::solana::{
15
15
use wormhole_svm_shim:: post_message;
16
16
17
17
// This is a helper struct to make it easier to pass in the accounts for the post_message instruction.
18
- pub struct PostMessageAccounts {
19
- pub emitter : Pubkey ,
20
- pub payer : Pubkey ,
21
- pub derived : PostMessageDerivedAccounts ,
22
- }
23
-
24
- pub struct PostMessageDerivedAccounts {
25
- pub message : Pubkey ,
26
- pub sequence : Pubkey ,
18
+ pub struct PostMessageAccounts < ' ix > {
19
+ pub emitter : & ' ix Pubkey ,
20
+ pub payer : & ' ix Pubkey ,
21
+ pub message : & ' ix Pubkey ,
22
+ pub sequence : & ' ix Pubkey ,
27
23
}
28
24
29
25
pub fn burn_and_post < ' info > (
@@ -42,16 +38,23 @@ pub fn burn_and_post<'info>(
42
38
payload,
43
39
} = burn_and_publish_args;
44
40
41
+ let PostMessageAccounts {
42
+ emitter,
43
+ payer,
44
+ message,
45
+ sequence,
46
+ } = post_message_accounts;
47
+
45
48
// Post message to the shim program
46
49
let post_message_ix = post_message:: PostMessage {
47
50
program_id : & POST_MESSAGE_SHIM_PROGRAM_ID ,
48
51
accounts : post_message:: PostMessageAccounts {
49
- emitter : & post_message_accounts . emitter ,
50
- payer : & post_message_accounts . payer ,
52
+ emitter,
53
+ payer,
51
54
wormhole_program_id : & CORE_BRIDGE_PROGRAM_ID ,
52
55
derived : post_message:: PostMessageDerivedAccounts {
53
- message : Some ( & post_message_accounts . derived . message ) ,
54
- sequence : Some ( & post_message_accounts . derived . sequence ) ,
56
+ message : Some ( & message) ,
57
+ sequence : Some ( & sequence) ,
55
58
core_bridge_config : Some ( & CORE_BRIDGE_CONFIG ) ,
56
59
fee_collector : Some ( & CORE_BRIDGE_FEE_COLLECTOR ) ,
57
60
event_authority : Some ( & POST_MESSAGE_SHIM_EVENT_AUTHORITY ) ,
0 commit comments