@@ -144,9 +144,13 @@ class DaoEventsTest < ActiveSupport::TestCase
144144 create ( :cell_input , ckb_transaction : tx2 , block : block2 ,
145145 previous_output : { tx_hash : deposit_tx . tx_hash , index : 1 } )
146146 create ( :cell_output , ckb_transaction : tx1 , block : block1 , capacity : 50000 * ( 10 **8 ) , tx_hash : tx1 . tx_hash ,
147- cell_index : 0 , address : input_address1 , cell_type : "nervos_dao_withdrawing" , dao : "0x28ef3c7ff3860700d88b1a61958923008ae424cd7200000000e3bad4847a0100" , occupied_capacity : 6100000000 )
147+ cell_index : 0 , address : input_address1 , cell_type : "nervos_dao_withdrawing" ,
148+ data : CKB ::Utils . bin_to_hex ( [ deposit_block . number ] . pack ( 'Q<' ) ) ,
149+ dao : "0x28ef3c7ff3860700d88b1a61958923008ae424cd7200000000e3bad4847a0100" , occupied_capacity : 6100000000 )
148150 create ( :cell_output , ckb_transaction : tx2 , block : block2 , capacity : 60000 * ( 10 **8 ) , tx_hash : tx2 . tx_hash ,
149- cell_index : 1 , address : input_address2 , cell_type : "nervos_dao_withdrawing" , dao : "0x2cd631702e870700b3df08d7d889230036f787487e00000000e3bad4847a0100" , occupied_capacity : 6100000000 )
151+ cell_index : 1 , address : input_address2 , cell_type : "nervos_dao_withdrawing" ,
152+ data : CKB ::Utils . bin_to_hex ( [ deposit_block . number ] . pack ( 'Q<' ) ) ,
153+ dao : "0x2cd631702e870700b3df08d7d889230036f787487e00000000e3bad4847a0100" , occupied_capacity : 6100000000 )
150154 create ( :cell_output , ckb_transaction : tx3 , block : block2 , capacity : 70000 * ( 10 **8 ) , tx_hash : tx3 . tx_hash ,
151155 cell_index : 2 , address : input_address3 , occupied_capacity : 6100000000 )
152156
@@ -159,9 +163,13 @@ class DaoEventsTest < ActiveSupport::TestCase
159163 create ( :cell_input , ckb_transaction : tx5 , block : block2 ,
160164 previous_output : { tx_hash : deposit_tx1 . tx_hash , index : 1 } )
161165 create ( :cell_output , ckb_transaction : tx4 , block : block1 , capacity : 150000 * ( 10 **8 ) , tx_hash : tx4 . tx_hash ,
162- cell_index : 0 , address : input_address4 , cell_type : "nervos_dao_withdrawing" , dao : "0x28ef3c7ff3860700d88b1a61958923008ae424cd7200000000e3bad4847a0100" , occupied_capacity : 6100000000 )
166+ cell_index : 0 , address : input_address4 , cell_type : "nervos_dao_withdrawing" ,
167+ data : CKB ::Utils . bin_to_hex ( [ deposit_block1 . number ] . pack ( 'Q<' ) ) ,
168+ dao : "0x28ef3c7ff3860700d88b1a61958923008ae424cd7200000000e3bad4847a0100" , occupied_capacity : 6100000000 )
163169 create ( :cell_output , ckb_transaction : tx5 , block : block2 , capacity : 60000 * ( 10 **8 ) , tx_hash : tx5 . tx_hash ,
164- cell_index : 0 , address : input_address5 , cell_type : "nervos_dao_withdrawing" , dao : "0x2cd631702e870700b3df08d7d889230036f787487e00000000e3bad4847a0100" , occupied_capacity : 6100000000 )
170+ cell_index : 0 , address : input_address5 , cell_type : "nervos_dao_withdrawing" ,
171+ data : CKB ::Utils . bin_to_hex ( [ deposit_block1 . number ] . pack ( 'Q<' ) ) ,
172+ dao : "0x2cd631702e870700b3df08d7d889230036f787487e00000000e3bad4847a0100" , occupied_capacity : 6100000000 )
165173 header = CKB ::Types ::BlockHeader . new ( compact_target : "0x1000" , hash : "0x#{ SecureRandom . hex ( 32 ) } " ,
166174 number : DEFAULT_NODE_BLOCK_NUMBER , parent_hash : "0x#{ SecureRandom . hex ( 32 ) } " , nonce : 1757392074788233522 , timestamp : CkbUtils . time_in_milliseconds ( Time . current ) , transactions_root : "0x#{ SecureRandom . hex ( 32 ) } " , proposals_hash : "0x#{ SecureRandom . hex ( 32 ) } " , extra_hash : "0x#{ SecureRandom . hex ( 32 ) } " , version : 0 , epoch : 1 , dao : "0x01000000000000000000c16ff286230000a3a65e97fd03000057c138586f0000" )
167175 inputs = [
@@ -822,14 +830,16 @@ def fake_dao_interest_transaction(node_block)
822830 tx_hash : "0x598315db9c7ba144cca74d2e9122ac9b3a3da1641b2975ae321d91ec34f1c0e3" ,
823831 block :)
824832 lock = create ( :lock_script )
833+
825834 cell_output1 = create ( :cell_output , ckb_transaction : ckb_transaction1 ,
826835 cell_index : 1 ,
827836 tx_hash : "0x498315db9c7ba144cca74d2e9122ac9b3a3da1641b2975ae321d91ec34f1c0e3" ,
828837 block :,
829838 cell_type : "nervos_dao_withdrawing" ,
830839 capacity : ( 10 **8 ) * 1000 ,
831- data : CKB ::Utils . bin_to_hex ( " \x02 " * 8 ) ,
840+ data : CKB ::Utils . bin_to_hex ( [ block . number ] . pack ( 'Q<' ) ) ,
832841 lock_script_id : lock . id )
842+
833843 cell_output2 = create ( :cell_output , ckb_transaction : ckb_transaction2 ,
834844 cell_index : 1 ,
835845 tx_hash : "0x398315db9c7ba144cca74d2e9122ac9b3a3da1641b2975ae321d91ec34f1c0e2" ,
@@ -866,6 +876,7 @@ def fake_dao_interest_transaction(node_block)
866876 tx_hash : "0x498315db9c7ba144cca74d2e9122ac9b3a3da1641b2975ae321d91ec34f1c0e3" ,
867877 index : 1 ,
868878 } )
879+
869880 create ( :cell_input , block : ckb_transaction1 . block ,
870881 ckb_transaction : ckb_transaction1 ,
871882 previous_output : {
0 commit comments