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

Only disburse 1 ICP rather than full amount until we've seen it working #5103

Merged
merged 4 commits into from
Jan 3, 2024
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: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions backend/canisters/neuron_controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Changed

- Only disburse 1 ICP rather than full amount until we've seen it working ([#5103](https://github.com/open-chat-labs/open-chat/pull/5103))

## [[2.0.993](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.993-neuron_controller)] - 2024-01-03

### Added
Expand Down
2 changes: 1 addition & 1 deletion backend/canisters/neuron_controller/api/can.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type AccountIdentifier = vec nat8;
type AccountIdentifier = record { hash : vec nat8 };
type AddHotKey = record { new_hot_key : opt principal };
type Amount = record { e8s : nat64 };
type By = variant {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::updates::manage_nns_neuron::manage_nns_neuron_impl;
use crate::{mutate_state, read_state};
use ic_ledger_types::{AccountIdentifier, DEFAULT_SUBACCOUNT};
use nns_governance_canister::types::manage_neuron::disburse::Amount;
use nns_governance_canister::types::manage_neuron::{Command, Disburse, Spawn};
use nns_governance_canister::types::ListNeurons;
use std::time::Duration;
Expand Down Expand Up @@ -79,13 +80,19 @@ async fn spawn_neurons(neuron_ids: Vec<u64>) {
}

async fn disburse_neurons(neuron_ids: Vec<u64>) {
let account = nns_governance_canister::types::AccountIdentifier {
hash: AccountIdentifier::new(&SNS_GOVERNANCE_CANISTER_ID, &DEFAULT_SUBACCOUNT)
.as_ref()
.to_vec(),
};

for neuron_id in neuron_ids {
info!(neuron_id, "Disbursing neuron");
manage_nns_neuron_impl(
neuron_id,
Command::Disburse(Disburse {
to_account: Some(AccountIdentifier::new(&SNS_GOVERNANCE_CANISTER_ID, &DEFAULT_SUBACCOUNT)),
amount: None,
to_account: Some(account.clone()),
amount: Some(Amount { e8s: E8S_PER_ICP }),
}),
)
.await;
Expand Down
1 change: 0 additions & 1 deletion backend/external_canisters/nns_governance/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
[dependencies]
candid = { workspace = true }
canister_time = { path = "../../../libraries/canister_time" }
ic-ledger-types = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
types = { path = "../../../libraries/types" }
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use candid::{CandidType, Principal};
use ic_ledger_types::AccountIdentifier;
use serde::{Deserialize, Deserializer, Serialize};
use std::collections::HashMap;
use types::TimestampMillis;
Expand Down Expand Up @@ -663,6 +662,11 @@ pub struct Countries {
pub iso_codes: Vec<String>,
}

#[derive(CandidType, Serialize, Deserialize, Clone, Debug)]
pub struct AccountIdentifier {
pub hash: Vec<u8>,
}

impl TryFrom<ProposalInfo> for types::Proposal {
type Error = String;

Expand Down
Loading