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

Remove sns import #78

Merged
merged 6 commits into from
Aug 19, 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 add_hot_key.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ 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})" \
| idl2json \
| jq -r ".neurons[0].id[0].id" \
Expand Down
1 change: 0 additions & 1 deletion deploy_sns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ic-admin \
--summary "This proposal whitelists developer's principal to deploy SNS"

${DFX} nns import --network-mapping "${DX_NETWORK}=mainnet"
${DFX} sns import
if [ "${CANISTER_TEST}" == "_test" ]
then
curl -L "https://raw.githubusercontent.com/dfinity/ic/${IC_COMMIT}/rs/nns/governance/canister/governance_test.did" -o ./candid/nns-governance.did
Expand Down
1 change: 0 additions & 1 deletion developer_neuron_id.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ 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})" \
| idl2json \
| jq -r ".neurons[0].id[0].id" \
Expand Down
1 change: 0 additions & 1 deletion execute_generic_functions_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ 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})" \
| idl2json \
| jq -r ".neurons[0].id[0].id" \
Expand Down
1 change: 0 additions & 1 deletion get_all_sns_neurons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,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})"
1 change: 0 additions & 1 deletion get_last_sns_proposal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,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 {};})'
1 change: 0 additions & 1 deletion get_sns_canisters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
dfx canister \
--network "${NETWORK}" \
call "${SNS_ROOT_CANISTER_ID}" \
--candid candid/sns_root.did \
list_sns_canisters '(record {})'
1 change: 0 additions & 1 deletion get_sns_neuron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,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}\"};})"
1 change: 0 additions & 1 deletion get_sns_neurons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,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})"
1 change: 0 additions & 1 deletion get_sns_proposal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,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)}})"
1 change: 0 additions & 1 deletion get_sns_swap_state.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
dfx canister call \
--network "${NETWORK}" \
"${SNS_SWAP_CANISTER_ID}" \
--candid candid/sns_swap.did \
get_state '(record {})'
5 changes: 1 addition & 4 deletions list_sns_dev_neurons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ for DEV_IDENT in "${HOME}"/.config/dfx/identity/dev-ident-*; do
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})")"
echo "Listing Developer Neurons for Identity ${DEV_IDENT}, Principal ${DX_PRINCIPAL}"
echo "${NEURON_IDS}"
Expand All @@ -26,9 +25,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}"
1 change: 0 additions & 1 deletion perform_neuron_operation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ 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})" \
| idl2json \
| jq -r ".neurons[0].id[0].id" \
Expand Down
1 change: 0 additions & 1 deletion propose_sns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ dfx canister \
qaa6y-5yaaa-aaaaa-aaafa-cai # SNS-W canister

${DFX} nns import --network-mapping "${DX_NETWORK}=mainnet"
${DFX} sns import
if [ "${CANISTER_TEST}" == "_test" ]
then
curl -L "https://raw.githubusercontent.com/dfinity/ic/${IC_COMMIT}/rs/nns/governance/canister/governance_test.did" -o ./candid/nns-governance.did
Expand Down
1 change: 0 additions & 1 deletion register_dapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ 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})" \
| idl2json \
| jq -r ".neurons[0].id[0].id" \
Expand Down
1 change: 0 additions & 1 deletion register_generic_functions_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ 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})" \
| idl2json \
| jq -r ".neurons[0].id[0].id" \
Expand Down
21 changes: 20 additions & 1 deletion run_basic_scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,26 @@ jq -r '.root_canister_id' -e sns_canister_ids.json
jq -r '.swap_canister_id' -e sns_canister_ids.json

# Assert the SNS swap lifecycle is in the OPEN state.
[ "$(./get_sns_swap_state.sh | ./bin/idl2json | jq -r '.swap[0].lifecycle')" == "2" ] && echo "OK" || exit 1
(
# Run the command and capture the output
swap_state=$(./get_sns_swap_state.sh | ./bin/idl2json)

# Extract the lifecycle value
lifecycle=$(echo "$swap_state" | jq -r '.swap[0].lifecycle')

# Log the output and extracted lifecycle value
echo "swap_state: ${swap_state}"

# Check if the lifecycle is in the OPEN state (2)
if [ "${lifecycle}" == "2" ]; then
echo "SNS swap lifecycle is in the OPEN state (2)!"
else
echo "ERROR - SNS swap lifecycle is not in the OPEN state"
echo "Expected: 2 (OPEN state)"
echo "Actual: ${lifecycle}"
exit 1
fi
)

# Assert that the test canister is indeed registered.
[ "$(./get_sns_canisters.sh | ./bin/idl2json | jq -r '.dapps[0]')" == "$(./bin/dfx canister id test)" ] && echo "OK" || exit 1
Expand Down
1 change: 0 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ fi
set -uo pipefail

${DFX} nns import --network-mapping "${DX_NETWORK}=mainnet"
${DFX} sns import
if [ "${CANISTER_TEST}" == "_test" ]
then
curl -L "https://raw.githubusercontent.com/dfinity/ic/${IC_COMMIT}/rs/nns/governance/canister/governance_test.did" -o ./candid/nns-governance.did
Expand Down
1 change: 0 additions & 1 deletion setup_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ${DFX} extension install nns --version ${DFX_NNS_VERSION} || true
${DFX} extension install sns --version ${DFX_SNS_VERSION} || true

${DFX} nns import
${DFX} sns import
if [ "${CANISTER_TEST}" == "_test" ]
then
curl -L "https://raw.githubusercontent.com/dfinity/ic/${IC_COMMIT}/rs/nns/governance/canister/governance_test.did" -o ./candid/nns-governance.did
Expand Down
1 change: 0 additions & 1 deletion transfer_sns_treasury_funds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ 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})" \
| idl2json \
| jq -r ".neurons[0].id[0].id" \
Expand Down
1 change: 0 additions & 1 deletion update_sns_neuron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ ARG="${1}"
dfx canister \
--network "${NETWORK}" \
call "${SNS_GOVERNANCE_CANISTER_ID}" \
--candid candid/sns_governance.did \
update_neuron "(${ARG})"
1 change: 0 additions & 1 deletion upgrade_dapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ 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})" \
| idl2json \
| jq -r ".neurons[0].id[0].id" \
Expand Down
1 change: 0 additions & 1 deletion vote_on_sns_proposal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ do
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})" \
| idl2json \
| jq -r ".neurons")"
Expand Down
1 change: 0 additions & 1 deletion vote_with_developer_neurons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ for DEV_IDENT in "$HOME"/.config/dfx/identity/dev-ident-*; do
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})" \
| idl2json \
| jq -r ".neurons")"
Expand Down
1 change: 0 additions & 1 deletion vote_with_single_identity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ 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})" \
| idl2json \
| jq -r ".neurons")"
Expand Down
1 change: 0 additions & 1 deletion wait_for_canister_running.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ 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}\"})" \
| ./bin/idl2json \
| jq -r '.status')" != "$(echo -e "{\n \"running\": null\n}")" ]
Expand Down
Loading