add validator contracts to native_contracts bin

This commit is contained in:
Robert Habermeier
2017-04-12 15:54:23 +02:00
parent 2d8a8bd3e5
commit 2f5a774325
3 changed files with 14 additions and 2 deletions

View File

@@ -299,10 +299,10 @@ fn detokenize(name: &str, output_type: ParamType) -> String {
ParamType::Bool => format!("{}.to_bool()", name),
ParamType::String => format!("{}.to_string()", name),
ParamType::Array(kind) => {
let read_array = format!("x.into_iter().map(|a| {{ {} }}).collect::<Option<Vec<_>>()",
let read_array = format!("x.into_iter().map(|a| {{ {} }}).collect::<Option<Vec<_>>>()",
detokenize("a", *kind));
format!("{}.to_array().and_then(|x| {})",
format!("{}.to_array().and_then(|x| {{ {} }})",
name, read_array)
}
ParamType::FixedArray(_, _) => panic!("Fixed-length arrays not supported.")