async fn add_node_rewards_table(nns_canisters: &NnsCanisters<'_>) {
    let new_entries = btreemap! {
        "EU".to_string() =>  NodeRewardRates {
            rates: btreemap!{
                "default".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 24_000,
                },
                "small".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 35_000,
                },
            }
        },
        "North America,Canada".to_string() =>  NodeRewardRates {
            rates: btreemap!{
                "default".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 68_000,
                },
                "small".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 11_000,
                },
            }
        },
        "North America,US,CA".to_string() =>  NodeRewardRates {
            rates: btreemap!{
                "default".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 234_000,
                },
                "small".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 907_000,
                },
                "storage_upgrade".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 103_000,
                },
            }
        }
    };

    let payload = UpdateNodeRewardsTableProposalPayload { new_entries };

    let proposal_id: ProposalId = submit_external_update_proposal(
        &nns_canisters.governance,
        Sender::from_keypair(&TEST_NEURON_1_OWNER_KEYPAIR),
        NeuronId(TEST_NEURON_1_ID),
        NnsFunction::UpdateNodeRewardsTable,
        payload.clone(),
        "<proposal created by test_get_monthly_node_provider_rewards>".to_string(),
        "".to_string(),
    )
    .await;

    // Wait for the proposal to be accepted and executed.
    assert_eq!(
        wait_for_final_state(&nns_canisters.governance, proposal_id)
            .await
            .status(),
        ProposalStatus::Executed
    );

    // No proposals should be pending now.
    let pending_proposals = get_pending_proposals(&nns_canisters.governance).await;
    assert_eq!(pending_proposals, vec![]);
}
/// Add a test rewards table to the Registry
Add a test rewards table to the Registry
Add a test rewards table to the Registry
async fn add_node_rewards_table(nns_canisters: &NnsCanisters<'_>) {
    let new_entries = btreemap! {
        "EU".to_string() =>  NodeRewardRates {
            rates: btreemap!{
                "default".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 24_000,
                },
                "small".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 35_000,
                },
            }
        },
        "North America,Canada".to_string() =>  NodeRewardRates {
            rates: btreemap!{
                "default".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 68_000,
                },
                "small".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 11_000,
                },
            }
        },
        "North America,US,CA".to_string() =>  NodeRewardRates {
            rates: btreemap!{
                "default".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 234_000,
                },
                "small".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 907_000,
                },
                "storage_upgrade".to_string() => NodeRewardRate {
                    xdr_permyriad_per_node_per_month: 103_000,
                },
            }
        }
    };
    let payload = UpdateNodeRewardsTableProposalPayload { new_entries };
    let proposal_id: ProposalId = submit_external_update_proposal(
        &nns_canisters.governance,
        Sender::from_keypair(&TEST_NEURON_1_OWNER_KEYPAIR),
        NeuronId(TEST_NEURON_1_ID),
        NnsFunction::UpdateNodeRewardsTable,
        payload.clone(),
        "<proposal created by test_get_monthly_node_provider_rewards>".to_string(),
        "".to_string(),
    )
    .await;
    // Wait for the proposal to be accepted and executed.
    assert_eq!(
        wait_for_final_state(&nns_canisters.governance, proposal_id)
            .await
            .status(),
        ProposalStatus::Executed
    );
    // No proposals should be pending now.
    let pending_proposals = get_pending_proposals(&nns_canisters.governance).await;
    assert_eq!(pending_proposals, vec![]);
}
async fn add_node_rewards_table ( nns_canisters : & NnsCanisters < ' _ > ) { let new_entries = btreemap ! { " " to_string ( ) NodeRewardRates { rates btreemap { " " to_string ( ) NodeRewardRate { xdr_permyriad_per_node_per_month 24_000 } " " to_string ( ) NodeRewardRate { xdr_permyriad_per_node_per_month 35_000 } } } " " to_string ( ) NodeRewardRates { rates btreemap { " " to_string ( ) NodeRewardRate { xdr_permyriad_per_node_per_month 68_000 } " " to_string ( ) NodeRewardRate { xdr_permyriad_per_node_per_month 11_000 } } } " " to_string ( ) NodeRewardRates { rates btreemap { " " to_string ( ) NodeRewardRate { xdr_permyriad_per_node_per_month 234_000 } " " to_string ( ) NodeRewardRate { xdr_permyriad_per_node_per_month 907_000 } " " to_string ( ) NodeRewardRate { xdr_permyriad_per_node_per_month 103_000 } } } } ; let payload = UpdateNodeRewardsTableProposalPayload { new_entries } ; let proposal_id : ProposalId = submit_external_update_proposal ( & nns_canisters . governance , Sender :: from_keypair ( & TEST_NEURON_1_OWNER_KEYPAIR ) , NeuronId ( TEST_NEURON_1_ID ) , NnsFunction :: UpdateNodeRewardsTable , payload . clone ( ) , " " . to_string ( ) , " " . to_string ( ) , ) . await ; // Wait for the proposal to be accepted and executed. assert_eq ! ( wait_for_final_state ( nns_canisters governance proposal_id ) await status ( ) ProposalStatus Executed ) ; // No proposals should be pending now. let pending_proposals = get_pending_proposals ( & nns_canisters . governance ) . await ; assert_eq ! ( pending_proposals vec [ ] ) ; }
Add a test rewards table to the Registry
Add a test rewards table to the Registry
nns_canisters
&NnsCanisters<'_>
nns_canisters
&NnsCanisters<'_>