|
13 | 13 | solana_cli_output::{parse_sign_only_reply_string, OutputFormat},
|
14 | 14 | solana_client::rpc_config::RpcSendTransactionConfig,
|
15 | 15 | solana_faucet::faucet::run_local_faucet,
|
16 |
| - solana_feature_set::enable_alt_bn128_syscall, |
| 16 | + solana_feature_set::{enable_alt_bn128_syscall, enable_loader_v4}, |
17 | 17 | solana_rpc::rpc::JsonRpcConfig,
|
18 | 18 | solana_rpc_client::rpc_client::{GetConfirmedSignaturesForAddress2Config, RpcClient},
|
19 | 19 | solana_rpc_client_api::config::RpcTransactionConfig,
|
|
33 | 33 | transaction::Transaction,
|
34 | 34 | },
|
35 | 35 | solana_streamer::socket::SocketAddrSpace,
|
36 |
| - solana_test_validator::{TestValidator, TestValidatorGenesis}, |
| 36 | + solana_test_validator::TestValidatorGenesis, |
37 | 37 | solana_transaction_status::UiTransactionEncoding,
|
38 | 38 | std::{
|
39 | 39 | env,
|
@@ -82,8 +82,17 @@ fn test_cli_program_deploy_non_upgradeable() {
|
82 | 82 | let mint_keypair = Keypair::new();
|
83 | 83 | let mint_pubkey = mint_keypair.pubkey();
|
84 | 84 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
85 |
| - let test_validator = |
86 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 85 | + let test_validator = TestValidatorGenesis::default() |
| 86 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 87 | + .rent(Rent { |
| 88 | + lamports_per_byte_year: 1, |
| 89 | + exemption_threshold: 1.0, |
| 90 | + ..Rent::default() |
| 91 | + }) |
| 92 | + .faucet_addr(Some(faucet_addr)) |
| 93 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 94 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 95 | + .expect("validator start failed"); |
87 | 96 |
|
88 | 97 | let rpc_client =
|
89 | 98 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -287,8 +296,17 @@ fn test_cli_program_deploy_no_authority() {
|
287 | 296 | let mint_keypair = Keypair::new();
|
288 | 297 | let mint_pubkey = mint_keypair.pubkey();
|
289 | 298 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
290 |
| - let test_validator = |
291 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 299 | + let test_validator = TestValidatorGenesis::default() |
| 300 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 301 | + .rent(Rent { |
| 302 | + lamports_per_byte_year: 1, |
| 303 | + exemption_threshold: 1.0, |
| 304 | + ..Rent::default() |
| 305 | + }) |
| 306 | + .faucet_addr(Some(faucet_addr)) |
| 307 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 308 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 309 | + .expect("validator start failed"); |
292 | 310 |
|
293 | 311 | let rpc_client =
|
294 | 312 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -406,6 +424,7 @@ fn test_cli_program_deploy_feature(enable_feature: bool, skip_preflight: bool) {
|
406 | 424 | test_validator_builder.deactivate_features(&[enable_alt_bn128_syscall::id()]);
|
407 | 425 | }
|
408 | 426 |
|
| 427 | + test_validator_builder = test_validator_builder.deactivate_features(&[enable_loader_v4::id()]); |
409 | 428 | let test_validator = test_validator_builder
|
410 | 429 | .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified)
|
411 | 430 | .expect("validator start failed");
|
@@ -542,6 +561,7 @@ fn test_cli_program_upgrade_with_feature(enable_feature: bool) {
|
542 | 561 | test_validator_builder.deactivate_features(&[enable_alt_bn128_syscall::id()]);
|
543 | 562 | }
|
544 | 563 |
|
| 564 | + test_validator_builder = test_validator_builder.deactivate_features(&[enable_loader_v4::id()]); |
545 | 565 | let test_validator = test_validator_builder
|
546 | 566 | .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified)
|
547 | 567 | .expect("validator start failed");
|
@@ -691,8 +711,17 @@ fn test_cli_program_deploy_with_authority() {
|
691 | 711 | let mint_keypair = Keypair::new();
|
692 | 712 | let mint_pubkey = mint_keypair.pubkey();
|
693 | 713 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
694 |
| - let test_validator = |
695 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 714 | + let test_validator = TestValidatorGenesis::default() |
| 715 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 716 | + .rent(Rent { |
| 717 | + lamports_per_byte_year: 1, |
| 718 | + exemption_threshold: 1.0, |
| 719 | + ..Rent::default() |
| 720 | + }) |
| 721 | + .faucet_addr(Some(faucet_addr)) |
| 722 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 723 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 724 | + .expect("validator start failed"); |
696 | 725 |
|
697 | 726 | let rpc_client =
|
698 | 727 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -1093,8 +1122,17 @@ fn test_cli_program_upgrade_auto_extend(skip_preflight: bool) {
|
1093 | 1122 | let mint_keypair = Keypair::new();
|
1094 | 1123 | let mint_pubkey = mint_keypair.pubkey();
|
1095 | 1124 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
1096 |
| - let test_validator = |
1097 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 1125 | + let test_validator = TestValidatorGenesis::default() |
| 1126 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 1127 | + .rent(Rent { |
| 1128 | + lamports_per_byte_year: 1, |
| 1129 | + exemption_threshold: 1.0, |
| 1130 | + ..Rent::default() |
| 1131 | + }) |
| 1132 | + .faucet_addr(Some(faucet_addr)) |
| 1133 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 1134 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 1135 | + .expect("validator start failed"); |
1098 | 1136 |
|
1099 | 1137 | let rpc_client =
|
1100 | 1138 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -1255,8 +1293,17 @@ fn test_cli_program_close_program() {
|
1255 | 1293 | let mint_keypair = Keypair::new();
|
1256 | 1294 | let mint_pubkey = mint_keypair.pubkey();
|
1257 | 1295 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
1258 |
| - let test_validator = |
1259 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 1296 | + let test_validator = TestValidatorGenesis::default() |
| 1297 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 1298 | + .rent(Rent { |
| 1299 | + lamports_per_byte_year: 1, |
| 1300 | + exemption_threshold: 1.0, |
| 1301 | + ..Rent::default() |
| 1302 | + }) |
| 1303 | + .faucet_addr(Some(faucet_addr)) |
| 1304 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 1305 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 1306 | + .expect("validator start failed"); |
1260 | 1307 |
|
1261 | 1308 | let rpc_client =
|
1262 | 1309 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -1374,8 +1421,17 @@ fn test_cli_program_extend_program() {
|
1374 | 1421 | let mint_keypair = Keypair::new();
|
1375 | 1422 | let mint_pubkey = mint_keypair.pubkey();
|
1376 | 1423 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
1377 |
| - let test_validator = |
1378 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 1424 | + let test_validator = TestValidatorGenesis::default() |
| 1425 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 1426 | + .rent(Rent { |
| 1427 | + lamports_per_byte_year: 1, |
| 1428 | + exemption_threshold: 1.0, |
| 1429 | + ..Rent::default() |
| 1430 | + }) |
| 1431 | + .faucet_addr(Some(faucet_addr)) |
| 1432 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 1433 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 1434 | + .expect("validator start failed"); |
1379 | 1435 |
|
1380 | 1436 | let rpc_client =
|
1381 | 1437 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -1550,8 +1606,17 @@ fn test_cli_program_write_buffer() {
|
1550 | 1606 | let mint_keypair = Keypair::new();
|
1551 | 1607 | let mint_pubkey = mint_keypair.pubkey();
|
1552 | 1608 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
1553 |
| - let test_validator = |
1554 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 1609 | + let test_validator = TestValidatorGenesis::default() |
| 1610 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 1611 | + .rent(Rent { |
| 1612 | + lamports_per_byte_year: 1, |
| 1613 | + exemption_threshold: 1.0, |
| 1614 | + ..Rent::default() |
| 1615 | + }) |
| 1616 | + .faucet_addr(Some(faucet_addr)) |
| 1617 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 1618 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 1619 | + .expect("validator start failed"); |
1555 | 1620 |
|
1556 | 1621 | let rpc_client =
|
1557 | 1622 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2037,8 +2102,17 @@ fn test_cli_program_set_buffer_authority() {
|
2037 | 2102 | let mint_keypair = Keypair::new();
|
2038 | 2103 | let mint_pubkey = mint_keypair.pubkey();
|
2039 | 2104 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2040 |
| - let test_validator = |
2041 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2105 | + let test_validator = TestValidatorGenesis::default() |
| 2106 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2107 | + .rent(Rent { |
| 2108 | + lamports_per_byte_year: 1, |
| 2109 | + exemption_threshold: 1.0, |
| 2110 | + ..Rent::default() |
| 2111 | + }) |
| 2112 | + .faucet_addr(Some(faucet_addr)) |
| 2113 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2114 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2115 | + .expect("validator start failed"); |
2042 | 2116 |
|
2043 | 2117 | let rpc_client =
|
2044 | 2118 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2209,8 +2283,17 @@ fn test_cli_program_mismatch_buffer_authority() {
|
2209 | 2283 | let mint_keypair = Keypair::new();
|
2210 | 2284 | let mint_pubkey = mint_keypair.pubkey();
|
2211 | 2285 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2212 |
| - let test_validator = |
2213 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2286 | + let test_validator = TestValidatorGenesis::default() |
| 2287 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2288 | + .rent(Rent { |
| 2289 | + lamports_per_byte_year: 1, |
| 2290 | + exemption_threshold: 1.0, |
| 2291 | + ..Rent::default() |
| 2292 | + }) |
| 2293 | + .faucet_addr(Some(faucet_addr)) |
| 2294 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2295 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2296 | + .expect("validator start failed"); |
2214 | 2297 |
|
2215 | 2298 | let rpc_client =
|
2216 | 2299 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2335,8 +2418,17 @@ fn test_cli_program_deploy_with_offline_signing(use_offline_signer_as_fee_payer:
|
2335 | 2418 | let mint_keypair = Keypair::new();
|
2336 | 2419 | let mint_pubkey = mint_keypair.pubkey();
|
2337 | 2420 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2338 |
| - let test_validator = |
2339 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2421 | + let test_validator = TestValidatorGenesis::default() |
| 2422 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2423 | + .rent(Rent { |
| 2424 | + lamports_per_byte_year: 1, |
| 2425 | + exemption_threshold: 1.0, |
| 2426 | + ..Rent::default() |
| 2427 | + }) |
| 2428 | + .faucet_addr(Some(faucet_addr)) |
| 2429 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2430 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2431 | + .expect("validator start failed"); |
2340 | 2432 |
|
2341 | 2433 | let rpc_client =
|
2342 | 2434 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2528,8 +2620,17 @@ fn test_cli_program_show() {
|
2528 | 2620 | let mint_keypair = Keypair::new();
|
2529 | 2621 | let mint_pubkey = mint_keypair.pubkey();
|
2530 | 2622 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2531 |
| - let test_validator = |
2532 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2623 | + let test_validator = TestValidatorGenesis::default() |
| 2624 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2625 | + .rent(Rent { |
| 2626 | + lamports_per_byte_year: 1, |
| 2627 | + exemption_threshold: 1.0, |
| 2628 | + ..Rent::default() |
| 2629 | + }) |
| 2630 | + .faucet_addr(Some(faucet_addr)) |
| 2631 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2632 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2633 | + .expect("validator start failed"); |
2533 | 2634 |
|
2534 | 2635 | let rpc_client =
|
2535 | 2636 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2725,8 +2826,17 @@ fn test_cli_program_dump() {
|
2725 | 2826 | let mint_keypair = Keypair::new();
|
2726 | 2827 | let mint_pubkey = mint_keypair.pubkey();
|
2727 | 2828 | let faucet_addr = run_local_faucet(mint_keypair, None);
|
2728 |
| - let test_validator = |
2729 |
| - TestValidator::with_no_fees(mint_pubkey, Some(faucet_addr), SocketAddrSpace::Unspecified); |
| 2829 | + let test_validator = TestValidatorGenesis::default() |
| 2830 | + .fee_rate_governor(FeeRateGovernor::new(0, 0)) |
| 2831 | + .rent(Rent { |
| 2832 | + lamports_per_byte_year: 1, |
| 2833 | + exemption_threshold: 1.0, |
| 2834 | + ..Rent::default() |
| 2835 | + }) |
| 2836 | + .faucet_addr(Some(faucet_addr)) |
| 2837 | + .deactivate_features(&[enable_loader_v4::id()]) |
| 2838 | + .start_with_mint_address(mint_pubkey, SocketAddrSpace::Unspecified) |
| 2839 | + .expect("validator start failed"); |
2730 | 2840 |
|
2731 | 2841 | let rpc_client =
|
2732 | 2842 | RpcClient::new_with_commitment(test_validator.rpc_url(), CommitmentConfig::processed());
|
@@ -2864,6 +2974,7 @@ fn test_cli_program_deploy_with_args(compute_unit_price: Option<u64>, use_rpc: b
|
2864 | 2974 | exemption_threshold: 1.0,
|
2865 | 2975 | ..Rent::default()
|
2866 | 2976 | })
|
| 2977 | + .deactivate_features(&[enable_loader_v4::id()]) |
2867 | 2978 | .rpc_config(JsonRpcConfig {
|
2868 | 2979 | enable_rpc_transaction_history: true,
|
2869 | 2980 | faucet_addr: Some(faucet_addr),
|
|
0 commit comments