chore: log

This commit is contained in:
2021-01-01 22:38:28 +08:00
parent de0184e253
commit 0941f9e340
2 changed files with 3 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ impl Command for CommandImpl {
}
let (pri_key, pub_key) = make_key_pair();
let json_key_pair = JsonKeyPair::from(pri_key, pub_key, tag.map(|t| t.into()));
success!("Write gen key file: {}", output);
fs::write(output, json_key_pair.to_json()?.as_bytes())?;
Ok(())
}

View File

@@ -64,14 +64,14 @@ impl ContractEngineCredit {
"query" => {
let params: CreditContractQueryParameters = serde_json::from_str(&tx_body.parameters)?;
let c = load_credit_contract(&params.name)?;
information!("Query: {}, credit: {}", &params.account, c.query(tx, &params.account));
success!("Query: {}, credit: {}", &params.account, c.query(tx, &params.account));
},
"query_all" => {
let params: CreditContractQueryAllParameters = serde_json::from_str(&tx_body.parameters)?;
let c = load_credit_contract(&params.name)?;
let map = c.query_all(tx);
map.iter().for_each(|(k , v)| {
information!("Query: {}, credit: {}", k, v);
success!("Query: {}, credit: {}", k, v);
});
},
_ => return simple_error!("Unknown action: {}", action),