@@ -180,21 +180,21 @@ impl LiteSvm {
180180
181181 #[ napi]
182182 /// Returns all information associated with the account of the provided pubkey.
183- pub fn get_account ( & self , pubkey : Uint8Array ) -> Option < Account > {
183+ pub fn get_account ( & self , pubkey : & [ u8 ] ) -> Option < Account > {
184184 self . 0 . get_account ( & convert_pubkey ( pubkey) ) . map ( Account )
185185 }
186186
187187 #[ napi]
188188 /// Sets all information associated with the account of the provided pubkey.
189- pub fn set_account ( & mut self , pubkey : Uint8Array , data : & Account ) -> Result < ( ) > {
189+ pub fn set_account ( & mut self , pubkey : & [ u8 ] , data : & Account ) -> Result < ( ) > {
190190 self . 0
191191 . set_account ( convert_pubkey ( pubkey) , data. 0 . clone ( ) )
192192 . map_err ( |e| to_js_error ( e, "Failed to set account" ) )
193193 }
194194
195195 #[ napi]
196196 /// Gets the balance of the provided account pubkey.
197- pub fn get_balance ( & self , pubkey : Uint8Array ) -> Option < u64 > {
197+ pub fn get_balance ( & self , pubkey : & [ u8 ] ) -> Option < u64 > {
198198 self . 0 . get_balance ( & convert_pubkey ( pubkey) )
199199 }
200200
@@ -206,15 +206,15 @@ impl LiteSvm {
206206
207207 #[ napi( ts_return_type = "TransactionMetadata | FailedTransactionMetadata | null" ) ]
208208 /// Gets a transaction from the transaction history.
209- pub fn get_transaction ( & self , signature : Uint8Array ) -> Option < TransactionResult > {
209+ pub fn get_transaction ( & self , signature : & [ u8 ] ) -> Option < TransactionResult > {
210210 self . 0
211- . get_transaction ( & Signature :: try_from ( signature. as_ref ( ) ) . unwrap ( ) )
211+ . get_transaction ( & Signature :: try_from ( signature) . unwrap ( ) )
212212 . map ( |x| convert_transaction_result ( x. clone ( ) ) )
213213 }
214214
215215 #[ napi( ts_return_type = "TransactionMetadata | FailedTransactionMetadata | null" ) ]
216216 /// Airdrops the account with the lamports specified.
217- pub fn airdrop ( & mut self , pubkey : Uint8Array , lamports : BigInt ) -> Result < TransactionResult > {
217+ pub fn airdrop ( & mut self , pubkey : & [ u8 ] , lamports : BigInt ) -> Result < TransactionResult > {
218218 Ok ( convert_transaction_result ( self . 0 . airdrop (
219219 & convert_pubkey ( pubkey) ,
220220 bigint_to_u64 ( & lamports) ?,
@@ -223,7 +223,7 @@ impl LiteSvm {
223223
224224 #[ napi]
225225 /// Adds am SBF program to the test environment from the file specified.
226- pub fn add_program_from_file ( & mut self , program_id : Uint8Array , path : String ) -> Result < ( ) > {
226+ pub fn add_program_from_file ( & mut self , program_id : & [ u8 ] , path : String ) -> Result < ( ) > {
227227 self . 0
228228 . add_program_from_file ( convert_pubkey ( program_id) , path)
229229 . map_err ( |e| {
@@ -236,7 +236,7 @@ impl LiteSvm {
236236
237237 #[ napi]
238238 /// Adds am SBF program to the test environment.
239- pub fn add_program ( & mut self , program_id : Uint8Array , program_bytes : & [ u8 ] ) -> Result < ( ) > {
239+ pub fn add_program ( & mut self , program_id : & [ u8 ] , program_bytes : & [ u8 ] ) -> Result < ( ) > {
240240 self . 0
241241 . add_program ( convert_pubkey ( program_id) , program_bytes)
242242 . map_err ( |e| {
@@ -248,29 +248,29 @@ impl LiteSvm {
248248 }
249249
250250 #[ napi( ts_return_type = "TransactionMetadata | FailedTransactionMetadata" ) ]
251- pub fn send_legacy_transaction ( & mut self , tx_bytes : Uint8Array ) -> TransactionResult {
252- let tx: Transaction = deserialize ( & tx_bytes) . unwrap ( ) ;
251+ pub fn send_legacy_transaction ( & mut self , tx_bytes : & [ u8 ] ) -> TransactionResult {
252+ let tx: Transaction = deserialize ( tx_bytes) . unwrap ( ) ;
253253 let res = self . 0 . send_transaction ( tx) ;
254254 convert_transaction_result ( res)
255255 }
256256
257257 #[ napi( ts_return_type = "TransactionMetadata | FailedTransactionMetadata" ) ]
258- pub fn send_versioned_transaction ( & mut self , tx_bytes : Uint8Array ) -> TransactionResult {
259- let tx: VersionedTransaction = deserialize ( & tx_bytes) . unwrap ( ) ;
258+ pub fn send_versioned_transaction ( & mut self , tx_bytes : & [ u8 ] ) -> TransactionResult {
259+ let tx: VersionedTransaction = deserialize ( tx_bytes) . unwrap ( ) ;
260260 let res = self . 0 . send_transaction ( tx) ;
261261 convert_transaction_result ( res)
262262 }
263263
264264 #[ napi( ts_return_type = "SimulatedTransactionInfo | FailedTransactionMetadata" ) ]
265- pub fn simulate_legacy_transaction ( & mut self , tx_bytes : Uint8Array ) -> SimulateResult {
266- let tx: Transaction = deserialize ( & tx_bytes) . unwrap ( ) ;
265+ pub fn simulate_legacy_transaction ( & mut self , tx_bytes : & [ u8 ] ) -> SimulateResult {
266+ let tx: Transaction = deserialize ( tx_bytes) . unwrap ( ) ;
267267 let res = self . 0 . simulate_transaction ( tx) ;
268268 convert_sim_result ( res)
269269 }
270270
271271 #[ napi( ts_return_type = "SimulatedTransactionInfo | FailedTransactionMetadata" ) ]
272- pub fn simulate_versioned_transaction ( & mut self , tx_bytes : Uint8Array ) -> SimulateResult {
273- let tx: VersionedTransaction = deserialize ( & tx_bytes) . unwrap ( ) ;
272+ pub fn simulate_versioned_transaction ( & mut self , tx_bytes : & [ u8 ] ) -> SimulateResult {
273+ let tx: VersionedTransaction = deserialize ( tx_bytes) . unwrap ( ) ;
274274 let res = self . 0 . simulate_transaction ( tx) ;
275275 convert_sim_result ( res)
276276 }
0 commit comments