@@ -7,8 +7,6 @@ use crate::{Ix, Message, MessengerPayload, OutputRoot, DEFAULT_SENDER, MESSAGE_S
77
88use super :: messenger;
99
10- // TODO: Should we block vault transfers that don't go through the bridge component?
11-
1210#[ derive( Accounts ) ]
1311#[ instruction( transaction_hash: [ u8 ; 32 ] ) ]
1412pub struct ProveTransaction < ' info > {
@@ -44,22 +42,6 @@ pub struct FinalizeTransaction<'info> {
4442 pub vault : AccountInfo < ' info > ,
4543}
4644
47- pub fn finalize_transaction_handler < ' a , ' info > (
48- ctx : Context < ' a , ' _ , ' info , ' info , FinalizeTransaction < ' info > > ,
49- _transaction_hash : & [ u8 ; 32 ] ,
50- ) -> Result < ( ) > {
51- if ctx. accounts . message . is_executed {
52- return err ! ( ReceiverError :: AlreadyExecuted ) ;
53- }
54-
55- ctx. accounts . message . is_executed = true ;
56- handle_ixs (
57- ctx. remaining_accounts ,
58- & mut ctx. accounts . message ,
59- & ctx. accounts . vault ,
60- )
61- }
62-
6345pub fn prove_transaction_handler (
6446 ctx : Context < ProveTransaction > ,
6547 transaction_hash : & [ u8 ; 32 ] ,
@@ -85,6 +67,22 @@ pub fn prove_transaction_handler(
8567 Ok ( ( ) )
8668}
8769
70+ pub fn finalize_transaction_handler < ' a , ' info > (
71+ ctx : Context < ' a , ' _ , ' info , ' info , FinalizeTransaction < ' info > > ,
72+ _transaction_hash : & [ u8 ; 32 ] ,
73+ ) -> Result < ( ) > {
74+ if ctx. accounts . message . is_executed {
75+ return err ! ( ReceiverError :: AlreadyExecuted ) ;
76+ }
77+
78+ ctx. accounts . message . is_executed = true ;
79+ handle_ixs (
80+ ctx. remaining_accounts ,
81+ & mut ctx. accounts . message ,
82+ & ctx. accounts . vault ,
83+ )
84+ }
85+
8886/**
8987 * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
9088 * defined by `root`. For this, a `proof` must be provided, containing
0 commit comments