Skip to content

Commit

Permalink
fix: allow parsing strings from toml into booleans (#894)
Browse files Browse the repository at this point in the history
* fix: allow parsing strings from toml into booleans

* chore: remove catch-all arm from match
  • Loading branch information
TomAFrench authored Feb 23, 2023
1 parent 575436f commit f729a00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/noirc_abi/src/input_parser/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ impl InputValue {
let input_value = match value {
TomlTypes::String(string) => match param_type {
AbiType::String { .. } => InputValue::String(string),
AbiType::Field | AbiType::Integer { .. } => {
AbiType::Field | AbiType::Integer { .. } | AbiType::Boolean => {
InputValue::Field(parse_str_to_field(&string)?)
}
_ => return Err(InputParserError::AbiTypeMismatch(param_type.clone())),

AbiType::Array { .. } | AbiType::Struct { .. } => {
return Err(InputParserError::AbiTypeMismatch(param_type.clone()))
}
},
TomlTypes::Integer(integer) => {
let new_value = FieldElement::from(i128::from(integer));
Expand Down

0 comments on commit f729a00

Please sign in to comment.