use index map in state module

This commit is contained in:
collin 2020-12-07 12:12:31 -05:00
parent ae6ee186ad
commit bcaf7d3e66
2 changed files with 6 additions and 2 deletions

View File

@ -52,6 +52,10 @@ default-features = false
[dependencies.snarkos-utilities]
version = "1.1.3"
[dependencies.indexmap]
version = "1.6.0"
features = ["serde-1"]
[dependencies.rand]
version = "0.7"

View File

@ -17,13 +17,13 @@
use crate::InputValueError;
use leo_ast::{InputValue, Parameter};
use std::collections::HashMap;
use indexmap::IndexMap;
/// Returns the input parameter with the given name.
/// If a parameter with the given name does not exist, then an error is returned.
pub fn find_input(
name: String,
parameters: &HashMap<Parameter, Option<InputValue>>,
parameters: &IndexMap<Parameter, Option<InputValue>>,
) -> Result<InputValue, InputValueError> {
let matched_parameter = parameters
.iter()