chore: enums for statement and op types (#69)
* Experiment with statement & op enums * Clean-up & fixes * More clean-up * Add argument length checks * More clean-up * Place statement and operation logic in submodules
This commit is contained in:
parent
83a4f8969f
commit
c2d23b0b1b
11 changed files with 891 additions and 606 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use crate::middleware::{
|
||||
containers::Dictionary, hash_str, AnchoredKey, Hash, NativeStatement, Params, Pod, PodId,
|
||||
PodSigner, PodType, Statement, StatementArg, Value, KEY_SIGNER, KEY_TYPE,
|
||||
containers::Dictionary, hash_str, AnchoredKey, Hash, Params, Pod, PodId, PodSigner, PodType,
|
||||
Statement, Value, KEY_SIGNER, KEY_TYPE,
|
||||
};
|
||||
use crate::primitives::merkletree::MerkleTree;
|
||||
use anyhow::Result;
|
||||
|
|
@ -81,15 +81,7 @@ impl Pod for MockSignedPod {
|
|||
let id = self.id();
|
||||
self.dict
|
||||
.iter()
|
||||
.map(|(k, v)| {
|
||||
Statement(
|
||||
NativeStatement::ValueOf,
|
||||
vec![
|
||||
StatementArg::Key(AnchoredKey(id, Hash(k.0))),
|
||||
StatementArg::Literal(*v),
|
||||
],
|
||||
)
|
||||
})
|
||||
.map(|(k, v)| Statement::ValueOf(AnchoredKey(id, Hash(k.0)), *v))
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue