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(nns-tools): nns_claim_or_refresh helper #3424

Merged
merged 1 commit into from
Jan 13, 2025
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 testnet/tools/nns-tools/lib/include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ source "$LIB_DIR/canisters.sh"
source "$LIB_DIR/constants.sh"
source "$LIB_DIR/functions.sh"
source "$LIB_DIR/installers.sh"
source "$LIB_DIR/nns_neurons.sh"
source "$LIB_DIR/proposals.sh"
source "$LIB_DIR/sns_upgrades.sh"
source "$LIB_DIR/topology.sh"
Expand Down
32 changes: 32 additions & 0 deletions testnet/tools/nns-tools/lib/nns_neurons.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
##: claim_or_refresh
## Usage: $1 <NETWORK> <NEURON_ID>
## Claim or refresh an NNS neuron with a particular ID
## NETWORK: The network to use.
## NEURON_ID: The neuron id to claim or refresh.
## Example: claim_or_refresh ic 1234567890
nns_claim_or_refresh() {
local network=$1
local neuron_id=$2

local IC=$(repo_root)
local GOV_DID="$IC/rs/nns/governance/canister/governance.did"

dfx canister \
--network ic \
call \
--candid "$GOV_DID" \
rrkah-fqaaa-aaaaa-aaaaq-cai \
manage_neuron "(
record {
id = opt record { id = ${neuron_id}: nat64 };
command = opt variant {
ClaimOrRefresh = record {
controller = null;
by = opt variant {
NeuronIdOrSubaccount = record { }
}
}
}
}
)"
}
Loading