Skip to content

Commit

Permalink
1-proposal-related-candid-update (#391)
Browse files Browse the repository at this point in the history
# Motivation

Rename a field in 1-proposal types.

# Changes

- neuronsFundInvestment -> neuronsFundInvestmentIcp

# Tests

Locally after creation an sns proposal
![localhost_5173_proposal__u=qsgjb-riaaa-aaaaa-aaaga-cai proposal=4
(2)](https://github.com/dfinity/ic-js/assets/98811342/efc384ed-7546-450c-94b5-5d01d34b8556)
  • Loading branch information
mstrasinskis authored Aug 4, 2023
1 parent 1be050b commit cd62540
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions packages/nns/candid/governance.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ export const idlFactory = ({ IDL }) => {
),
'confirmation_text' : IDL.Opt(IDL.Text),
'maximum_participant_icp' : IDL.Opt(Tokens),
'neurons_fund_investment' : IDL.Opt(Tokens),
'minimum_icp' : IDL.Opt(Tokens),
'minimum_participant_icp' : IDL.Opt(Tokens),
'start_time' : IDL.Opt(GlobalTimeOfDay),
'maximum_icp' : IDL.Opt(Tokens),
'neurons_fund_investment_icp' : IDL.Opt(Tokens),
'restricted_countries' : IDL.Opt(Countries),
});
const SwapDistribution = IDL.Record({ 'total' : IDL.Opt(Tokens) });
Expand Down Expand Up @@ -927,11 +927,11 @@ export const init = ({ IDL }) => {
),
'confirmation_text' : IDL.Opt(IDL.Text),
'maximum_participant_icp' : IDL.Opt(Tokens),
'neurons_fund_investment' : IDL.Opt(Tokens),
'minimum_icp' : IDL.Opt(Tokens),
'minimum_participant_icp' : IDL.Opt(Tokens),
'start_time' : IDL.Opt(GlobalTimeOfDay),
'maximum_icp' : IDL.Opt(Tokens),
'neurons_fund_investment_icp' : IDL.Opt(Tokens),
'restricted_countries' : IDL.Opt(Countries),
});
const SwapDistribution = IDL.Record({ 'total' : IDL.Opt(Tokens) });
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/candid/governance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,11 @@ export interface SwapParameters {
| [NeuronBasketConstructionParameters];
confirmation_text: [] | [string];
maximum_participant_icp: [] | [Tokens];
neurons_fund_investment: [] | [Tokens];
minimum_icp: [] | [Tokens];
minimum_participant_icp: [] | [Tokens];
start_time: [] | [GlobalTimeOfDay];
maximum_icp: [] | [Tokens];
neurons_fund_investment_icp: [] | [Tokens];
restricted_countries: [] | [Countries];
}
export interface Tally {
Expand Down
4 changes: 2 additions & 2 deletions packages/nns/candid/governance.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 509bc5a87192031915768db6e24647cc26f86069 'rs/nns/governance/canister/governance.did' by import-candid
// Generated from IC repo commit 72b42535224bc01c89266be2e9ec067cadf10515 'rs/nns/governance/canister/governance.did' by import-candid
type AccountIdentifier = record { hash : vec nat8 };
type Action = variant {
RegisterKnownNeuron : KnownNeuron;
Expand Down Expand Up @@ -481,11 +481,11 @@ type SwapParameters = record {
neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters;
confirmation_text : opt text;
maximum_participant_icp : opt Tokens;
neurons_fund_investment : opt Tokens;
minimum_icp : opt Tokens;
minimum_participant_icp : opt Tokens;
start_time : opt GlobalTimeOfDay;
maximum_icp : opt Tokens;
neurons_fund_investment_icp : opt Tokens;
restricted_countries : opt Countries;
};
type Tally = record {
Expand Down
4 changes: 2 additions & 2 deletions packages/nns/candid/governance.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ export const idlFactory = ({ IDL }) => {
),
'confirmation_text' : IDL.Opt(IDL.Text),
'maximum_participant_icp' : IDL.Opt(Tokens),
'neurons_fund_investment' : IDL.Opt(Tokens),
'minimum_icp' : IDL.Opt(Tokens),
'minimum_participant_icp' : IDL.Opt(Tokens),
'start_time' : IDL.Opt(GlobalTimeOfDay),
'maximum_icp' : IDL.Opt(Tokens),
'neurons_fund_investment_icp' : IDL.Opt(Tokens),
'restricted_countries' : IDL.Opt(Countries),
});
const SwapDistribution = IDL.Record({ 'total' : IDL.Opt(Tokens) });
Expand Down Expand Up @@ -939,11 +939,11 @@ export const init = ({ IDL }) => {
),
'confirmation_text' : IDL.Opt(IDL.Text),
'maximum_participant_icp' : IDL.Opt(Tokens),
'neurons_fund_investment' : IDL.Opt(Tokens),
'minimum_icp' : IDL.Opt(Tokens),
'minimum_participant_icp' : IDL.Opt(Tokens),
'start_time' : IDL.Opt(GlobalTimeOfDay),
'maximum_icp' : IDL.Opt(Tokens),
'neurons_fund_investment_icp' : IDL.Opt(Tokens),
'restricted_countries' : IDL.Opt(Countries),
});
const SwapDistribution = IDL.Record({ 'total' : IDL.Opt(Tokens) });
Expand Down
1 change: 1 addition & 0 deletions packages/nns/candid/sns_wasm.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const idlFactory = ({ IDL }) => {
'max_age_bonus_percentage' : IDL.Opt(IDL.Nat64),
'initial_token_distribution' : IDL.Opt(InitialTokenDistribution),
'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),
'token_logo' : IDL.Opt(IDL.Text),
'token_name' : IDL.Opt(IDL.Text),
'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),
'proposal_reject_cost_e8s' : IDL.Opt(IDL.Nat64),
Expand Down
1 change: 1 addition & 0 deletions packages/nns/candid/sns_wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export interface SnsInitPayload {
max_age_bonus_percentage: [] | [bigint];
initial_token_distribution: [] | [InitialTokenDistribution];
reward_rate_transition_duration_seconds: [] | [bigint];
token_logo: [] | [string];
token_name: [] | [string];
max_participant_icp_e8s: [] | [bigint];
proposal_reject_cost_e8s: [] | [bigint];
Expand Down
3 changes: 2 additions & 1 deletion packages/nns/candid/sns_wasm.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 509bc5a87192031915768db6e24647cc26f86069 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
// Generated from IC repo commit 72b42535224bc01c89266be2e9ec067cadf10515 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
type AddWasmRequest = record { hash : vec nat8; wasm : opt SnsWasm };
type AddWasmResponse = record { result : opt Result };
type AirdropDistribution = record { airdrop_neurons : vec NeuronDistribution };
Expand Down Expand Up @@ -126,6 +126,7 @@ type SnsInitPayload = record {
max_age_bonus_percentage : opt nat64;
initial_token_distribution : opt InitialTokenDistribution;
reward_rate_transition_duration_seconds : opt nat64;
token_logo : opt text;
token_name : opt text;
max_participant_icp_e8s : opt nat64;
proposal_reject_cost_e8s : opt nat64;
Expand Down
1 change: 1 addition & 0 deletions packages/nns/candid/sns_wasm.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const idlFactory = ({ IDL }) => {
'max_age_bonus_percentage' : IDL.Opt(IDL.Nat64),
'initial_token_distribution' : IDL.Opt(InitialTokenDistribution),
'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),
'token_logo' : IDL.Opt(IDL.Text),
'token_name' : IDL.Opt(IDL.Text),
'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),
'proposal_reject_cost_e8s' : IDL.Opt(IDL.Nat64),
Expand Down
6 changes: 3 additions & 3 deletions packages/nns/src/canisters/governance/request.converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ const fromSwapParameters = (
swapParameters.maximumParticipantIcp !== undefined
? [fromTokens(swapParameters.maximumParticipantIcp)]
: [],
neurons_fund_investment:
swapParameters.neuronsFundInvestment !== undefined
? [fromTokens(swapParameters.neuronsFundInvestment)]
neurons_fund_investment_icp:
swapParameters.neuronsFundInvestmentIcp !== undefined
? [fromTokens(swapParameters.neuronsFundInvestmentIcp)]
: [],
minimum_icp:
swapParameters.minimumIcp !== undefined
Expand Down
4 changes: 2 additions & 2 deletions packages/nns/src/canisters/governance/response.converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1155,8 +1155,8 @@ const toSwapParameters = (
maximumParticipantIcp: toTokens(
fromNullable(swapParameters.maximum_participant_icp),
),
neuronsFundInvestment: toTokens(
fromNullable(swapParameters.neurons_fund_investment),
neuronsFundInvestmentIcp: toTokens(
fromNullable(swapParameters.neurons_fund_investment_icp),
),
minimumIcp: toTokens(fromNullable(swapParameters.minimum_icp)),
minimumParticipantIcp: toTokens(
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/src/types/governance_converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ export interface SwapParameters {
neuronBasketConstructionParameters?: NeuronBasketConstructionParameters;
confirmationText?: string;
maximumParticipantIcp?: Tokens;
neuronsFundInvestment?: Tokens;
neuronsFundInvestmentIcp?: Tokens;
minimumIcp?: Tokens;
minimumParticipantIcp?: Tokens;
startTime?: GlobalTimeOfDay;
Expand Down

0 comments on commit cd62540

Please sign in to comment.