@@ -2403,6 +2403,7 @@ mod tests {
2403
2403
let program2_size = std:: mem:: size_of :: < UpgradeableLoaderState > ( ) as u32 ;
2404
2404
let mut program2_account = AccountSharedData :: default ( ) ;
2405
2405
program2_account. set_owner ( loader_v3) ;
2406
+ program2_account. set_lamports ( LAMPORTS_PER_SOL ) ;
2406
2407
program2_account. set_executable ( true ) ;
2407
2408
program2_account. set_data ( vec ! [ 0 ; program2_size as usize ] ) ;
2408
2409
program2_account
@@ -2413,6 +2414,7 @@ mod tests {
2413
2414
mock_bank. accounts_map . insert ( program2, program2_account) ;
2414
2415
let mut programdata2_account = AccountSharedData :: default ( ) ;
2415
2416
programdata2_account. set_owner ( loader_v3) ;
2417
+ programdata2_account. set_lamports ( LAMPORTS_PER_SOL ) ;
2416
2418
programdata2_account. set_data ( vec ! [ 0 ; program2_size as usize ] ) ;
2417
2419
programdata2_account
2418
2420
. set_state ( & UpgradeableLoaderState :: ProgramData {
@@ -2665,23 +2667,16 @@ mod tests {
2665
2667
program2_size + upgradeable_loader_size + fee_payer_size,
2666
2668
) ;
2667
2669
2668
- // programdata as readonly instruction account double-counts it
2670
+ // programdata as instruction account double-counts it
2669
2671
let ixns = vec ! [ Instruction :: new_with_bytes(
2670
2672
program2,
2671
2673
& [ ] ,
2672
2674
vec![ account_meta( programdata2, false ) ] ,
2673
2675
) ] ;
2674
- let factor = if ixns[ 0 ] . accounts [ 0 ] . is_writable {
2675
- 1
2676
- } else {
2677
- 2
2678
- } ;
2676
+
2679
2677
test_data_size (
2680
2678
ixns,
2681
- program2_size
2682
- + programdata2_size * factor
2683
- + upgradeable_loader_size
2684
- + fee_payer_size,
2679
+ program2_size + programdata2_size * 2 + upgradeable_loader_size + fee_payer_size,
2685
2680
) ;
2686
2681
2687
2682
// both as instruction accounts, for completeness
@@ -2693,17 +2688,9 @@ mod tests {
2693
2688
account_meta( programdata2, false ) ,
2694
2689
] ,
2695
2690
) ] ;
2696
- let factor = if ixns[ 0 ] . accounts [ 0 ] . is_writable {
2697
- 0
2698
- } else {
2699
- 1
2700
- } ;
2701
2691
test_data_size (
2702
2692
ixns,
2703
- program2_size
2704
- + programdata2_size * factor
2705
- + upgradeable_loader_size
2706
- + fee_payer_size,
2693
+ program2_size + programdata2_size + upgradeable_loader_size + fee_payer_size,
2707
2694
) ;
2708
2695
2709
2696
// writable program bypasses the cache
0 commit comments