Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Mar 21, 2024
1 parent bfb82ab commit 0e9df58
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/output/default/sns/make_proposal/with_blob.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Sending message with

Call type: update
Sender: fdsgv-62ihb-nbiqv-xgic5-iefsv-3cscz-tmbzv-63qd5-vh43v-dqfrt-pae
Canister id: rrkah-fqaaa-aaaaa-aaaaq-cai
Method name: manage_neuron
Arguments: (
record {
subaccount = blob "\83\a7\d2\b1\2f\65\4f\f5\83\35\e5\a2\51\2c\ca\e0\d7\83\9c\74\4b\18\07\a4\7c\96\f5\b9\f3\96\90\69";
command = opt variant {
MakeProposal = record {
url = "example.com";
title = "Transfer ICP from SNS treasury.";
action = opt variant {
TransferSnsTreasuryFunds = record {
from_treasury = 1 : int32;
to_principal = opt principal "rrkah-fqaaa-aaaaa-aaaaq-cai";
to_subaccount = opt record {
subaccount = blob "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01";
};
memo = null;
amount_e8s = 1_000_000_000 : nat64;
}
};
summary = "";
}
};
},
)
17 changes: 17 additions & 0 deletions tests/output/sns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,23 @@ fn make_proposal() {
"sns make-proposal {NEURON_ID} --proposal '{proposal}'"
))
.diff("sns/make_proposal/simple.txt");
let proposal_with_blob = r#"
( record {
title = "Transfer ICP from SNS treasury.";
url = "example.com";
summary = "";
action = opt variant { TransferSnsTreasuryFunds = record {
from_treasury = 1 : int32;
to_principal = opt principal "rrkah-fqaaa-aaaaa-aaaaq-cai";
to_subaccount = opt record { subaccount = vec {0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1} };
memo = null;
amount_e8s = 1_000_000_000: nat64
} };
} )"#;
quill_sns_send(&format!(
"sns make-proposal {NEURON_ID} --proposal '{proposal_with_blob}'"
))
.diff("sns/make_proposal/with_blob.txt");
let proposal_bin = asset("sns_proposal.bin");
quill_sns_send(&format!(
"sns make-proposal {NEURON_ID} --proposal-path '{proposal_bin}'",
Expand Down

0 comments on commit 0e9df58

Please sign in to comment.