@dashevo/wasm-dpp 0.25.0-dev.11 → 0.25.0-dev.13
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/Cargo.toml +6 -5
- package/dist/wasm/wasm_dpp.d.ts +685 -639
- package/dist/wasm/wasm_dpp.js +64 -50
- package/dist/wasm/wasm_dpp_bg.js +1 -1
- package/lib/test/fixtures/getIdentityCreateTransitionFixture.js +2 -2
- package/lib/test/fixtures/js/generateRandomIdentifier.js +1 -0
- package/lib/test/fixtures/js/getChainAssetLockProofFixture.js +1 -0
- package/lib/test/fixtures/js/getDataContractFixture.js +1 -0
- package/lib/test/fixtures/js/getDocumentTransitionsFixture.js +1 -0
- package/lib/test/fixtures/js/getDocumentsFixture.js +1 -0
- package/lib/test/fixtures/js/getInstantAssetLockProofFixture.js +1 -0
- package/lib/test/mocks/createStateRepositoryMock.js +1 -0
- package/lib/wasm/wasm_dpp.d.ts +685 -639
- package/package.json +4 -4
- package/scripts/build-wasm.sh +26 -29
- package/src/data_contract/data_contract.rs +99 -54
- package/src/data_contract/data_contract_facade.rs +5 -2
- package/src/data_contract/state_transition/data_contract_update_transition/mod.rs +0 -5
- package/src/data_contract_factory/data_contract_factory.rs +5 -1
- package/src/document/mod.rs +4 -4
- package/src/errors/consensus/consensus_error.rs +5 -0
- package/src/errors/consensus/state/document/document_timestamps_are_equal_error.rs +42 -0
- package/src/errors/consensus/state/document/mod.rs +2 -0
- package/src/errors/value_error.rs +5 -0
- package/src/identity/identity_public_key/mod.rs +1 -1
- package/src/identity/mod.rs +8 -1
- package/src/identity/state_transition/mod.rs +1 -0
- package/src/identity/state_transition/transition_types.rs +30 -0
- package/src/lib.rs +1 -2
- package/src/protocol_version.rs +7 -0
- package/src/state_transition/errors/invalid_state_transition_error.rs +14 -1
- package/src/state_transition/state_transition_facade.rs +6 -1
- package/test/integration/dataContract/stateTransition/DataContractCreateTransition/validation/basic/validateDataContractCreateTransitionBasicFactory.spec.js +5 -5
- package/test/integration/dataContract/stateTransition/DataContractUpdateTransition/validation/basic/validateDataContractUpdateTransitionBasicFactory.spec.js +5 -5
- package/test/integration/dataContract/validation/validateDataContractFactory.spec.js +2 -2
- package/test/integration/document/DocumentFacade.spec.js +4 -4
- package/test/integration/document/stateTransition/DocumentsBatchTransition/DocumentBatchTransition.spec.js +5 -6
- package/test/integration/document/stateTransition/DocumentsBatchTransition/validation/basic/validateDocumentsBatchTransitionBasicFactory.spec.js +14 -14
- package/test/integration/document/stateTransition/DocumentsBatchTransition/validation/state/executeDataTriggersFactory.spec.js +1 -1
- package/test/integration/document/validation/validateDocumentFactory.spec.js +2 -2
- package/test/integration/identity/IdentityFacade.spec.js +8 -8
- package/test/integration/identity/stateTransition/IdentityCreateTransition/validation/basic/validateIdentityCreateTransitionBasicFactory.spec.js +4 -6
- package/test/integration/identity/stateTransition/IdentityTopUpTransition/validation/basic/validateIdentityTopUpTransitionBasicFactory.spec.js +3 -6
- package/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validateIdentityUpdateTransitionStateFactory.spec.js +20 -23
- package/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validatePublicKeysState.spec.js +1 -1
- package/test/integration/identity/stateTransition/assetLockProof/chain/validateChainAssetLockProofStructureFactory.spec.js +3 -3
- package/test/integration/identity/stateTransition/assetLockProof/fetchAssetLockTransactionOutputFactory.spec.js +5 -8
- package/test/integration/identity/stateTransition/assetLockProof/instant/validateInstantAssetLockProofStructureFactory.spec.js +3 -4
- package/test/integration/identity/stateTransition/assetLockProof/validateAssetLockTransactionFactory.spec.js +2 -3
- package/test/integration/identity/stateTransition/validatePublicKeySignaturesFactory.spec.js +2 -6
- package/test/integration/identity/validation/validateIdentityFactory.spec.js +6 -5
- package/test/integration/identity/validation/validatePublicKeysFactory.spec.js +4 -24
- package/test/integration/stateTransition/StateTransitionFacade.spec.js +11 -15
- package/test/unit/DashPlatformProtocol.spec.js +6 -7
- package/test/unit/dataContract/DataContract.spec.js +9 -9
- package/test/unit/dataContract/DataContractFactory.spec.js +3 -3
- package/test/unit/dataContract/createDataContract.spec.js +5 -5
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/DataContractCreateTransition.spec.js +14 -14
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/applyDataContractCreateTransitionFactory.spec.js +6 -8
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/validation/state/validateDataContractCreateTransitionStateFactory.spec.js +3 -3
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/DataContractUpdateTransition.spec.js +14 -12
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/applyDataContractUpdateTransitionFactory.spec.js +6 -6
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/validation/basic/validateIndicesAreBackwardCompatible.spec.js +4 -4
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/validation/state/validateDataContractUpdateTransitionStateFactory.spec.js +5 -5
- package/test/unit/dataContract/validation/validateDataContractPatterns.spec.js +6 -6
- package/test/unit/document/Document.spec.js +5 -4
- package/test/unit/document/stateTransition/DocumetsBatchTransition/applyDocumentsBatchTransitionFactory.spec.js +10 -11
- package/test/unit/document/stateTransition/DocumetsBatchTransition/validation/state/validateDocumentsBatchTransitionStateFactory.spec.js +8 -8
- package/test/unit/identity/Identity.spec.js +14 -6
- package/test/unit/identity/IdentityFactory.spec.js +11 -11
- package/test/unit/identity/IdentityPublicKey.spec.js +2 -2
- package/test/unit/identity/stateTransition/IdentityCreateTransition/IdentityCreateTransition.spec.js +13 -14
- package/test/unit/identity/stateTransition/IdentityCreateTransition/applyIdentityCreateTransitionFactory.spec.js +7 -13
- package/test/unit/identity/stateTransition/IdentityCreateTransition/validation/state/validateIdentityCreateTransitionStateFactory.spec.js +3 -7
- package/test/unit/identity/stateTransition/IdentityTopUpTransition/IdentityTopUpTransition.spec.js +13 -14
- package/test/unit/identity/stateTransition/IdentityTopUpTransition/applyIdentityTopUpTransitionFactory.spec.js +5 -9
- package/test/unit/identity/stateTransition/IdentityTopUpTransition/validation/state/validateIdentityTopUpTransitionStateFactory.spec.js +4 -8
- package/test/unit/identity/stateTransition/IdentityUpdateTransition/IdentityUpdateTransition.spec.js +11 -16
- package/test/unit/identity/stateTransition/IdentityUpdateTransition/applyIdentityUpdateTransitionFactory.spec.js +1 -1
- package/test/unit/stateTransition/StateTransitionFactory.spec.js +6 -7
- package/test/unit/stateTransition/createStateTransitionFactory.spec.js +41 -19
- package/test/unit/stateTransition/validation/validateStateTransitionKeySignatureFactory.spec.js +6 -12
- package/src/decode_protocol_entity.rs +0 -25
- package/test/integration/ajv/keywords/byteArray/addByteArrayKeyword.spec.js +0 -148
- package/test/integration/util/generateEntropy.spec.js +0 -17
- package/test/integration/util/serializer.spec.js +0 -24
- package/test/unit/decodeProtocolEntityFactory.spec.js +0 -72
- package/test/unit/identity/errors/InvalidIdentityError.spec.js +0 -46
- package/test/unit/stateTransition/errors/InvalidStateTransitionError.spec.js +0 -51
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
use dpp::state_transition::StateTransitionType;
|
|
2
|
+
use wasm_bindgen::prelude::*;
|
|
3
|
+
|
|
4
|
+
#[wasm_bindgen(js_name=StateTransitionTypes)]
|
|
5
|
+
#[allow(non_camel_case_types)]
|
|
6
|
+
pub enum StateTransitionTypeWasm {
|
|
7
|
+
DataContractCreate = 0,
|
|
8
|
+
DocumentsBatch = 1,
|
|
9
|
+
IdentityCreate = 2,
|
|
10
|
+
IdentityTopUp = 3,
|
|
11
|
+
DataContractUpdate = 4,
|
|
12
|
+
IdentityUpdate = 5,
|
|
13
|
+
IdentityCreditWithdrawal = 6,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
impl From<StateTransitionType> for StateTransitionTypeWasm {
|
|
17
|
+
fn from(state_transition_type: StateTransitionType) -> Self {
|
|
18
|
+
match state_transition_type {
|
|
19
|
+
StateTransitionType::DataContractCreate => StateTransitionTypeWasm::DataContractCreate,
|
|
20
|
+
StateTransitionType::DocumentsBatch => StateTransitionTypeWasm::DocumentsBatch,
|
|
21
|
+
StateTransitionType::IdentityCreate => StateTransitionTypeWasm::IdentityCreate,
|
|
22
|
+
StateTransitionType::IdentityTopUp => StateTransitionTypeWasm::IdentityTopUp,
|
|
23
|
+
StateTransitionType::DataContractUpdate => StateTransitionTypeWasm::DataContractUpdate,
|
|
24
|
+
StateTransitionType::IdentityUpdate => StateTransitionTypeWasm::IdentityUpdate,
|
|
25
|
+
StateTransitionType::IdentityCreditWithdrawal => {
|
|
26
|
+
StateTransitionTypeWasm::IdentityCreditWithdrawal
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
package/src/lib.rs
CHANGED
|
@@ -4,7 +4,6 @@ pub use dash_platform_protocol::*;
|
|
|
4
4
|
pub use data_contract::*;
|
|
5
5
|
pub use data_contract_factory::*;
|
|
6
6
|
pub use data_trigger::*;
|
|
7
|
-
pub use decode_protocol_entity::decode_protocol_entity;
|
|
8
7
|
pub use document::*;
|
|
9
8
|
pub use identity::*;
|
|
10
9
|
pub use metadata::*;
|
|
@@ -27,8 +26,8 @@ mod utils;
|
|
|
27
26
|
|
|
28
27
|
mod bls_adapter;
|
|
29
28
|
mod buffer;
|
|
30
|
-
mod decode_protocol_entity;
|
|
31
29
|
mod entropy_generator;
|
|
32
30
|
mod generate_temporary_ecdsa_private_key;
|
|
33
31
|
mod lodash;
|
|
32
|
+
mod protocol_version;
|
|
34
33
|
mod validation;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
use dpp::consensus::ConsensusError;
|
|
2
|
-
use
|
|
2
|
+
use serde::Serialize;
|
|
3
|
+
|
|
4
|
+
use wasm_bindgen::{prelude::wasm_bindgen, JsError, JsValue};
|
|
3
5
|
|
|
4
6
|
use crate::{
|
|
5
7
|
buffer::Buffer, errors::consensus::consensus_error::from_consensus_error_ref,
|
|
@@ -45,4 +47,15 @@ impl InvalidStateTransitionErrorWasm {
|
|
|
45
47
|
pub fn get_raw_state_transition(&self) -> JsValue {
|
|
46
48
|
self.raw_state_transition.clone()
|
|
47
49
|
}
|
|
50
|
+
|
|
51
|
+
#[wasm_bindgen(js_name = valueOf)]
|
|
52
|
+
pub fn value_of(&self) -> Result<JsValue, JsError> {
|
|
53
|
+
let errors = serde_json::to_value(&self.errors)
|
|
54
|
+
.map_err(|_| JsError::new("Can't serialize consensus errors to json"))?;
|
|
55
|
+
let ser = serde_wasm_bindgen::Serializer::json_compatible();
|
|
56
|
+
let val = errors
|
|
57
|
+
.serialize(&ser)
|
|
58
|
+
.map_err(|_| JsError::new("Can't serialize consensus errors to json"));
|
|
59
|
+
val
|
|
60
|
+
}
|
|
48
61
|
}
|
|
@@ -13,10 +13,13 @@ use dpp::state_transition::{
|
|
|
13
13
|
use dpp::version::ProtocolVersionValidator;
|
|
14
14
|
use serde::Deserialize;
|
|
15
15
|
|
|
16
|
+
use crate::errors::consensus::basic::state_transition::InvalidStateTransitionTypeErrorWasm;
|
|
16
17
|
use crate::errors::protocol_error::from_protocol_error;
|
|
17
18
|
use crate::errors::value_error::PlatformValueErrorWasm;
|
|
19
|
+
|
|
18
20
|
use dpp::data_contract::state_transition::data_contract_update_transition::DataContractUpdateTransition;
|
|
19
21
|
|
|
22
|
+
use num_enum::TryFromPrimitiveError;
|
|
20
23
|
use std::sync::Arc;
|
|
21
24
|
use wasm_bindgen::prelude::*;
|
|
22
25
|
use wasm_bindgen::JsValue;
|
|
@@ -65,7 +68,9 @@ impl StateTransitionFacadeWasm {
|
|
|
65
68
|
.get_integer::<u8>("type")
|
|
66
69
|
.map_err(PlatformValueErrorWasm::from)?
|
|
67
70
|
.try_into()
|
|
68
|
-
.map_err(|
|
|
71
|
+
.map_err(|e: TryFromPrimitiveError<StateTransitionType>| {
|
|
72
|
+
InvalidStateTransitionTypeErrorWasm::new(e.number as u8)
|
|
73
|
+
})?;
|
|
69
74
|
|
|
70
75
|
if state_transition_type == StateTransitionType::DataContractUpdate {
|
|
71
76
|
DataContractUpdateTransition::clean_value(&mut raw_state_transition)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const crypto = require('crypto');
|
|
2
|
-
const protocolVersion = require('@dashevo/dpp/lib/version/protocolVersion');
|
|
3
2
|
|
|
4
|
-
const getDataContractFixture = require('
|
|
3
|
+
const getDataContractFixture = require('../../../../../../../lib/test/fixtures/getDataContractFixture');
|
|
5
4
|
const { expectJsonSchemaError, expectValidationError, expectValueError } = require('../../../../../../../lib/test/expect/expectError');
|
|
6
5
|
|
|
7
|
-
const { default: loadWasmDpp } = require('
|
|
6
|
+
const { default: loadWasmDpp } = require('../../../../../../..');
|
|
7
|
+
const { getLatestProtocolVersion } = require('../../../../../../..');
|
|
8
8
|
|
|
9
9
|
describe('validateDataContractCreateTransitionBasicFactory', () => {
|
|
10
10
|
let stateTransition;
|
|
@@ -29,11 +29,11 @@ describe('validateDataContractCreateTransitionBasicFactory', () => {
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
beforeEach(async () => {
|
|
32
|
-
dataContract = getDataContractFixture();
|
|
32
|
+
dataContract = await getDataContractFixture();
|
|
33
33
|
rawDataContract = dataContract.toObject();
|
|
34
34
|
|
|
35
35
|
stateTransition = new DataContractCreateTransition({
|
|
36
|
-
protocolVersion:
|
|
36
|
+
protocolVersion: getLatestProtocolVersion(),
|
|
37
37
|
dataContract: rawDataContract,
|
|
38
38
|
entropy: dataContract.getEntropy(),
|
|
39
39
|
signature: Buffer.alloc(65),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
const createStateRepositoryMock = require('@dashevo/dpp/lib/test/mocks/createStateRepositoryMock');
|
|
1
|
+
const createStateRepositoryMock = require('../../../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
3
2
|
const getDataContractFixture = require('../../../../../../../lib/test/fixtures/getDataContractFixture');
|
|
4
3
|
const { expectJsonSchemaError, expectValidationError, expectValueError } = require('../../../../../../../lib/test/expect/expectError');
|
|
5
4
|
|
|
6
|
-
const { default: loadWasmDpp } = require('
|
|
5
|
+
const { default: loadWasmDpp } = require('../../../../../../..');
|
|
6
|
+
const { getLatestProtocolVersion } = require('../../../../../../..');
|
|
7
7
|
|
|
8
8
|
describe('validateDataContractUpdateTransitionBasicFactory', () => {
|
|
9
9
|
let DataContractUpdateTransition;
|
|
@@ -45,7 +45,7 @@ describe('validateDataContractUpdateTransitionBasicFactory', () => {
|
|
|
45
45
|
rawDataContract.version += 1;
|
|
46
46
|
|
|
47
47
|
stateTransition = new DataContractUpdateTransition({
|
|
48
|
-
protocolVersion:
|
|
48
|
+
protocolVersion: getLatestProtocolVersion(),
|
|
49
49
|
dataContract: rawDataContract,
|
|
50
50
|
signature: Buffer.alloc(65),
|
|
51
51
|
signaturePublicKeyId: 0,
|
|
@@ -54,7 +54,7 @@ describe('validateDataContractUpdateTransitionBasicFactory', () => {
|
|
|
54
54
|
rawStateTransition = stateTransition.toObject();
|
|
55
55
|
|
|
56
56
|
const validator = new DataContractValidator();
|
|
57
|
-
const dataContractFactory = new DataContractFactory(
|
|
57
|
+
const dataContractFactory = new DataContractFactory(getLatestProtocolVersion(), validator);
|
|
58
58
|
const reCreatedDataContract = await dataContractFactory
|
|
59
59
|
.createFromBuffer(dataContract.toBuffer());
|
|
60
60
|
stateRepositoryMock = createStateRepositoryMock(this.sinonSandbox);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const lodashCloneDeep = require('lodash/cloneDeep');
|
|
2
|
-
const getDataContractFixture = require('
|
|
2
|
+
const getDataContractFixture = require('../../../../lib/test/fixtures/getDataContractFixture');
|
|
3
3
|
const { expectJsonSchemaError, expectValidationError } = require('../../../../lib/test/expect/expectError');
|
|
4
4
|
|
|
5
5
|
const { default: loadWasmDpp } = require('../../../../dist');
|
|
@@ -37,7 +37,7 @@ describe('validateDataContractFactory', () => {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
beforeEach(async () => {
|
|
40
|
-
dataContract = getDataContractFixture();
|
|
40
|
+
dataContract = await getDataContractFixture();
|
|
41
41
|
|
|
42
42
|
const dataContractValidator = new DataContractValidator();
|
|
43
43
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const crypto = require('crypto');
|
|
2
|
-
const generateRandomIdentifier = require('
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
2
|
+
const generateRandomIdentifier = require('../../../lib/test/fixtures/js/generateRandomIdentifier');
|
|
3
|
+
const getDataContractFixture = require('../../../lib/test/fixtures/js/getDataContractFixture');
|
|
4
|
+
const getDocumentsFixture = require('../../../lib/test/fixtures/js/getDocumentsFixture');
|
|
5
|
+
const createStateRepositoryMock = require('../../../lib/test/mocks/createStateRepositoryMock');
|
|
6
6
|
const getDocumentTransitionsFixture = require('../../../lib/test/fixtures/getDocumentTransitionsFixture');
|
|
7
7
|
|
|
8
8
|
const { default: loadWasmDpp } = require('../../../dist');
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const createStateRepositoryMock = require('../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
2
|
+
const getDataContractFixture = require('../../../../../lib/test/fixtures/js/getDataContractFixture');
|
|
3
|
+
const getDocumentsFixture = require('../../../../../lib/test/fixtures/js/getDocumentsFixture');
|
|
2
4
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const getDocumentsFixture = require('@dashevo/dpp/lib/test/fixtures/getDocumentsFixture');
|
|
6
|
-
|
|
7
|
-
const { default: loadWasmDpp } = require('../../../../../dist');
|
|
5
|
+
const { default: loadWasmDpp } = require('../../../../..');
|
|
6
|
+
const { IdentityPublicKey } = require('../../../../..');
|
|
8
7
|
|
|
9
8
|
let ExtendedDocument;
|
|
10
9
|
let DataContract;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const { default: loadWasmDpp } = require('../../../../../../../dist');
|
|
1
|
+
const getDocumentTransitionsFixture = require('../../../../../../../lib/test/fixtures/getDocumentTransitionsFixture');
|
|
2
|
+
const getDocumentsFixture = require('../../../../../../../lib/test/fixtures/js/getDocumentsFixture');
|
|
3
|
+
const getDataContractFixture = require('../../../../../../../lib/test/fixtures/js/getDataContractFixture');
|
|
4
|
+
const createStateRepositoryMock = require('../../../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
5
|
+
|
|
6
|
+
const { default: loadWasmDpp } = require('../../../../../../..');
|
|
7
|
+
const { getLatestProtocolVersion } = require('../../../../../../..');
|
|
9
8
|
const { expectJsonSchemaError, expectValidationError, expectValueError } = require('../../../../../../../lib/test/expect/expectError');
|
|
9
|
+
const generateRandomIdentifierAsync = require('../../../../../../../lib/test/utils/generateRandomIdentifierAsync');
|
|
10
10
|
|
|
11
11
|
let DataContract;
|
|
12
12
|
let DocumentsBatchTransition;
|
|
@@ -71,7 +71,7 @@ describe('validateDocumentsBatchTransitionBasicFactory', () => {
|
|
|
71
71
|
executionContext = new StateTransitionExecutionContext();
|
|
72
72
|
|
|
73
73
|
stateTransition = new DocumentsBatchTransition({
|
|
74
|
-
protocolVersion:
|
|
74
|
+
protocolVersion: getLatestProtocolVersion(),
|
|
75
75
|
ownerId,
|
|
76
76
|
contractId: dataContract.getId(),
|
|
77
77
|
transitions: documentTransitions.map((t) => t.toObject()),
|
|
@@ -425,7 +425,7 @@ describe('validateDocumentsBatchTransitionBasicFactory', () => {
|
|
|
425
425
|
const [documentTransition] = documentTransitions.map((t) => t.toObject());
|
|
426
426
|
|
|
427
427
|
stateTransition = new DocumentsBatchTransition({
|
|
428
|
-
protocolVersion:
|
|
428
|
+
protocolVersion: getLatestProtocolVersion(),
|
|
429
429
|
ownerId,
|
|
430
430
|
contractId: dataContract.getId(),
|
|
431
431
|
transitions: [documentTransition, documentTransition],
|
|
@@ -627,7 +627,7 @@ describe('validateDocumentsBatchTransitionBasicFactory', () => {
|
|
|
627
627
|
const [firstTransition] = rawStateTransition.transitions;
|
|
628
628
|
|
|
629
629
|
const expectedId = firstTransition.$id;
|
|
630
|
-
firstTransition.$id =
|
|
630
|
+
firstTransition.$id = (await generateRandomIdentifierAsync()).toBuffer();
|
|
631
631
|
|
|
632
632
|
const result = await validateDocumentsBatchTransitionBasic(
|
|
633
633
|
protocolVersionValidator,
|
|
@@ -745,7 +745,7 @@ describe('validateDocumentsBatchTransitionBasicFactory', () => {
|
|
|
745
745
|
});
|
|
746
746
|
|
|
747
747
|
stateTransition = new DocumentsBatchTransition({
|
|
748
|
-
protocolVersion:
|
|
748
|
+
protocolVersion: getLatestProtocolVersion(),
|
|
749
749
|
ownerId,
|
|
750
750
|
contractId: dataContract.getId(),
|
|
751
751
|
transitions: documentTransitions.map((t) => t.toObject()),
|
|
@@ -848,7 +848,7 @@ describe('validateDocumentsBatchTransitionBasicFactory', () => {
|
|
|
848
848
|
});
|
|
849
849
|
|
|
850
850
|
stateTransition = new DocumentsBatchTransition({
|
|
851
|
-
protocolVersion:
|
|
851
|
+
protocolVersion: getLatestProtocolVersion(),
|
|
852
852
|
ownerId,
|
|
853
853
|
contractId: dataContract.getId(),
|
|
854
854
|
transitions: documentTransitions.map((t) => t.toObject()),
|
|
@@ -895,7 +895,7 @@ describe('validateDocumentsBatchTransitionBasicFactory', () => {
|
|
|
895
895
|
const duplicates = [duplicatedTransition, indexedTransition];
|
|
896
896
|
|
|
897
897
|
stateTransition = new DocumentsBatchTransition({
|
|
898
|
-
protocolVersion:
|
|
898
|
+
protocolVersion: getLatestProtocolVersion(),
|
|
899
899
|
ownerId,
|
|
900
900
|
contractId: dataContract.getId(),
|
|
901
901
|
transitions: duplicates,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const createStateRepositoryMock = require('@dashevo/dpp/lib/test/mocks/createStateRepositoryMock');
|
|
2
1
|
const dpnsSystemIds = require('@dashevo/dpns-contract/lib/systemIds');
|
|
3
2
|
const getDpnsContractFixture = require('@dashevo/dpp/lib/test/fixtures/getDpnsContractFixture');
|
|
4
3
|
const dpnsDocumentFixture = require('@dashevo/dpp/lib/test/fixtures/getDpnsDocumentFixture');
|
|
@@ -7,6 +6,7 @@ const getDocumentTransitionsFixture = require('@dashevo/dpp/lib/test/fixtures/ge
|
|
|
7
6
|
const getDataContractFixture = require('@dashevo/dpp/lib/test/fixtures/getDataContractFixture');
|
|
8
7
|
|
|
9
8
|
const IdentifierJs = require('@dashevo/dpp/lib/identifier/Identifier');
|
|
9
|
+
const createStateRepositoryMock = require('../../../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
10
10
|
|
|
11
11
|
const { default: loadWasmDpp } = require('../../../../../../../dist');
|
|
12
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const getDataContractFixture = require('
|
|
2
|
-
const getDocumentsFixture = require('
|
|
1
|
+
const getDataContractFixture = require('../../../../lib/test/fixtures/js/getDataContractFixture');
|
|
2
|
+
const getDocumentsFixture = require('../../../../lib/test/fixtures/js/getDocumentsFixture');
|
|
3
3
|
|
|
4
4
|
const { expectJsonSchemaError, expectValidationError } = require('../../../../lib/test/expect/expectError');
|
|
5
5
|
const { default: loadWasmDpp } = require('../../../../dist');
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const crypto = require('crypto');
|
|
2
|
-
const getIdentityFixture = require('
|
|
2
|
+
const getIdentityFixture = require('../../../lib/test/fixtures/getIdentityFixture');
|
|
3
3
|
|
|
4
|
-
const createStateRepositoryMock = require('
|
|
5
|
-
const getInstantAssetLockProofFixture = require('
|
|
6
|
-
const getChainAssetLockProofFixture = require('
|
|
7
|
-
const IdentityPublicKey = require('@dashevo/dpp/lib/identity/IdentityPublicKey');
|
|
4
|
+
const createStateRepositoryMock = require('../../../lib/test/mocks/createStateRepositoryMock');
|
|
5
|
+
const getInstantAssetLockProofFixture = require('../../../lib/test/fixtures/getInstantAssetLockProofFixture');
|
|
6
|
+
const getChainAssetLockProofFixture = require('../../../lib/test/fixtures/getChainAssetLockProofFixture');
|
|
8
7
|
const getBlsAdapterMock = require('../../../lib/test/mocks/getBlsAdapterMock');
|
|
9
8
|
|
|
10
|
-
const { default: loadWasmDpp } = require('
|
|
9
|
+
const { default: loadWasmDpp } = require('../../..');
|
|
10
|
+
const { IdentityPublicKey } = require('../../..');
|
|
11
11
|
|
|
12
12
|
describe('IdentityFacade', () => {
|
|
13
13
|
let dpp;
|
|
@@ -52,11 +52,11 @@ describe('IdentityFacade', () => {
|
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
const chainAssetLockProofJS = getChainAssetLockProofFixture();
|
|
55
|
-
const instantAssetLockProofJS = getInstantAssetLockProofFixture();
|
|
55
|
+
const instantAssetLockProofJS = await getInstantAssetLockProofFixture();
|
|
56
56
|
instantAssetLockProof = new InstantAssetLockProof(instantAssetLockProofJS.toObject());
|
|
57
57
|
chainAssetLockProof = new ChainAssetLockProof(chainAssetLockProofJS.toObject());
|
|
58
58
|
|
|
59
|
-
const identityObject = getIdentityFixture().toObject();
|
|
59
|
+
const identityObject = (await getIdentityFixture()).toObject();
|
|
60
60
|
identityObject.id = instantAssetLockProof.createIdentifier();
|
|
61
61
|
identity = new Identity(identityObject);
|
|
62
62
|
identity.setAssetLockProof(instantAssetLockProof);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { PrivateKey } = require('@dashevo/dashcore-lib');
|
|
2
2
|
|
|
3
|
-
const createStateRepositoryMock = require('
|
|
4
|
-
const getIdentityCreateTransitionFixture = require('
|
|
3
|
+
const createStateRepositoryMock = require('../../../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
4
|
+
const getIdentityCreateTransitionFixture = require('../../../../../../../lib/test/fixtures/getIdentityCreateTransitionFixture');
|
|
5
5
|
|
|
6
6
|
const { expectValidationError, expectJsonSchemaError } = require('../../../../../../../lib/test/expect/expectError');
|
|
7
7
|
const { default: loadWasmDpp } = require('../../../../../../../dist');
|
|
@@ -18,7 +18,6 @@ describe('validateIdentityCreateTransitionBasicFactory', () => {
|
|
|
18
18
|
let validateIdentityCreateTransitionBasic;
|
|
19
19
|
|
|
20
20
|
let StateTransitionExecutionContext;
|
|
21
|
-
let IdentityCreateTransition;
|
|
22
21
|
let IdentityPublicKey;
|
|
23
22
|
let UnsupportedProtocolVersionError;
|
|
24
23
|
let InvalidInstantAssetLockProofSignatureError;
|
|
@@ -30,7 +29,6 @@ describe('validateIdentityCreateTransitionBasicFactory', () => {
|
|
|
30
29
|
|
|
31
30
|
before(async () => {
|
|
32
31
|
({
|
|
33
|
-
IdentityCreateTransition,
|
|
34
32
|
StateTransitionExecutionContext,
|
|
35
33
|
UnsupportedProtocolVersionError,
|
|
36
34
|
InvalidInstantAssetLockProofSignatureError,
|
|
@@ -57,6 +55,7 @@ describe('validateIdentityCreateTransitionBasicFactory', () => {
|
|
|
57
55
|
});
|
|
58
56
|
|
|
59
57
|
beforeEach(async function () {
|
|
58
|
+
this.timeout(20000);
|
|
60
59
|
stateRepositoryMock = createStateRepositoryMock(this.sinonSandbox);
|
|
61
60
|
stateRepositoryMock.verifyInstantLock.resolves(true);
|
|
62
61
|
stateRepositoryMock.isAssetLockTransactionOutPointAlreadyUsed.resolves(false);
|
|
@@ -68,8 +67,7 @@ describe('validateIdentityCreateTransitionBasicFactory', () => {
|
|
|
68
67
|
const validator = new IdentityCreateTransitionBasicValidator(stateRepositoryMock, blsAdapter);
|
|
69
68
|
validateIdentityCreateTransitionBasic = (st, context) => validator.validate(st, context);
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
stateTransition = new IdentityCreateTransition(stateTransitionJS.toObject());
|
|
70
|
+
stateTransition = await getIdentityCreateTransitionFixture();
|
|
73
71
|
|
|
74
72
|
const privateKey = new PrivateKey('9b67f852093bc61cea0eeca38599dbfba0de28574d2ed9b99d10d33dc1bde7b2');
|
|
75
73
|
const publicKey = privateKey.toPublicKey();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const createStateRepositoryMock = require('
|
|
2
|
-
const getIdentityTopUpTransitionFixture = require('../../../../../../../lib/test/fixtures/
|
|
1
|
+
const createStateRepositoryMock = require('../../../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
2
|
+
const getIdentityTopUpTransitionFixture = require('../../../../../../../lib/test/fixtures/getIdentityTopUpTransitionFixture');
|
|
3
3
|
|
|
4
4
|
const {
|
|
5
5
|
expectJsonSchemaError,
|
|
@@ -17,7 +17,6 @@ describe('validateIdentityTopUpTransitionBasicFactory', () => {
|
|
|
17
17
|
let validateIdentityTopUpTransitionBasic;
|
|
18
18
|
|
|
19
19
|
let StateTransitionExecutionContext;
|
|
20
|
-
let IdentityTopUpTransition;
|
|
21
20
|
let IdentityPublicKey;
|
|
22
21
|
let UnsupportedProtocolVersionError;
|
|
23
22
|
let InvalidInstantAssetLockProofSignatureError;
|
|
@@ -26,7 +25,6 @@ describe('validateIdentityTopUpTransitionBasicFactory', () => {
|
|
|
26
25
|
before(async () => {
|
|
27
26
|
({
|
|
28
27
|
IdentityTopUpTransitionBasicValidator,
|
|
29
|
-
IdentityTopUpTransition,
|
|
30
28
|
StateTransitionExecutionContext,
|
|
31
29
|
IdentityPublicKey,
|
|
32
30
|
UnsupportedProtocolVersionError,
|
|
@@ -47,8 +45,7 @@ describe('validateIdentityTopUpTransitionBasicFactory', () => {
|
|
|
47
45
|
context,
|
|
48
46
|
);
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
stateTransition = new IdentityTopUpTransition(stateTransitionJS.toObject());
|
|
48
|
+
stateTransition = await getIdentityTopUpTransitionFixture();
|
|
52
49
|
|
|
53
50
|
const privateKey = '9b67f852093bc61cea0eeca38599dbfba0de28574d2ed9b99d10d33dc1bde7b2';
|
|
54
51
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
const identitySchema = require('
|
|
2
|
-
const createStateRepositoryMock = require('
|
|
3
|
-
const getIdentityFixture = require('
|
|
4
|
-
const ValidationResult = require('@dashevo/dpp/lib/validation/ValidationResult');
|
|
5
|
-
const SomeConsensusError = require('@dashevo/dpp/lib/test/mocks/SomeConsensusError');
|
|
1
|
+
const identitySchema = require('../../../../../../../../rs-dpp/src/schema/identity/identity.json');
|
|
2
|
+
const createStateRepositoryMock = require('../../../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
3
|
+
const getIdentityFixture = require('../../../../../../../lib/test/fixtures/getIdentityFixture');
|
|
6
4
|
const getIdentityUpdateTransitionFixture = require('../../../../../../../lib/test/fixtures/getIdentityUpdateTransitionFixture');
|
|
7
5
|
|
|
8
|
-
const { default: loadWasmDpp } = require('
|
|
6
|
+
const { default: loadWasmDpp } = require('../../../../../../..');
|
|
9
7
|
const { expectValidationError } = require('../../../../../../../lib/test/expect/expectError');
|
|
10
8
|
const generateRandomIdentifierAsync = require('../../../../../../../lib/test/utils/generateRandomIdentifierAsync');
|
|
11
9
|
const getBlsAdapterMock = require('../../../../../../../lib/test/mocks/getBlsAdapterMock');
|
|
@@ -16,7 +14,6 @@ describe('validateIdentityUpdateTransitionStateFactory', () => {
|
|
|
16
14
|
let stateTransition;
|
|
17
15
|
let identity;
|
|
18
16
|
let rawIdentity;
|
|
19
|
-
let validatePublicKeysMock;
|
|
20
17
|
let blockTime;
|
|
21
18
|
let executionContext;
|
|
22
19
|
|
|
@@ -49,7 +46,7 @@ describe('validateIdentityUpdateTransitionStateFactory', () => {
|
|
|
49
46
|
});
|
|
50
47
|
|
|
51
48
|
beforeEach(async function beforeEach() {
|
|
52
|
-
rawIdentity = getIdentityFixture().toObject();
|
|
49
|
+
rawIdentity = (await getIdentityFixture()).toObject();
|
|
53
50
|
// Patch identity id to be acceptable by wasm-dpp
|
|
54
51
|
rawIdentity.id = await generateRandomIdentifierAsync();
|
|
55
52
|
identity = new Identity(rawIdentity);
|
|
@@ -248,21 +245,21 @@ describe('validateIdentityUpdateTransitionStateFactory', () => {
|
|
|
248
245
|
// TODO: remove?
|
|
249
246
|
// Skipped, because two tests above are seem to be enough
|
|
250
247
|
it.skip('should validate resulting identity public keys', async () => {
|
|
251
|
-
const publicKeysError = new SomeConsensusError('test');
|
|
252
|
-
|
|
253
|
-
validatePublicKeysMock.returns(new ValidationResult([publicKeysError]));
|
|
254
|
-
|
|
255
|
-
const result = await validateIdentityUpdateTransitionState(stateTransition);
|
|
256
|
-
|
|
257
|
-
expectValidationError(result, SomeConsensusError);
|
|
258
|
-
|
|
259
|
-
expect(validatePublicKeysMock).to.be.calledOnce();
|
|
260
|
-
|
|
261
|
-
const publicKeys = [...identity.getPublicKeys(), ...stateTransition.getPublicKeysToAdd()];
|
|
262
|
-
|
|
263
|
-
expect(validatePublicKeysMock).to.be.calledWithExactly(
|
|
264
|
-
|
|
265
|
-
);
|
|
248
|
+
// const publicKeysError = new SomeConsensusError('test');
|
|
249
|
+
//
|
|
250
|
+
// validatePublicKeysMock.returns(new ValidationResult([publicKeysError]));
|
|
251
|
+
//
|
|
252
|
+
// const result = await validateIdentityUpdateTransitionState(stateTransition);
|
|
253
|
+
//
|
|
254
|
+
// expectValidationError(result, SomeConsensusError);
|
|
255
|
+
//
|
|
256
|
+
// expect(validatePublicKeysMock).to.be.calledOnce();
|
|
257
|
+
//
|
|
258
|
+
// const publicKeys = [...identity.getPublicKeys(), ...stateTransition.getPublicKeysToAdd()];
|
|
259
|
+
//
|
|
260
|
+
// expect(validatePublicKeysMock).to.be.calledWithExactly(
|
|
261
|
+
// publicKeys.map((pk) => pk.toObject()),
|
|
262
|
+
// );
|
|
266
263
|
});
|
|
267
264
|
|
|
268
265
|
it('should return valid result on dry run', async function () {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const identitySchema = require('
|
|
1
|
+
const identitySchema = require('../../../../../../../../rs-dpp/src/schema/identity/identity.json');
|
|
2
2
|
const { expectValidationError } = require('../../../../../../../lib/test/expect/expectError');
|
|
3
3
|
|
|
4
4
|
const { default: loadWasmDpp } = require('../../../../../../../dist');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const { Transaction, Script, PrivateKey } = require('@dashevo/dashcore-lib');
|
|
2
2
|
|
|
3
|
-
const getChainAssetLockFixture = require('@dashevo/dpp/lib/test/fixtures/getChainAssetLockProofFixture');
|
|
4
|
-
const createStateRepositoryMock = require('@dashevo/dpp/lib/test/mocks/createStateRepositoryMock');
|
|
5
|
-
|
|
6
3
|
const { expect } = require('chai');
|
|
4
|
+
const getChainAssetLockFixture = require('../../../../../../lib/test/fixtures/getChainAssetLockProofFixture');
|
|
5
|
+
const createStateRepositoryMock = require('../../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
6
|
+
|
|
7
7
|
const { expectJsonSchemaError, expectValidationError } = require('../../../../../../lib/test/expect/expectError');
|
|
8
8
|
|
|
9
9
|
const { default: loadWasmDpp } = require('../../../../../../dist');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { Transaction } = require('@dashevo/dashcore-lib');
|
|
2
2
|
|
|
3
|
-
const getChainAssetLockFixture = require('
|
|
4
|
-
const getInstantAssetLockProofFixture = require('
|
|
5
|
-
const createStateRepositoryMock = require('
|
|
3
|
+
const getChainAssetLockFixture = require('../../../../../lib/test/fixtures/getChainAssetLockProofFixture');
|
|
4
|
+
const getInstantAssetLockProofFixture = require('../../../../../lib/test/fixtures/getInstantAssetLockProofFixture');
|
|
5
|
+
const createStateRepositoryMock = require('../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
6
6
|
const { default: loadWasmDpp } = require('../../../../../dist');
|
|
7
7
|
|
|
8
8
|
describe('fetchAssetLockTransactionOutputFactory', () => {
|
|
@@ -11,7 +11,6 @@ describe('fetchAssetLockTransactionOutputFactory', () => {
|
|
|
11
11
|
let executionContext;
|
|
12
12
|
|
|
13
13
|
let StateTransitionExecutionContext;
|
|
14
|
-
let InstantAssetLockProof;
|
|
15
14
|
let ChainAssetLockProof;
|
|
16
15
|
let AssetLockTransactionIsNotFoundError;
|
|
17
16
|
let UnknownAssetLockProofTypeError;
|
|
@@ -22,7 +21,6 @@ describe('fetchAssetLockTransactionOutputFactory', () => {
|
|
|
22
21
|
({
|
|
23
22
|
StateTransitionExecutionContext,
|
|
24
23
|
fetchAssetLockTransactionOutput: fetchAssetLockTransactionOutputDPP,
|
|
25
|
-
InstantAssetLockProof,
|
|
26
24
|
ChainAssetLockProof,
|
|
27
25
|
AssetLockTransactionIsNotFoundError,
|
|
28
26
|
UnknownAssetLockProofTypeError,
|
|
@@ -44,9 +42,8 @@ describe('fetchAssetLockTransactionOutputFactory', () => {
|
|
|
44
42
|
describe('InstantAssetLockProof', () => {
|
|
45
43
|
let assetLockProofFixture;
|
|
46
44
|
|
|
47
|
-
beforeEach(() => {
|
|
48
|
-
|
|
49
|
-
assetLockProofFixture = new InstantAssetLockProof(assetLockProofFixtureJS.toObject());
|
|
45
|
+
beforeEach(async () => {
|
|
46
|
+
assetLockProofFixture = await getInstantAssetLockProofFixture();
|
|
50
47
|
});
|
|
51
48
|
|
|
52
49
|
it('should return asset lock output', async () => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
const DashCoreLib = require('@dashevo/dashcore-lib');
|
|
2
|
-
|
|
3
|
-
const getInstantAssetLockFixture = require('@dashevo/dpp/lib/test/fixtures/getInstantAssetLockProofFixture');
|
|
4
|
-
const createStateRepositoryMock = require('@dashevo/dpp/lib/test/mocks/createStateRepositoryMock');
|
|
5
|
-
|
|
6
2
|
const { expect } = require('chai');
|
|
3
|
+
|
|
4
|
+
const getInstantAssetLockFixture = require('../../../../../../lib/test/fixtures/js/getInstantAssetLockProofFixture');
|
|
5
|
+
const createStateRepositoryMock = require('../../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
7
6
|
const { expectJsonSchemaError, expectValidationError } = require('../../../../../../lib/test/expect/expectError');
|
|
8
7
|
|
|
9
8
|
const { default: loadWasmDpp } = require('../../../../../../dist');
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const { Transaction, PrivateKey, Script } = require('@dashevo/dashcore-lib');
|
|
2
|
-
|
|
3
|
-
const createStateRepositoryMock = require('@dashevo/dpp/lib/test/mocks/createStateRepositoryMock');
|
|
4
|
-
|
|
5
2
|
const { expect } = require('chai');
|
|
3
|
+
|
|
4
|
+
const createStateRepositoryMock = require('../../../../../lib/test/mocks/createStateRepositoryMock');
|
|
6
5
|
const { default: loadWasmDpp } = require('../../../../../dist');
|
|
7
6
|
const { expectValidationError } = require('../../../../../lib/test/expect/expectError');
|
|
8
7
|
|
package/test/integration/identity/stateTransition/validatePublicKeySignaturesFactory.spec.js
CHANGED
|
@@ -2,10 +2,10 @@ const { PrivateKey, crypto: { Hash } } = require('@dashevo/dashcore-lib');
|
|
|
2
2
|
|
|
3
3
|
const crypto = require('crypto');
|
|
4
4
|
|
|
5
|
-
const getIdentityCreateTransitionFixture = require('@dashevo/dpp/lib/test/fixtures/getIdentityCreateTransitionFixture');
|
|
6
5
|
const BlsSignatures = require('@dashevo/dpp/lib/bls/bls');
|
|
7
6
|
|
|
8
7
|
const { expect } = require('chai');
|
|
8
|
+
const getIdentityCreateTransitionFixture = require('../../../../lib/test/fixtures/getIdentityCreateTransitionFixture');
|
|
9
9
|
const { expectValidationError } = require('../../../../lib/test/expect/expectError');
|
|
10
10
|
const getBlsAdapterMock = require('../../../../lib/test/mocks/getBlsAdapterMock');
|
|
11
11
|
|
|
@@ -16,7 +16,6 @@ describe('validatePublicKeySignaturesFactory', () => {
|
|
|
16
16
|
let rawIdentityCreateTransition;
|
|
17
17
|
let validatePublicKeySignatures;
|
|
18
18
|
|
|
19
|
-
let IdentityCreateTransition;
|
|
20
19
|
let IdentityPublicKey;
|
|
21
20
|
let IdentityPublicKeyWithWitness;
|
|
22
21
|
let InvalidIdentityKeySignatureError;
|
|
@@ -26,7 +25,6 @@ describe('validatePublicKeySignaturesFactory', () => {
|
|
|
26
25
|
|
|
27
26
|
before(async () => {
|
|
28
27
|
({
|
|
29
|
-
IdentityCreateTransition,
|
|
30
28
|
IdentityPublicKey,
|
|
31
29
|
IdentityPublicKeyWithWitness,
|
|
32
30
|
InvalidIdentityKeySignatureError,
|
|
@@ -36,9 +34,7 @@ describe('validatePublicKeySignaturesFactory', () => {
|
|
|
36
34
|
});
|
|
37
35
|
|
|
38
36
|
beforeEach(async () => {
|
|
39
|
-
identityCreateTransition =
|
|
40
|
-
getIdentityCreateTransitionFixture().toObject(),
|
|
41
|
-
);
|
|
37
|
+
identityCreateTransition = await getIdentityCreateTransitionFixture();
|
|
42
38
|
|
|
43
39
|
const privateKey1 = new PrivateKey('17e0b1703e226204c557bce68b0871683ea409ae90c7a733b72a33f7c129c959');
|
|
44
40
|
const publicKey1 = privateKey1.toPublicKey();
|