1+ use zcash_primitives:: transaction:: TxId ;
2+
3+ use crate :: wallet:: notes:: TransparentNote ;
14pub ( crate ) mod macros;
25mod mocks;
36
7+ #[ allow( dead_code) ]
8+ pub ( crate ) fn create_empty_txid_and_tnote ( ) -> ( zcash_primitives:: transaction:: TxId , TransparentNote )
9+ {
10+ // A single transparent note makes is_incoming_trsaction true.
11+ let txid = zcash_primitives:: transaction:: TxId :: from_bytes ( [ 0u8 ; 32 ] ) ;
12+ (
13+ txid,
14+ mocks:: TransparentNoteBuilder :: new ( )
15+ . address ( "t" . to_string ( ) )
16+ . spent ( Some ( ( txid, 3 ) ) )
17+ . build ( ) ,
18+ )
19+ }
420#[ allow( dead_code) ]
521pub ( crate ) fn create_transaction_record_with_one_tnote (
22+ txid : TxId ,
23+ transparent_note : TransparentNote ,
624) -> crate :: wallet:: transaction_record:: TransactionRecord {
725 // A single transparent note makes is_incoming_trsaction true.
8- let txid = zcash_primitives:: transaction:: TxId :: from_bytes ( [ 0u8 ; 32 ] ) ;
9- let transparent_note = mocks:: TransparentNoteBuilder :: new ( )
10- . address ( "t" . to_string ( ) )
11- . spent ( Some ( ( txid, 3 ) ) )
12- . build ( ) ;
1326 let mut transaction_record = crate :: wallet:: transaction_record:: TransactionRecord :: new (
1427 zingo_status:: confirmation_status:: ConfirmationStatus :: Confirmed (
1528 zcash_primitives:: consensus:: BlockHeight :: from_u32 ( 5 ) ,
@@ -20,3 +33,19 @@ pub(crate) fn create_transaction_record_with_one_tnote(
2033 transaction_record. transparent_notes . push ( transparent_note) ;
2134 transaction_record
2235}
36+ #[ allow( dead_code) ]
37+ pub ( crate ) fn default_trecord_with_one_tnote (
38+ ) -> crate :: wallet:: transaction_record:: TransactionRecord {
39+ let ( txid, transparent_note) = create_empty_txid_and_tnote ( ) ;
40+ create_transaction_record_with_one_tnote ( txid, transparent_note)
41+ }
42+ #[ allow( dead_code) ]
43+ pub ( crate ) fn create_note_record_id ( ) -> crate :: wallet:: notes:: NoteRecordIdentifier {
44+ let ( txid, _tnote) = create_empty_txid_and_tnote ( ) ;
45+ let index = 5u32 ;
46+ crate :: wallet:: notes:: NoteRecordIdentifier {
47+ txid,
48+ pool : zcash_client_backend:: PoolType :: Transparent ,
49+ index,
50+ }
51+ }
0 commit comments