@@ -95,7 +95,7 @@ async fn can_transfer_hbar_with_pre_tx_allowance_hook() -> anyhow::Result<()> {
9595
9696 // Perform transfer with hook
9797 let transfer_receipt = TransferTransaction :: new ( )
98- . hbar_transfer_with_hook ( sender_id, Hbar :: from_tinybars ( -100 ) , fungible_hook_call)
98+ . add_hbar_transfer_with_hook ( sender_id, Hbar :: from_tinybars ( -100 ) , fungible_hook_call)
9999 . hbar_transfer ( receiver_id, Hbar :: from_tinybars ( 100 ) )
100100 . freeze_with ( & client) ?
101101 . sign ( sender_key)
@@ -160,7 +160,7 @@ async fn can_transfer_hbar_with_pre_post_tx_allowance_hook() -> anyhow::Result<(
160160
161161 // Perform transfer with hook
162162 let transfer_receipt = TransferTransaction :: new ( )
163- . hbar_transfer_with_hook ( sender_id, Hbar :: from_tinybars ( -100 ) , fungible_hook_call)
163+ . add_hbar_transfer_with_hook ( sender_id, Hbar :: from_tinybars ( -100 ) , fungible_hook_call)
164164 . hbar_transfer ( receiver_id, Hbar :: from_tinybars ( 100 ) )
165165 . freeze_with ( & client) ?
166166 . sign ( sender_key)
@@ -247,7 +247,7 @@ async fn can_transfer_fungible_token_with_hook() -> anyhow::Result<()> {
247247
248248 // Perform token transfer with hook
249249 let transfer_receipt = TransferTransaction :: new ( )
250- . token_transfer_with_hook ( token_id, sender_id, -10 , fungible_hook_call)
250+ . add_token_transfer_with_hook ( token_id, sender_id, -10 , fungible_hook_call)
251251 . token_transfer ( token_id, receiver_id, 10 )
252252 . freeze_with ( & client) ?
253253 . sign ( sender_key)
@@ -342,13 +342,18 @@ async fn can_transfer_nft_with_sender_hook() -> anyhow::Result<()> {
342342 let hook_call = HookCall :: new ( Some ( 1 ) , Some ( evm_hook_call) ) ;
343343 let sender_nft_hook_call = NftHookCall { hook_call, hook_type : NftHookType :: PreHookSender } ;
344344
345- // Perform NFT transfer with sender hook
345+ // Perform NFT transfer with sender hook (receiver hook is dummy/empty)
346+ let dummy_receiver_hook = NftHookCall {
347+ hook_call : HookCall :: new ( None , None ) ,
348+ hook_type : NftHookType :: PreHookReceiver ,
349+ } ;
346350 let transfer_receipt = TransferTransaction :: new ( )
347- . nft_transfer_with_sender_hook (
351+ . add_nft_transfer_with_hook (
348352 token_id. nft ( serial_number) ,
349353 sender_id,
350354 receiver_id,
351355 sender_nft_hook_call,
356+ dummy_receiver_hook,
352357 )
353358 . freeze_with ( & client) ?
354359 . sign ( sender_key)
@@ -443,12 +448,15 @@ async fn can_transfer_nft_with_receiver_hook() -> anyhow::Result<()> {
443448 let hook_call = HookCall :: new ( Some ( 1 ) , Some ( evm_hook_call) ) ;
444449 let receiver_nft_hook_call = NftHookCall { hook_call, hook_type : NftHookType :: PreHookReceiver } ;
445450
446- // Perform NFT transfer with receiver hook
451+ // Perform NFT transfer with receiver hook (sender hook is dummy/empty)
452+ let dummy_sender_hook =
453+ NftHookCall { hook_call : HookCall :: new ( None , None ) , hook_type : NftHookType :: PreHookSender } ;
447454 let transfer_receipt = TransferTransaction :: new ( )
448- . nft_transfer_with_receiver_hook (
455+ . add_nft_transfer_with_hook (
449456 token_id. nft ( serial_number) ,
450457 sender_id,
451458 receiver_id,
459+ dummy_sender_hook,
452460 receiver_nft_hook_call,
453461 )
454462 . freeze_with ( & client) ?
@@ -556,7 +564,7 @@ async fn can_transfer_nft_with_both_sender_and_receiver_hooks() -> anyhow::Resul
556564
557565 // Perform NFT transfer with both hooks
558566 let transfer_receipt = TransferTransaction :: new ( )
559- . nft_transfer_with_both_hooks (
567+ . add_nft_transfer_with_hook (
560568 token_id. nft ( serial_number) ,
561569 sender_id,
562570 receiver_id,
0 commit comments