@dashevo/wasm-dpp 0.25.0-dev.21 → 0.25.0-dev.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/wasm-dpp",
3
- "version": "0.25.0-dev.21",
3
+ "version": "0.25.0-dev.23",
4
4
  "description": "The JavaScript implementation of the Dash Platform Protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -44,8 +44,8 @@
44
44
  "@babel/core": "^7.15.5",
45
45
  "@babel/preset-env": "^7.15.4",
46
46
  "@dashevo/dashcore-lib": "~0.20.9",
47
- "@dashevo/dpns-contract": "0.25.0-dev.21",
48
- "@dashevo/dpp": "0.25.0-dev.21",
47
+ "@dashevo/dpns-contract": "0.25.0-dev.23",
48
+ "@dashevo/dpp": "0.25.0-dev.23",
49
49
  "@dashevo/wasm-re2": "~2.0.4",
50
50
  "@types/bs58": "^4.0.1",
51
51
  "@types/node": "^14.6.0",
@@ -1,4 +1,4 @@
1
- use dpp::dashcore::anyhow::anyhow;
1
+ use anyhow::anyhow;
2
2
  use dpp::{BlsModule, PublicKeyValidationError};
3
3
  use wasm_bindgen::prelude::*;
4
4
  use wasm_bindgen::JsCast;
@@ -25,13 +25,13 @@ impl IdentityAssetLockProofLockedTransactionMismatchErrorWasm {
25
25
  #[wasm_bindgen(js_name=getInstantLockTransactionId)]
26
26
  pub fn instant_lock_transaction_id(&self) -> Buffer {
27
27
  let tx_id = self.inner.instant_lock_transaction_id();
28
- Buffer::from_bytes(&tx_id)
28
+ Buffer::from_bytes(&tx_id.to_byte_array())
29
29
  }
30
30
 
31
31
  #[wasm_bindgen(js_name=getAssetLockTransactionId)]
32
32
  pub fn asset_lock_transaction_id(&self) -> Buffer {
33
33
  let tx_id = self.inner.asset_lock_transaction_id();
34
- let mut hash_bytes = tx_id.as_hash().into_inner();
34
+ let mut hash_bytes = tx_id.to_byte_array();
35
35
  hash_bytes.reverse();
36
36
 
37
37
  Buffer::from_bytes(&hash_bytes)
@@ -30,7 +30,7 @@ impl IdentityAssetLockTransactionOutPointAlreadyExistsErrorWasm {
30
30
  #[wasm_bindgen(js_name=getTransactionId)]
31
31
  pub fn transaction_id(&self) -> Buffer {
32
32
  let tx_id = self.inner.transaction_id();
33
- let mut tx_id_bytes = tx_id.as_hash().into_inner();
33
+ let mut tx_id_bytes = tx_id.to_byte_array();
34
34
  tx_id_bytes.reverse();
35
35
  Buffer::from_bytes(&tx_id_bytes)
36
36
  }
@@ -23,7 +23,7 @@ impl InvalidIdentityAssetLockProofChainLockValidationErrorWasm {
23
23
  #[wasm_bindgen(js_name=getTransactionId)]
24
24
  pub fn transaction_id(&self) -> Buffer {
25
25
  let tx_id = self.inner.transaction_id();
26
- let mut tx_id_bytes = tx_id.as_hash().into_inner();
26
+ let mut tx_id_bytes = tx_id.to_byte_array();
27
27
  tx_id_bytes.reverse();
28
28
  Buffer::from_bytes(&tx_id_bytes)
29
29
  }
@@ -1,4 +1,3 @@
1
- use dpp::dashcore::hashes::hex::ToHex;
2
1
  use dpp::identity::errors::AssetLockTransactionIsNotFoundError;
3
2
  use wasm_bindgen::prelude::*;
4
3
 
@@ -15,6 +14,6 @@ impl From<&AssetLockTransactionIsNotFoundError> for AssetLockTransactionIsNotFou
15
14
  impl AssetLockTransactionIsNotFoundErrorWasm {
16
15
  #[wasm_bindgen(js_name=getTransactionId)]
17
16
  pub fn transaction_id(&self) -> JsValue {
18
- self.0.transaction_id().to_hex().into()
17
+ hex::encode(self.0.transaction_id()).into()
19
18
  }
20
19
  }
@@ -1,4 +1,3 @@
1
- use dpp::dashcore::anyhow;
2
1
  use js_sys::Reflect::delete_property;
3
2
  pub use serde::{Deserialize, Serialize};
4
3
  use serde_json::Value as JsonValue;
@@ -1,5 +1,5 @@
1
1
  use dpp::dashcore::{
2
- blockdata::{script::Script, transaction::txout::TxOut},
2
+ blockdata::{script::ScriptBuf, transaction::txout::TxOut},
3
3
  consensus::encode::serialize,
4
4
  };
5
5
 
@@ -26,7 +26,7 @@ struct TxOutJS {
26
26
  #[serde(rename = "satoshis")]
27
27
  value: u64,
28
28
  #[serde(rename = "script")]
29
- script_pubkey: Script,
29
+ script_pubkey: ScriptBuf,
30
30
  }
31
31
 
32
32
  #[derive(Serialize)]
@@ -1,5 +1,4 @@
1
1
  //todo: move this file to transition
2
- use dpp::dashcore::anyhow;
3
2
  use dpp::platform_value::{BinaryData, ReplacementType, Value};
4
3
  use dpp::serialization::ValueConvertible;
5
4
  use dpp::state_transition::public_key_in_creation::accessors::{
package/src/utils.rs CHANGED
@@ -1,12 +1,8 @@
1
1
  use std::collections::BTreeMap;
2
2
  use std::convert::TryInto;
3
3
 
4
- use anyhow::{anyhow, bail};
5
- use dpp::{
6
- consensus::ConsensusError,
7
- dashcore::{anyhow, anyhow::Context},
8
- ProtocolError,
9
- };
4
+ use anyhow::{anyhow, bail, Context};
5
+ use dpp::{consensus::ConsensusError, ProtocolError};
10
6
 
11
7
  use dpp::platform_value::Value;
12
8
  use dpp::serialization::PlatformDeserializable;