Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Migrate SNS commands #154

Merged
merged 3 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- ckBTC commands and support. (#153)
- SNS commands and support (replaces sns-quill). (#154)

## [0.3.2] - 2023-01-13

Expand Down
242 changes: 132 additions & 110 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ flate2 = "1.0.22"
hex = {version = "0.4.2", features = ["serde"] }
ic-agent = "0.21.0"
ic-identity-hsm = "0.21.0"
ic-base-types = { git = "https://github.com/dfinity/ic", rev = "a6ae48d2a5273d595bc113e0d28aba19da7612eb" }
ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "a6ae48d2a5273d595bc113e0d28aba19da7612eb" }
ic-icrc1 = { git = "https://github.com/dfinity/ic", rev = "a6ae48d2a5273d595bc113e0d28aba19da7612eb" }
ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "a6ae48d2a5273d595bc113e0d28aba19da7612eb" }
ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "a6ae48d2a5273d595bc113e0d28aba19da7612eb" }
ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "a6ae48d2a5273d595bc113e0d28aba19da7612eb" }
ic-base-types = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-icrc1 = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-sns-governance = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-sns-root = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-sns-wasm = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ic-types = "0.4.1"
icp-ledger = { git = "https://github.com/dfinity/ic", rev = "a6ae48d2a5273d595bc113e0d28aba19da7612eb" }
ledger-canister = { git = "https://github.com/dfinity/ic", rev = "a6ae48d2a5273d595bc113e0d28aba19da7612eb" }
icp-ledger = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
ledger-canister = { git = "https://github.com/dfinity/ic", rev = "0fc243cb16fbe9d45fd39b0bc6bd7a30dfc0aa77" }
num-bigint = "0.4.3"
openssl = "0.10.45"
pem = "1.0.1"
Expand Down Expand Up @@ -54,4 +59,4 @@ tempfile = "3.3.0"

[features]
static-ssl = ["openssl/vendored"]
default = ["static-ssl"]
default = ["static-ssl"]
19 changes: 14 additions & 5 deletions candid/ckbtc_minter.did
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ type BtcNetwork = variant {
Regtest;
};

type Mode = variant {
// The minter does not allow any state modifications.
ReadOnly;
// Only specified principals can modify minter's state.
RestrictedTo : vec principal;
// Anyone can interact with the minter.
GeneralAvailability;
};

// The initialization parameters of the minter canister.
type InitArgs = record {
// The minter will interact with this Bitcoin network to wrap/unwrap BTC.
Expand All @@ -90,8 +99,8 @@ type InitArgs = record {
/// accept a Bitcoin transaction.
min_confirmations : opt nat32;

/// Flag that indicates if the minter is in read-only mode.
is_read_only : bool;
/// The minter's operation mode.
mode : Mode;
};

// The upgrade parameters of the minter canister.
Expand All @@ -107,8 +116,8 @@ type UpgradeArgs = record {
/// accept a Bitcoin transaction.
min_confirmations : opt nat32;

/// Flag that indicates if the minter is in read-only mode.
is_read_only : opt bool;
/// If set, overrides the current minter's operation mode.
mode : opt Mode;
};

type RetrieveBtcStatus = variant {
Expand Down Expand Up @@ -169,7 +178,7 @@ type Event = variant {
requests : vec nat64;
txid : blob;
utxos : vec Utxo;
change_output : opt record { vout : nat32; value : nat32 };
change_output : opt record { vout : nat32; value : nat64 };
submitted_at : nat64;
};
confirmed_transaction : record { txid : blob };
Expand Down
21 changes: 12 additions & 9 deletions candid/governance.did
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ type GovernanceCachedMetrics = record {
community_fund_total_maturity_e8s_equivalent : nat64;
total_staked_e8s : nat64;
not_dissolving_neurons_count : nat64;
total_locked_e8s : nat64;
dissolved_neurons_e8s : nat64;
neurons_with_less_than_6_months_dissolve_delay_e8s : nat64;
dissolving_neurons_count_buckets : vec record { nat64; nat64 };
Expand Down Expand Up @@ -344,10 +345,11 @@ type RemoveHotKey = record { hot_key_to_remove : opt principal };
type Result = variant { Ok; Err : GovernanceError };
type Result_1 = variant { Error : GovernanceError; NeuronId : NeuronId };
type Result_2 = variant { Ok : Neuron; Err : GovernanceError };
type Result_3 = variant { Ok : RewardNodeProviders; Err : GovernanceError };
type Result_4 = variant { Ok : NeuronInfo; Err : GovernanceError };
type Result_5 = variant { Ok : NodeProvider; Err : GovernanceError };
type Result_6 = variant { Committed : Committed; Aborted : record {} };
type Result_3 = variant { Ok : GovernanceCachedMetrics; Err : GovernanceError };
type Result_4 = variant { Ok : RewardNodeProviders; Err : GovernanceError };
type Result_5 = variant { Ok : NeuronInfo; Err : GovernanceError };
type Result_6 = variant { Ok : NodeProvider; Err : GovernanceError };
type Result_7 = variant { Committed : Committed; Aborted : record {} };
type RewardEvent = record {
day_after_genesis : nat64;
actual_timestamp_seconds : nat64;
Expand Down Expand Up @@ -379,7 +381,7 @@ type SetSnsTokenSwapOpenTimeWindow = record {
swap_canister_id : opt principal;
};
type SettleCommunityFundParticipation = record {
result : opt Result_6;
result : opt Result_7;
open_sns_token_swap_proposal_id : opt nat64;
};
type Spawn = record {
Expand Down Expand Up @@ -426,17 +428,18 @@ service : (Governance) -> {
get_full_neuron_by_id_or_subaccount : (NeuronIdOrSubaccount) -> (
Result_2,
) query;
get_monthly_node_provider_rewards : () -> (Result_3);
get_metrics : () -> (Result_3) query;
get_monthly_node_provider_rewards : () -> (Result_4);
get_most_recent_monthly_node_provider_rewards : () -> (
opt MostRecentMonthlyNodeProviderRewards,
) query;
get_network_economics_parameters : () -> (NetworkEconomics) query;
get_neuron_ids : () -> (vec nat64) query;
get_neuron_info : (nat64) -> (Result_4) query;
get_neuron_info : (nat64) -> (Result_5) query;
get_neuron_info_by_id_or_subaccount : (NeuronIdOrSubaccount) -> (
Result_4,
Result_5,
) query;
get_node_provider_by_caller : (null) -> (Result_5) query;
get_node_provider_by_caller : (null) -> (Result_6) query;
get_pending_proposals : () -> (vec ProposalInfo) query;
get_proposal_info : (nat64) -> (opt ProposalInfo) query;
list_known_neurons : () -> (ListKnownNeuronsResponse) query;
Expand Down
1 change: 1 addition & 0 deletions candid/ledger.did
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ service: (LedgerCanisterInitPayload) -> {
send_dfx : (SendArgs) -> (BlockIndex);
notify_dfx: (NotifyCanisterArgs) -> ();
account_balance_dfx : (AccountBalanceArgs) -> (Tokens) query;
notify_pb: () -> ();
}
Loading