(
arg: &str,
matches: &ArgMatches,
)
| 297 | } |
| 298 | |
| 299 | fn parse_instruction_file( |
| 300 | arg: &str, |
| 301 | matches: &ArgMatches, |
| 302 | ) -> Result<SerializableInstruction, CliError> { |
| 303 | let filepath = parse_string(arg, matches)?; |
| 304 | let text = fs::read_to_string(filepath).map_err(|_err| CliError::BadParameter(arg.into()))?; |
| 305 | let ix: JsonInstructionData = |
| 306 | serde_json::from_str(text.as_str()).expect("JSON was not well-formatted"); |
| 307 | SerializableInstruction::try_from(&ix) |
| 308 | } |
| 309 | |
| 310 | fn parse_keypair_file(arg: &str, matches: &ArgMatches) -> Result<Keypair, CliError> { |
| 311 | Ok(read_keypair_file(parse_string(arg, matches)?) |
no test coverage detected