From 711c234a9fb3dab5d1f342b6fd59f65154180bf6 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Mon, 19 Aug 2024 11:58:55 -0500 Subject: [PATCH] I don't think we need to specify the candid usually --- add_hot_key.sh | 4 +--- developer_neuron_id.sh | 4 +--- execute_generic_functions_test.sh | 4 +--- get_all_sns_neurons.sh | 4 +--- get_last_sns_proposal.sh | 4 +--- get_sns_canisters.sh | 4 +--- get_sns_neuron.sh | 4 +--- get_sns_neurons.sh | 4 +--- get_sns_proposal.sh | 4 +--- list_sns_dev_neurons.sh | 8 ++------ perform_neuron_operation.sh | 4 +--- register_dapp.sh | 4 +--- register_generic_functions_test.sh | 4 +--- transfer_sns_treasury_funds.sh | 4 +--- update_sns_neuron.sh | 4 +--- upgrade_dapp.sh | 4 +--- vote_on_sns_proposal.sh | 4 +--- vote_with_developer_neurons.sh | 4 +--- vote_with_single_identity.sh | 4 +--- wait_for_canister_running.sh | 4 +--- 20 files changed, 21 insertions(+), 63 deletions(-) diff --git a/add_hot_key.sh b/add_hot_key.sh index 23624e6..5b09ced 100755 --- a/add_hot_key.sh +++ b/add_hot_key.sh @@ -19,9 +19,7 @@ HOTKEY_PRINCIPAL=$(dfx identity get-principal) export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${OWNER_PRINCIPAL}\"; limit = 1})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${OWNER_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ | python3 -c "import sys; ints=sys.stdin.readlines(); sys.stdout.write(bytearray(eval(''.join(ints))).hex())")" diff --git a/developer_neuron_id.sh b/developer_neuron_id.sh index 359b28c..52f2b65 100755 --- a/developer_neuron_id.sh +++ b/developer_neuron_id.sh @@ -8,9 +8,7 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" echo "$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ | python3 -c "import sys; ints=sys.stdin.readlines(); sys.stdout.write(bytearray(eval(''.join(ints))).hex())")" diff --git a/execute_generic_functions_test.sh b/execute_generic_functions_test.sh index be82d51..4255668 100755 --- a/execute_generic_functions_test.sh +++ b/execute_generic_functions_test.sh @@ -10,9 +10,7 @@ export TEXT="${1:-Hoi}" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ | python3 -c "import sys; ints=sys.stdin.readlines(); sys.stdout.write(bytearray(eval(''.join(ints))).hex())")" diff --git a/get_all_sns_neurons.sh b/get_all_sns_neurons.sh index 8844fa5..6689f85 100755 --- a/get_all_sns_neurons.sh +++ b/get_all_sns_neurons.sh @@ -8,6 +8,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = null; limit = 0})" + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = null; limit = 0})" diff --git a/get_last_sns_proposal.sh b/get_last_sns_proposal.sh index 96a5bd9..e9a7bc4 100755 --- a/get_last_sns_proposal.sh +++ b/get_last_sns_proposal.sh @@ -8,6 +8,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_proposals '(record {include_reward_status = vec {}; limit = 1:nat32; exclude_type = vec {}; include_status = vec {};})' + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_proposals '(record {include_reward_status = vec {}; limit = 1:nat32; exclude_type = vec {}; include_status = vec {};})' diff --git a/get_sns_canisters.sh b/get_sns_canisters.sh index 857ba5b..62bddb0 100755 --- a/get_sns_canisters.sh +++ b/get_sns_canisters.sh @@ -8,6 +8,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" dfx canister \ --network "${NETWORK}" \ - call "${SNS_ROOT_CANISTER_ID}" \ - --candid candid/sns_root.did \ - list_sns_canisters '(record {})' + call "${SNS_ROOT_CANISTER_ID}" \ list_sns_canisters '(record {})' diff --git a/get_sns_neuron.sh b/get_sns_neuron.sh index f19ae39..5dc9a78 100755 --- a/get_sns_neuron.sh +++ b/get_sns_neuron.sh @@ -10,6 +10,4 @@ ID="${1}" dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - get_neuron "(record {neuron_id = opt record {id = blob \"${ID}\"};})" + call "${SNS_GOVERNANCE_CANISTER_ID}" \ get_neuron "(record {neuron_id = opt record {id = blob \"${ID}\"};})" diff --git a/get_sns_neurons.sh b/get_sns_neurons.sh index a8cf73b..a4d740d 100755 --- a/get_sns_neurons.sh +++ b/get_sns_neurons.sh @@ -8,6 +8,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"$(dfx identity get-principal)\"; limit = 0})" + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"$(dfx identity get-principal)\"; limit = 0})" diff --git a/get_sns_proposal.sh b/get_sns_proposal.sh index fef264f..56335cb 100755 --- a/get_sns_proposal.sh +++ b/get_sns_proposal.sh @@ -10,6 +10,4 @@ export ID="${1:-1}" dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - get_proposal "(record {proposal_id = opt record {id = (${ID}:nat64)}})" + call "${SNS_GOVERNANCE_CANISTER_ID}" \ get_proposal "(record {proposal_id = opt record {id = (${ID}:nat64)}})" diff --git a/list_sns_dev_neurons.sh b/list_sns_dev_neurons.sh index d3182b9..22d1bc0 100755 --- a/list_sns_dev_neurons.sh +++ b/list_sns_dev_neurons.sh @@ -14,9 +14,7 @@ for DEV_IDENT in "${HOME}"/.config/dfx/identity/dev-ident-*; do export DX_PRINCIPAL="$(dfx identity get-principal)" export NEURON_IDS="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" list_neurons \ - --candid candid/sns_governance.did \ - "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})")" + call "${SNS_GOVERNANCE_CANISTER_ID}" list_neurons \ "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})")" echo "Listing Developer Neurons for Identity ${DEV_IDENT}, Principal ${DX_PRINCIPAL}" echo "${NEURON_IDS}" done @@ -26,9 +24,7 @@ CANISTER_DEV_NEURON=n2xex-iyaaa-aaaar-qaaeq-cai echo "Listing for ${CANISTER_DEV_NEURON}" dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${CANISTER_DEV_NEURON}\"; limit = 0})" + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${CANISTER_DEV_NEURON}\"; limit = 0})" # Switch back to the previous identity dfx identity use "${CURRENT_DX_IDENT}" diff --git a/perform_neuron_operation.sh b/perform_neuron_operation.sh index 7a8c41c..64b543a 100755 --- a/perform_neuron_operation.sh +++ b/perform_neuron_operation.sh @@ -8,9 +8,7 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ | python3 -c "import sys; ints=sys.stdin.readlines(); sys.stdout.write(bytearray(eval(''.join(ints))).hex())")" diff --git a/register_dapp.sh b/register_dapp.sh index 620a757..207be39 100755 --- a/register_dapp.sh +++ b/register_dapp.sh @@ -13,9 +13,7 @@ dfx canister --network "${NETWORK}" update-settings --add-controller "${SNS_ROOT export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ | python3 -c "import sys; ints=sys.stdin.readlines(); sys.stdout.write(bytearray(eval(''.join(ints))).hex())")" diff --git a/register_generic_functions_test.sh b/register_generic_functions_test.sh index 352ea59..3beeeca 100755 --- a/register_generic_functions_test.sh +++ b/register_generic_functions_test.sh @@ -8,9 +8,7 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ | python3 -c "import sys; ints=sys.stdin.readlines(); sys.stdout.write(bytearray(eval(''.join(ints))).hex())")" diff --git a/transfer_sns_treasury_funds.sh b/transfer_sns_treasury_funds.sh index de21e78..c2ec2b7 100755 --- a/transfer_sns_treasury_funds.sh +++ b/transfer_sns_treasury_funds.sh @@ -11,9 +11,7 @@ export TO_PRINCIPAL="${2:-$DX_PRINCIPAL}" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ | python3 -c "import sys; ints=sys.stdin.readlines(); sys.stdout.write(bytearray(eval(''.join(ints))).hex())")" diff --git a/update_sns_neuron.sh b/update_sns_neuron.sh index b8e9f1f..12e3702 100755 --- a/update_sns_neuron.sh +++ b/update_sns_neuron.sh @@ -10,6 +10,4 @@ ARG="${1}" dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - update_neuron "(${ARG})" + call "${SNS_GOVERNANCE_CANISTER_ID}" \ update_neuron "(${ARG})" diff --git a/upgrade_dapp.sh b/upgrade_dapp.sh index d69b025..f35efda 100755 --- a/upgrade_dapp.sh +++ b/upgrade_dapp.sh @@ -16,9 +16,7 @@ export ARG="${3:-()}" export DEVELOPER_NEURON_ID="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 1})" \ | idl2json \ | jq -r ".neurons[0].id[0].id" \ | python3 -c "import sys; ints=sys.stdin.readlines(); sys.stdout.write(bytearray(eval(''.join(ints))).hex())")" diff --git a/vote_on_sns_proposal.sh b/vote_on_sns_proposal.sh index 5cf9587..d4ae39c 100755 --- a/vote_on_sns_proposal.sh +++ b/vote_on_sns_proposal.sh @@ -19,9 +19,7 @@ do export DX_PRINCIPAL="$(dfx identity get-principal)" export JSON="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})" \ | idl2json \ | jq -r ".neurons")" for((i=0; i<"$(echo $JSON | jq length)"; i++)) diff --git a/vote_with_developer_neurons.sh b/vote_with_developer_neurons.sh index 577a218..5999019 100755 --- a/vote_with_developer_neurons.sh +++ b/vote_with_developer_neurons.sh @@ -17,9 +17,7 @@ for DEV_IDENT in "$HOME"/.config/dfx/identity/dev-ident-*; do export DX_PRINCIPAL="$(dfx identity get-principal)" export JSON="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})" \ | idl2json \ | jq -r ".neurons")" for((i=0; i<"$(echo $JSON | jq length)"; i++)) diff --git a/vote_with_single_identity.sh b/vote_with_single_identity.sh index c2357d7..dd8a3e3 100755 --- a/vote_with_single_identity.sh +++ b/vote_with_single_identity.sh @@ -17,9 +17,7 @@ PEM_FILE="$(readlink -f "$HOME/.config/dfx/identity/${VOTING_IDENTITY}/identity. export DX_PRINCIPAL="$(dfx identity get-principal)" export JSON="$(dfx canister \ --network "${NETWORK}" \ - call "${SNS_GOVERNANCE_CANISTER_ID}" \ - --candid candid/sns_governance.did \ - list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})" \ + call "${SNS_GOVERNANCE_CANISTER_ID}" \ list_neurons "(record {of_principal = opt principal\"${DX_PRINCIPAL}\"; limit = 0})" \ | idl2json \ | jq -r ".neurons")" diff --git a/wait_for_canister_running.sh b/wait_for_canister_running.sh index b8f6a73..4ef3415 100755 --- a/wait_for_canister_running.sh +++ b/wait_for_canister_running.sh @@ -10,9 +10,7 @@ export CID="${1}" while [ "$(./bin/dfx canister \ --network "${NETWORK}" \ - call ${SNS_ROOT_CANISTER_ID} \ - --candid candid/sns_root.did \ - canister_status "(record {canister_id=principal\"${CID}\"})" \ + call ${SNS_ROOT_CANISTER_ID} \ canister_status "(record {canister_id=principal\"${CID}\"})" \ | ./bin/idl2json \ | jq -r '.status')" != "$(echo -e "{\n \"running\": null\n}")" ] do