Skip to content

Commit

Permalink
undo
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Jan 22, 2025
1 parent 5a7238a commit be9faee
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/commands/make_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ use std::{fs, path::PathBuf};

use crate::{
lib::{
get_local_candid, governance_canister_id,
governance_canister_id,
signing::{sign_ingress_with_request_status_query, IngressWithRequestId},
AuthInfo, ROLE_NNS_GOVERNANCE,
},
AnyhowResult,
};
use anyhow::Error;
use candid::{CandidType, Decode, Encode, TypeEnv};
use candid_parser::{check_prog, parse_idl_args};
use candid_parser::parse_idl_args;
use clap::Parser;
use ic_nns_common::pb::v1::NeuronId;
use ic_nns_governance::pb::v1::{
Expand Down Expand Up @@ -83,11 +83,6 @@ pub fn exec(auth: &AuthInfo, opts: MakeProposalOpts) -> AnyhowResult<Vec<Ingress

fn parse_nns_proposal_from_candid_string(proposal_candid: String) -> AnyhowResult<Proposal> {
let args = parse_idl_args(&proposal_candid)?;
let mut env = TypeEnv::default();
check_prog(
&mut env,
&get_local_candid(governance_canister_id(), ROLE_NNS_GOVERNANCE)?.parse()?,
)?;
let args: Vec<u8> = args.to_bytes_with_types(&env, &[Proposal::ty()])?;
let args: Vec<u8> = args.to_bytes_with_types(&TypeEnv::default(), &[Proposal::ty()])?;
Decode!(args.as_slice(), Proposal).map_err(Error::msg)
}

0 comments on commit be9faee

Please sign in to comment.