diff --git a/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/document_transition/mod.rs b/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/document_transition/mod.rs index 448dffcfea4..cd7cea67492 100644 --- a/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/document_transition/mod.rs +++ b/packages/rs-dpp/src/state_transition/state_transitions/document/documents_batch_transition/document_transition/mod.rs @@ -44,7 +44,8 @@ pub trait DocumentTransitionV0Methods { fn get_dynamic_property(&self, path: &str) -> Option<&Value>; /// get the id fn get_id(&self) -> Identifier; - /// get the document type + /// get the entropy + fn entropy(&self) -> Vec; fn document_type_name(&self) -> &String; /// get the data contract id fn data_contract_id(&self) -> Identifier; @@ -167,6 +168,10 @@ impl DocumentTransitionV0Methods for DocumentTransition { self.base().document_type_name() } + fn entropy(&self) -> Vec { + self.entropy() + } + fn data_contract_id(&self) -> Identifier { self.base().data_contract_id() } diff --git a/packages/wasm-dpp/src/document/state_transition/document_batch_transition/document_transition/mod.rs b/packages/wasm-dpp/src/document/state_transition/document_batch_transition/document_transition/mod.rs index f8935edc9d5..8a841f1300c 100644 --- a/packages/wasm-dpp/src/document/state_transition/document_batch_transition/document_transition/mod.rs +++ b/packages/wasm-dpp/src/document/state_transition/document_batch_transition/document_transition/mod.rs @@ -88,15 +88,8 @@ impl DocumentTransitionWasm { } } #[wasm_bindgen(js_name=getEntropy)] - pub fn get_revision(&self) -> Vec { - match self.0.clone() { - DocumentTransition::Create(document_transition) => Vec::from(document_transition.entropy()), - DocumentTransition::Replace(document_transition) => Vec::from(document_transition.entropy()), - DocumentTransition::Delete(document_transition) => Vec::from(document_transition.entropy()), - DocumentTransition::Transfer(document_transition) => Vec::from(document_transition.entropy()), - DocumentTransition::UpdatePrice(document_transition) => Vec::from(document_transition.entropy()), - DocumentTransition::Purchase(document_transition) => Vec::from(document_transition.entropy()), - } + pub fn get_entropy(&self) -> Vec { + self.0.entropy() } #[wasm_bindgen(js_name=setRevision)]