-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nns-tools): nns_claim_or_refresh helper (#3424)
Add a simple way to claim or refresh a neuron (for reference)
- Loading branch information
1 parent
cf53688
commit 66ff234
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { } | ||
} | ||
} | ||
} | ||
} | ||
)" | ||
} |