@@ -93,9 +93,9 @@ impl OfferBuilder {
93
93
/// Successive calls to this method will add another chain hash.
94
94
pub fn chain ( mut self , network : Network ) -> Self {
95
95
let chains = self . offer . chains . get_or_insert_with ( Vec :: new) ;
96
- let block_hash = ChainHash :: using_genesis_block ( network) ;
97
- if !chains. contains ( & block_hash ) {
98
- chains. push ( block_hash ) ;
96
+ let chain = ChainHash :: using_genesis_block ( network) ;
97
+ if !chains. contains ( & chain ) {
98
+ chains. push ( chain ) ;
99
99
}
100
100
101
101
self
@@ -481,31 +481,31 @@ mod tests {
481
481
482
482
#[ test]
483
483
fn builds_offer_with_chains ( ) {
484
- let block_hash = ChainHash :: using_genesis_block ( Network :: Bitcoin ) ;
485
- let block_hashes = vec ! [
484
+ let chain = ChainHash :: using_genesis_block ( Network :: Bitcoin ) ;
485
+ let chaines = vec ! [
486
486
ChainHash :: using_genesis_block( Network :: Bitcoin ) ,
487
487
ChainHash :: using_genesis_block( Network :: Testnet ) ,
488
488
] ;
489
489
490
490
let offer = OfferBuilder :: new ( "foo" . into ( ) , pubkey ( ) )
491
491
. chain ( Network :: Bitcoin )
492
492
. build ( ) ;
493
- assert_eq ! ( offer. chains( ) , vec![ block_hash ] ) ;
494
- assert_eq ! ( offer. as_tlv_stream( ) . chains, Some ( & vec![ block_hash ] ) ) ;
493
+ assert_eq ! ( offer. chains( ) , vec![ chain ] ) ;
494
+ assert_eq ! ( offer. as_tlv_stream( ) . chains, Some ( & vec![ chain ] ) ) ;
495
495
496
496
let offer = OfferBuilder :: new ( "foo" . into ( ) , pubkey ( ) )
497
497
. chain ( Network :: Bitcoin )
498
498
. chain ( Network :: Bitcoin )
499
499
. build ( ) ;
500
- assert_eq ! ( offer. chains( ) , vec![ block_hash ] ) ;
501
- assert_eq ! ( offer. as_tlv_stream( ) . chains, Some ( & vec![ block_hash ] ) ) ;
500
+ assert_eq ! ( offer. chains( ) , vec![ chain ] ) ;
501
+ assert_eq ! ( offer. as_tlv_stream( ) . chains, Some ( & vec![ chain ] ) ) ;
502
502
503
503
let offer = OfferBuilder :: new ( "foo" . into ( ) , pubkey ( ) )
504
504
. chain ( Network :: Bitcoin )
505
505
. chain ( Network :: Testnet )
506
506
. build ( ) ;
507
- assert_eq ! ( offer. chains( ) , block_hashes ) ;
508
- assert_eq ! ( offer. as_tlv_stream( ) . chains, Some ( & block_hashes ) ) ;
507
+ assert_eq ! ( offer. chains( ) , chaines ) ;
508
+ assert_eq ! ( offer. as_tlv_stream( ) . chains, Some ( & chaines ) ) ;
509
509
}
510
510
511
511
#[ test]
0 commit comments