|
23 | 23 | bpf_loader_upgradeable::{self, UpgradeableLoaderState},
|
24 | 24 | commitment_config::CommitmentConfig,
|
25 | 25 | compute_budget::{self, ComputeBudgetInstruction},
|
26 |
| - feature_set::enable_alt_bn128_syscall, |
| 26 | + feature_set::{enable_alt_bn128_syscall, enable_loader_v4}, |
27 | 27 | fee_calculator::FeeRateGovernor,
|
28 | 28 | pubkey::Pubkey,
|
29 | 29 | rent::Rent,
|
|
32 | 32 | transaction::Transaction,
|
33 | 33 | },
|
34 | 34 | solana_streamer::socket::SocketAddrSpace,
|
35 |
| - solana_test_validator::{TestValidator, TestValidatorGenesis}, |
| 35 | + solana_test_validator::TestValidatorGenesis, |
36 | 36 | solana_transaction_status::UiTransactionEncoding,
|
37 | 37 | std::{
|
38 | 38 | env,
|
@@ -81,8 +81,17 @@ fn test_cli_program_deploy_non_upgradeable() {
|
81 | 81 | let mint_keypair = Keypair::new();
|
82 | 82 | let mint_pubkey = mint_keypair.pubkey();
|
83 | 83 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
84 |
| - let test_validator = |
85 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 84 | + let test_validator = TestValidatorGenesis::default() |
| 85 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 86 | + .rent(Rent { |
| 87 | + lamports_per_byte_year: 1, |
| 88 | + exemption_threshold: 1.0, |
| 89 | + ..Rent::default() |
| 90 | + }) |
| 91 | + .faucet_addr(Some(faucet_addr)) |
| 92 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 93 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 94 | + .expect("validator start failed"); |
86 | 95 |
|
87 | 96 | let rpc_client =
|
88 | 97 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -286,8 +295,17 @@ fn test_cli_program_deploy_no_authority() {
|
286 | 295 | let mint_keypair = Keypair::new();
|
287 | 296 | let mint_pubkey = mint_keypair.pubkey();
|
288 | 297 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
289 |
| - let test_validator = |
290 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 298 | + let test_validator = TestValidatorGenesis::default() |
| 299 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 300 | + .rent(Rent { |
| 301 | + lamports_per_byte_year: 1, |
| 302 | + exemption_threshold: 1.0, |
| 303 | + ..Rent::default() |
| 304 | + }) |
| 305 | + .faucet_addr(Some(faucet_addr)) |
| 306 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 307 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 308 | + .expect("validator start failed"); |
291 | 309 |
|
292 | 310 | let rpc_client =
|
293 | 311 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -403,6 +421,7 @@ fn test_cli_program_deploy_feature(enable_feature: bool) {
|
403 | 421 | test_validator_builder.deactivate_features(&[enable_alt_bn128_syscall::id()]);
|
404 | 422 | }
|
405 | 423 |
|
| 424 | + test_validator_builder = test_validator_builder.deactivate_features(&[enable_loader_v4::id()]); |
406 | 425 | let test_validator = test_validator_builder
|
407 | 426 | .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified)
|
408 | 427 | .expect("validator start failed");
|
@@ -530,6 +549,7 @@ fn test_cli_program_upgrade_with_feature(enable_feature: bool) {
|
530 | 549 | test_validator_builder.deactivate_features(&[enable_alt_bn128_syscall::id()]);
|
531 | 550 | }
|
532 | 551 |
|
| 552 | + test_validator_builder = test_validator_builder.deactivate_features(&[enable_loader_v4::id()]); |
533 | 553 | let test_validator = test_validator_builder
|
534 | 554 | .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified)
|
535 | 555 | .expect("validator start failed");
|
@@ -678,8 +698,17 @@ fn test_cli_program_deploy_with_authority() {
|
678 | 698 | let mint_keypair = Keypair::new();
|
679 | 699 | let mint_pubkey = mint_keypair.pubkey();
|
680 | 700 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
681 |
| - let test_validator = |
682 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 701 | + let test_validator = TestValidatorGenesis::default() |
| 702 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 703 | + .rent(Rent { |
| 704 | + lamports_per_byte_year: 1, |
| 705 | + exemption_threshold: 1.0, |
| 706 | + ..Rent::default() |
| 707 | + }) |
| 708 | + .faucet_addr(Some(faucet_addr)) |
| 709 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 710 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 711 | + .expect("validator start failed"); |
683 | 712 |
|
684 | 713 | let rpc_client =
|
685 | 714 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -1079,8 +1108,17 @@ fn test_cli_program_upgrade_auto_extend() {
|
1079 | 1108 | let mint_keypair = Keypair::new();
|
1080 | 1109 | let mint_pubkey = mint_keypair.pubkey();
|
1081 | 1110 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
1082 |
| - let test_validator = |
1083 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 1111 | + let test_validator = TestValidatorGenesis::default() |
| 1112 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 1113 | + .rent(Rent { |
| 1114 | + lamports_per_byte_year: 1, |
| 1115 | + exemption_threshold: 1.0, |
| 1116 | + ..Rent::default() |
| 1117 | + }) |
| 1118 | + .faucet_addr(Some(faucet_addr)) |
| 1119 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 1120 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 1121 | + .expect("validator start failed"); |
1084 | 1122 |
|
1085 | 1123 | let rpc_client =
|
1086 | 1124 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -1232,8 +1270,17 @@ fn test_cli_program_close_program() {
|
1232 | 1270 | let mint_keypair = Keypair::new();
|
1233 | 1271 | let mint_pubkey = mint_keypair.pubkey();
|
1234 | 1272 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
1235 |
| - let test_validator = |
1236 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 1273 | + let test_validator = TestValidatorGenesis::default() |
| 1274 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 1275 | + .rent(Rent { |
| 1276 | + lamports_per_byte_year: 1, |
| 1277 | + exemption_threshold: 1.0, |
| 1278 | + ..Rent::default() |
| 1279 | + }) |
| 1280 | + .faucet_addr(Some(faucet_addr)) |
| 1281 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 1282 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 1283 | + .expect("validator start failed"); |
1237 | 1284 |
|
1238 | 1285 | let rpc_client =
|
1239 | 1286 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -1351,8 +1398,17 @@ fn test_cli_program_extend_program() {
|
1351 | 1398 | let mint_keypair = Keypair::new();
|
1352 | 1399 | let mint_pubkey = mint_keypair.pubkey();
|
1353 | 1400 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
1354 |
| - let test_validator = |
1355 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 1401 | + let test_validator = TestValidatorGenesis::default() |
| 1402 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 1403 | + .rent(Rent { |
| 1404 | + lamports_per_byte_year: 1, |
| 1405 | + exemption_threshold: 1.0, |
| 1406 | + ..Rent::default() |
| 1407 | + }) |
| 1408 | + .faucet_addr(Some(faucet_addr)) |
| 1409 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 1410 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 1411 | + .expect("validator start failed"); |
1356 | 1412 |
|
1357 | 1413 | let rpc_client =
|
1358 | 1414 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -1521,8 +1577,17 @@ fn test_cli_program_write_buffer() {
|
1521 | 1577 | let mint_keypair = Keypair::new();
|
1522 | 1578 | let mint_pubkey = mint_keypair.pubkey();
|
1523 | 1579 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
1524 |
| - let test_validator = |
1525 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 1580 | + let test_validator = TestValidatorGenesis::default() |
| 1581 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 1582 | + .rent(Rent { |
| 1583 | + lamports_per_byte_year: 1, |
| 1584 | + exemption_threshold: 1.0, |
| 1585 | + ..Rent::default() |
| 1586 | + }) |
| 1587 | + .faucet_addr(Some(faucet_addr)) |
| 1588 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 1589 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 1590 | + .expect("validator start failed"); |
1526 | 1591 |
|
1527 | 1592 | let rpc_client =
|
1528 | 1593 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2008,8 +2073,17 @@ fn test_cli_program_set_buffer_authority() {
|
2008 | 2073 | let mint_keypair = Keypair::new();
|
2009 | 2074 | let mint_pubkey = mint_keypair.pubkey();
|
2010 | 2075 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2011 |
| - let test_validator = |
2012 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2076 | + let test_validator = TestValidatorGenesis::default() |
| 2077 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2078 | + .rent(Rent { |
| 2079 | + lamports_per_byte_year: 1, |
| 2080 | + exemption_threshold: 1.0, |
| 2081 | + ..Rent::default() |
| 2082 | + }) |
| 2083 | + .faucet_addr(Some(faucet_addr)) |
| 2084 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2085 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2086 | + .expect("validator start failed"); |
2013 | 2087 |
|
2014 | 2088 | let rpc_client =
|
2015 | 2089 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2180,8 +2254,17 @@ fn test_cli_program_mismatch_buffer_authority() {
|
2180 | 2254 | let mint_keypair = Keypair::new();
|
2181 | 2255 | let mint_pubkey = mint_keypair.pubkey();
|
2182 | 2256 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2183 |
| - let test_validator = |
2184 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2257 | + let test_validator = TestValidatorGenesis::default() |
| 2258 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2259 | + .rent(Rent { |
| 2260 | + lamports_per_byte_year: 1, |
| 2261 | + exemption_threshold: 1.0, |
| 2262 | + ..Rent::default() |
| 2263 | + }) |
| 2264 | + .faucet_addr(Some(faucet_addr)) |
| 2265 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2266 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2267 | + .expect("validator start failed"); |
2185 | 2268 |
|
2186 | 2269 | let rpc_client =
|
2187 | 2270 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2306,8 +2389,17 @@ fn test_cli_program_deploy_with_offline_signing(use_offline_signer_as_fee_payer:
|
2306 | 2389 | let mint_keypair = Keypair::new();
|
2307 | 2390 | let mint_pubkey = mint_keypair.pubkey();
|
2308 | 2391 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2309 |
| - let test_validator = |
2310 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2392 | + let test_validator = TestValidatorGenesis::default() |
| 2393 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2394 | + .rent(Rent { |
| 2395 | + lamports_per_byte_year: 1, |
| 2396 | + exemption_threshold: 1.0, |
| 2397 | + ..Rent::default() |
| 2398 | + }) |
| 2399 | + .faucet_addr(Some(faucet_addr)) |
| 2400 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2401 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2402 | + .expect("validator start failed"); |
2311 | 2403 |
|
2312 | 2404 | let rpc_client =
|
2313 | 2405 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2499,8 +2591,17 @@ fn test_cli_program_show() {
|
2499 | 2591 | let mint_keypair = Keypair::new();
|
2500 | 2592 | let mint_pubkey = mint_keypair.pubkey();
|
2501 | 2593 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2502 |
| - let test_validator = |
2503 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2594 | + let test_validator = TestValidatorGenesis::default() |
| 2595 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2596 | + .rent(Rent { |
| 2597 | + lamports_per_byte_year: 1, |
| 2598 | + exemption_threshold: 1.0, |
| 2599 | + ..Rent::default() |
| 2600 | + }) |
| 2601 | + .faucet_addr(Some(faucet_addr)) |
| 2602 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2603 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2604 | + .expect("validator start failed"); |
2504 | 2605 |
|
2505 | 2606 | let rpc_client =
|
2506 | 2607 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2696,8 +2797,17 @@ fn test_cli_program_dump() {
|
2696 | 2797 | let mint_keypair = Keypair::new();
|
2697 | 2798 | let mint_pubkey = mint_keypair.pubkey();
|
2698 | 2799 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2699 |
| - let test_validator = |
2700 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2800 | + let test_validator = TestValidatorGenesis::default() |
| 2801 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2802 | + .rent(Rent { |
| 2803 | + lamports_per_byte_year: 1, |
| 2804 | + exemption_threshold: 1.0, |
| 2805 | + ..Rent::default() |
| 2806 | + }) |
| 2807 | + .faucet_addr(Some(faucet_addr)) |
| 2808 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2809 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2810 | + .expect("validator start failed"); |
2701 | 2811 |
|
2702 | 2812 | let rpc_client =
|
2703 | 2813 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2835,6 +2945,7 @@ fn test_cli_program_deploy_with_args(compute_unit_price: Option<u64>, use_rpc: b
|
2835 | 2945 | exemption_threshold: 1.0,
|
2836 | 2946 | ..Rent::default()
|
2837 | 2947 | })
|
| 2948 | + .deactivate_features(&[enable_loader_v4::id()]) |
2838 | 2949 | .rpc_config(JsonRpcConfig {
|
2839 | 2950 | enable_rpc_transaction_history: true,
|
2840 | 2951 | faucet_addr: Some(faucet_addr),
|
|
0 commit comments