@dashevo/wasm-dpp 0.24.0-dev.11 → 0.24.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 +3 -0
- package/README.md +5 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +9 -0
- package/dist/lib/dpp.d.ts +9 -0
- package/dist/lib/errors/AbstractConsensusError.d.ts +10 -0
- package/dist/lib/errors/DPPError.d.ts +5 -0
- package/dist/lib/errors/patchConsensusErrors.d.ts +1 -0
- package/dist/lib/{patchIdentifier.d.ts → identifier/patchIdentifier.d.ts} +1 -1
- package/dist/{index.d.ts → lib/index.d.ts} +1 -1
- package/dist/lib/utils/extend.d.ts +1 -0
- package/dist/wasm/wasm_dpp.d.ts +1595 -518
- package/karma.conf.js +5 -0
- package/lib/dpp.ts +24 -0
- package/lib/errors/AbstractConsensusError.ts +13 -0
- package/lib/errors/DPPError.ts +15 -0
- package/lib/errors/patchConsensusErrors.ts +175 -0
- package/lib/{patchIdentifier.ts → identifier/patchIdentifier.ts} +6 -5
- package/{index.ts → lib/index.ts} +5 -4
- package/lib/test/bootstrap.js +5 -0
- package/lib/test/expect/expectError.js +4 -2
- package/lib/test/mocks/getBlsAdapterMock.js +36 -0
- package/lib/test/utils/newDocumentsContainer.js +36 -0
- package/lib/utils/extend.ts +6 -0
- package/package.json +9 -6
- package/src/bls_adapter.rs +16 -1
- package/src/data_contract/data_contract.rs +35 -7
- package/src/data_contract/errors/invalid_data_contract.rs +21 -0
- package/src/data_contract/errors/invalid_document_type.rs +1 -1
- package/src/data_contract/index.rs +56 -1
- package/src/data_contract/mod.rs +1 -0
- package/src/data_contract/state_transition/data_contract_create_transition/mod.rs +6 -8
- package/src/data_contract/state_transition/data_contract_create_transition/validation.rs +4 -4
- package/src/data_contract/state_transition/data_contract_update_transition/apply.rs +44 -0
- package/src/data_contract/state_transition/data_contract_update_transition/mod.rs +145 -0
- package/src/data_contract/state_transition/data_contract_update_transition/validation.rs +49 -0
- package/src/data_contract/state_transition/mod.rs +2 -0
- package/src/data_contract_factory/data_contract_factory.rs +25 -12
- package/src/document/errors/invalid_document_error.rs +10 -9
- package/src/document/errors/invalid_initial_revision_error.rs +1 -1
- package/src/document/errors/mismatch_owners_ids_error.rs +14 -4
- package/src/document/errors/mod.rs +17 -13
- package/src/document/errors/no_documents_supplied_error.rs +4 -4
- package/src/document/factory.rs +192 -0
- package/src/document/mod.rs +222 -30
- package/src/document/state_transition/document_batch_transition/document_transition/document_create_transition.rs +47 -1
- package/src/document/state_transition/document_batch_transition/document_transition/document_delete_transition.rs +25 -1
- package/src/document/state_transition/document_batch_transition/document_transition/document_replace_transition.rs +65 -0
- package/src/document/state_transition/document_batch_transition/document_transition/mod.rs +123 -3
- package/src/document/state_transition/document_batch_transition/mod.rs +378 -0
- package/src/document/validator.rs +30 -0
- package/src/errors/consensus/basic/data_contract/data_contract_max_depth_exceed_error.rs +5 -5
- package/src/errors/consensus/basic/document/duplicate_document_transitions_with_ids_error.rs +4 -4
- package/src/errors/consensus/basic/document/duplicate_document_transitions_with_indices_error.rs +36 -0
- package/src/errors/consensus/basic/document/missing_document_transition_type_error.rs +20 -0
- package/src/errors/consensus/basic/document/mod.rs +4 -0
- package/src/errors/consensus/basic/identity/duplicated_identity_public_key_error.rs +2 -2
- package/src/errors/consensus/basic/identity/duplicated_identity_public_key_id_error.rs +2 -2
- package/src/errors/consensus/basic/identity/identity_asset_lock_proof_locked_transaction_mismatch_error.rs +6 -2
- package/src/errors/consensus/basic/identity/identity_asset_lock_transaction_out_point_already_exists_error.rs +5 -2
- package/src/errors/consensus/basic/identity/invalid_asset_lock_proof_transaction_height_error.rs +3 -3
- package/src/errors/consensus/basic/identity/invalid_identity_public_key_security_level_error.rs +2 -2
- package/src/errors/consensus/basic/json_schema_error.rs +1 -1
- package/src/errors/consensus_error.rs +15 -8
- package/src/errors/dpp_error.rs +17 -0
- package/src/errors/from.rs +6 -1
- package/src/errors/js_conversion.rs +19 -4
- package/src/errors/mod.rs +3 -0
- package/src/errors/protocol_error.rs +15 -0
- package/src/{identifier.rs → identifier/mod.rs} +48 -3
- package/src/identity/errors/asset_lock_output_not_found_error.rs +11 -0
- package/src/identity/errors/asset_lock_transaction_is_not_found_error.rs +20 -0
- package/src/identity/errors/mod.rs +7 -0
- package/src/identity/errors/unknown_asset_lock_proof_type_error.rs +26 -0
- package/src/{identity_facade.rs → identity/identity_facade.rs} +3 -5
- package/src/{identity_public_key → identity/identity_public_key}/key_type.rs +0 -0
- package/src/{identity_public_key → identity/identity_public_key}/mod.rs +41 -10
- package/src/{identity_public_key → identity/identity_public_key}/purpose.rs +0 -0
- package/src/{identity_public_key → identity/identity_public_key}/security_level.rs +0 -0
- package/src/{identity.rs → identity/mod.rs} +20 -12
- package/src/identity/state_transition/asset_lock_proof/chain/chain_asset_lock_proof.rs +132 -0
- package/src/identity/state_transition/asset_lock_proof/chain/chain_asset_lock_proof_structure_validator.rs +72 -0
- package/src/identity/state_transition/asset_lock_proof/chain/mod.rs +4 -0
- package/src/identity/state_transition/asset_lock_proof/instant/instant_asset_lock_proof.rs +177 -0
- package/src/identity/state_transition/asset_lock_proof/instant/instant_asset_lock_proof_structure_validator.rs +72 -0
- package/src/identity/state_transition/asset_lock_proof/instant/mod.rs +4 -0
- package/src/identity/state_transition/asset_lock_proof/mod.rs +269 -0
- package/src/identity/state_transition/identity_create_transition/apply_identity_create_transition.rs +26 -0
- package/src/identity/state_transition/identity_create_transition/identity_create_transition.rs +335 -0
- package/src/identity/state_transition/identity_create_transition/identity_create_transition_basic_validator.rs +153 -0
- package/src/identity/state_transition/identity_create_transition/identity_create_transition_state_validator.rs +37 -0
- package/src/identity/state_transition/identity_create_transition/mod.rs +8 -0
- package/src/identity/state_transition/identity_create_transition/to_object.rs +46 -0
- package/src/identity/state_transition/identity_topup_transition/apply_identity_topup_transition.rs +31 -0
- package/src/identity/state_transition/identity_topup_transition/identity_topup_transition.rs +280 -0
- package/src/identity/state_transition/identity_topup_transition/identity_topup_transition_basic_validator.rs +113 -0
- package/src/identity/state_transition/identity_topup_transition/identity_topup_transition_state_validator.rs +37 -0
- package/src/identity/state_transition/identity_topup_transition/mod.rs +8 -0
- package/src/identity/state_transition/identity_topup_transition/to_object.rs +42 -0
- package/src/identity/state_transition/mod.rs +9 -0
- package/src/identity/state_transition/validate_public_key_signatures.rs +59 -0
- package/src/identity/validation/mod.rs +3 -0
- package/src/identity/validation/public_keys_validator.rs +76 -0
- package/src/identity_public_key/public_keys_validator.rs +1 -1
- package/src/lib.rs +3 -6
- package/src/lodash.rs +7 -0
- package/src/state_repository.rs +188 -36
- package/src/state_transition/mod.rs +12 -0
- package/src/utils.rs +102 -7
- package/src/validation/json_schema_validator.rs +41 -0
- package/src/validation/mod.rs +5 -0
- package/src/{validation_result.rs → validation/validation_result.rs} +23 -5
- package/src/version/mod.rs +2 -0
- package/src/version/protocol_version.rs +26 -0
- package/test/integration/dataContract/validation/validateDataContractFactory.spec.js +579 -502
- package/test/integration/identity/stateTransition/IdentityCreateTransition/validation/basic/validateIdentityCreateTransitionBasicFactory.spec.js +175 -165
- package/test/integration/identity/stateTransition/IdentityTopUpTransition/validation/basic/validateIdentityTopUpTransitionBasicFactory.spec.js +83 -114
- package/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validateIdentityUpdateTransitionStateFactory.spec.js +1 -1
- package/test/integration/identity/stateTransition/assetLockProof/chain/validateChainAssetLockProofStructureFactory.spec.js +82 -91
- package/test/integration/identity/stateTransition/assetLockProof/fetchAssetLockTransactionOutputFactory.spec.js +75 -31
- package/test/integration/identity/stateTransition/assetLockProof/instant/validateInstantAssetLockProofStructureFactory.spec.js +93 -148
- package/test/integration/identity/stateTransition/assetLockProof/validateAssetLockTransactionFactory.spec.js +63 -75
- package/test/integration/identity/stateTransition/validatePublicKeySignaturesFactory.spec.js +48 -19
- package/test/integration/identity/validation/validatePublicKeysFactory.spec.js +79 -114
- package/test/integration/stateTransition/AbstractStateTransitionIdentitySigned.spec.js +0 -11
- package/test/integration/stateTransition/StateTransitionFacade.spec.js +1 -1
- package/test/integration/stateTransition/calculateStateTransitionFeeFactory.spec.js +135 -0
- package/test/unit/dataContract/DataContract.spec.js +5 -9
- package/test/unit/dataContract/DataContractFactory.spec.js +13 -6
- package/test/unit/dataContract/createDataContract.spec.js +0 -1
- package/test/unit/dataContract/errors/InvalidDataContractError.spec.js +11 -3
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/DataContractCreateTransition.spec.js +3 -3
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/validation/state/validateDataContractCreateTransitionStateFactory.spec.js +20 -16
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/DataContractUpdateTransition.spec.js +24 -60
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/applyDataContractUpdateTransitionFactory.spec.js +27 -23
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/validation/basic/validateIndicesAreBackwardCompatible.spec.js +29 -12
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/validation/state/validateDataContractUpdateTransitionStateFactory.spec.js +66 -49
- package/test/unit/dataContract/validation/validateDataContractPatterns.spec.js +73 -0
- package/test/unit/decodeProtocolEntityFactory.spec.js +2 -2
- package/test/unit/document/Document.spec.js +147 -155
- package/test/unit/document/DocumentFactory.spec.js +325 -91
- package/test/unit/document/stateTransition/DocumetsBatchTransition/DocumentsBatchTransition.spec.js +142 -64
- package/test/unit/document/stateTransition/DocumetsBatchTransition/applyDocumentsBatchTransitionFactory.spec.js +1 -1
- package/test/unit/document/stateTransition/DocumetsBatchTransition/validation/state/validateDocumentsBatchTransitionStateFactory.spec.js +1 -1
- package/test/unit/identity/Identity.spec.js +2 -2
- package/test/unit/identity/IdentityPublicKey.spec.js +25 -31
- package/test/unit/identity/stateTransition/IdentityCreateTransition/IdentityCreateTransition.spec.js +69 -30
- package/test/unit/identity/stateTransition/IdentityCreateTransition/applyIdentityCreateTransitionFactory.spec.js +32 -32
- package/test/unit/identity/stateTransition/IdentityCreateTransition/validation/state/validateIdentityCreateTransitionStateFactory.spec.js +56 -25
- package/test/unit/identity/stateTransition/IdentityTopUpTransition/IdentityTopUpTransition.spec.js +36 -16
- package/test/unit/identity/stateTransition/IdentityTopUpTransition/applyIdentityTopUpTransitionFactory.spec.js +48 -46
- package/test/unit/identity/stateTransition/IdentityTopUpTransition/validation/state/validateIdentityTopUpTransitionStateFactory.spec.js +24 -6
- package/test/unit/identity/stateTransition/assetLockProof/ChainAssetLockProof.spec.js +63 -0
- package/test/unit/identity/stateTransition/assetLockProof/InstantAssetLockProof.spec.js +90 -0
- package/test/unit/identity/stateTransition/assetLockProof/createAssetLockProofInstance.spec.js +18 -3
- package/test/unit/identity/stateTransition/assetLockProof/fetchAssetLockPublicKeyHashFactory.spec.js +38 -11
- package/tsconfig.json +1 -1
- package/wasm/package.json +5 -0
- package/wasm/wasm_dpp.d.ts +1595 -518
- package/wasm/wasm_dpp.js +5007 -2172
- package/wasm/wasm_dpp_bg.js +1 -1
- package/wasm/wasm_dpp_bg.wasm +0 -0
- package/wasm/wasm_dpp_bg.wasm.d.ts +566 -365
- package/webpack.config.js +10 -1
- package/test/integration/stateTransition/calculateStateTransitionFee.spec.js +0 -32
- package/test/unit/dataContract/validation/validateDataContractMaxDepthFactory.spec.js +0 -93
- package/test/unit/dataContract/validation/validateDataContractPatternsFactory.spec.js +0 -64
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
const Identity = require('@dashevo/dpp/lib/identity/Identity');
|
|
2
|
-
|
|
3
|
-
const applyIdentityCreateTransitionFactory = require(
|
|
4
|
-
'@dashevo/dpp/lib/identity/stateTransition/IdentityCreateTransition/applyIdentityCreateTransitionFactory',
|
|
5
|
-
);
|
|
6
|
-
|
|
7
1
|
const getIdentityCreateTransitionFixture = require('@dashevo/dpp/lib/test/fixtures/getIdentityCreateTransitionFixture');
|
|
8
2
|
|
|
9
3
|
const { convertSatoshiToCredits } = require('@dashevo/dpp/lib/identity/creditsConverter');
|
|
@@ -11,21 +5,37 @@ const { convertSatoshiToCredits } = require('@dashevo/dpp/lib/identity/creditsCo
|
|
|
11
5
|
const createStateRepositoryMock = require('@dashevo/dpp/lib/test/mocks/createStateRepositoryMock');
|
|
12
6
|
|
|
13
7
|
const protocolVersion = require('@dashevo/dpp/lib/version/protocolVersion');
|
|
14
|
-
|
|
15
|
-
const
|
|
8
|
+
|
|
9
|
+
const { default: loadWasmDpp } = require('../../../../../dist');
|
|
16
10
|
|
|
17
11
|
describe('applyIdentityCreateTransitionFactory', () => {
|
|
18
12
|
let stateTransition;
|
|
19
13
|
let applyIdentityCreateTransition;
|
|
20
14
|
let stateRepositoryMock;
|
|
21
|
-
let fetchAssetLockTransactionOutputMock;
|
|
22
15
|
let output;
|
|
23
16
|
let executionContext;
|
|
24
17
|
|
|
18
|
+
let StateTransitionExecutionContext;
|
|
19
|
+
let IdentityCreateTransition;
|
|
20
|
+
let Identity;
|
|
21
|
+
|
|
22
|
+
let applyIdentityCreateTransitionDPP;
|
|
23
|
+
|
|
24
|
+
before(async () => {
|
|
25
|
+
({
|
|
26
|
+
StateTransitionExecutionContext,
|
|
27
|
+
IdentityCreateTransition,
|
|
28
|
+
applyIdentityCreateTransition: applyIdentityCreateTransitionDPP,
|
|
29
|
+
Identity,
|
|
30
|
+
} = await loadWasmDpp());
|
|
31
|
+
});
|
|
32
|
+
|
|
25
33
|
beforeEach(function beforeEach() {
|
|
26
34
|
stateRepositoryMock = createStateRepositoryMock(this.sinonSandbox);
|
|
27
35
|
|
|
28
|
-
stateTransition =
|
|
36
|
+
stateTransition = new IdentityCreateTransition(
|
|
37
|
+
getIdentityCreateTransitionFixture().toObject(),
|
|
38
|
+
);
|
|
29
39
|
|
|
30
40
|
executionContext = new StateTransitionExecutionContext();
|
|
31
41
|
|
|
@@ -33,19 +43,13 @@ describe('applyIdentityCreateTransitionFactory', () => {
|
|
|
33
43
|
|
|
34
44
|
output = stateTransition.getAssetLockProof().getOutput();
|
|
35
45
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
applyIdentityCreateTransition = applyIdentityCreateTransitionFactory(
|
|
46
|
+
applyIdentityCreateTransition = (st) => applyIdentityCreateTransitionDPP(
|
|
39
47
|
stateRepositoryMock,
|
|
40
|
-
|
|
48
|
+
st,
|
|
41
49
|
);
|
|
42
50
|
});
|
|
43
51
|
|
|
44
|
-
it('should store identity created from state transition', async ()
|
|
45
|
-
executionContext.addOperation(
|
|
46
|
-
new ReadOperation(1),
|
|
47
|
-
);
|
|
48
|
-
|
|
52
|
+
it('should store identity created from state transition', async function () {
|
|
49
53
|
await applyIdentityCreateTransition(stateTransition);
|
|
50
54
|
|
|
51
55
|
const balance = convertSatoshiToCredits(
|
|
@@ -60,9 +64,11 @@ describe('applyIdentityCreateTransitionFactory', () => {
|
|
|
60
64
|
revision: 0,
|
|
61
65
|
});
|
|
62
66
|
|
|
67
|
+
const { match } = this.sinonSandbox;
|
|
68
|
+
|
|
63
69
|
expect(stateRepositoryMock.createIdentity).to.have.been.calledOnceWithExactly(
|
|
64
|
-
identity,
|
|
65
|
-
|
|
70
|
+
match((arg) => expect(arg.toObject()).to.deep.equal(identity.toObject())),
|
|
71
|
+
match.instanceOf(StateTransitionExecutionContext),
|
|
66
72
|
);
|
|
67
73
|
|
|
68
74
|
const publicKeyHashes = identity
|
|
@@ -70,21 +76,15 @@ describe('applyIdentityCreateTransitionFactory', () => {
|
|
|
70
76
|
.map((publicKey) => publicKey.hash());
|
|
71
77
|
|
|
72
78
|
expect(stateRepositoryMock.storeIdentityPublicKeyHashes).to.have.been.calledOnceWithExactly(
|
|
73
|
-
identity.getId(),
|
|
74
|
-
publicKeyHashes,
|
|
75
|
-
|
|
79
|
+
match((arg) => expect(arg.toBuffer()).to.deep.equal(identity.getId().toBuffer())),
|
|
80
|
+
match((arg) => expect(arg).to.deep.equal(publicKeyHashes)),
|
|
81
|
+
match.instanceOf(StateTransitionExecutionContext),
|
|
76
82
|
);
|
|
77
83
|
|
|
84
|
+
const outPoint = stateTransition.getAssetLockProof().getOutPoint();
|
|
78
85
|
expect(stateRepositoryMock.markAssetLockTransactionOutPointAsUsed).to.have.been
|
|
79
86
|
.calledOnceWithExactly(
|
|
80
|
-
|
|
81
|
-
executionContext,
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
expect(fetchAssetLockTransactionOutputMock)
|
|
85
|
-
.to.be.calledOnceWithExactly(
|
|
86
|
-
stateTransition.getAssetLockProof(),
|
|
87
|
-
executionContext,
|
|
87
|
+
match((arg) => Buffer.from(arg).equals(outPoint)),
|
|
88
88
|
);
|
|
89
89
|
});
|
|
90
90
|
});
|
|
@@ -1,54 +1,85 @@
|
|
|
1
|
-
const { expectValidationError } = require(
|
|
2
|
-
'@dashevo/dpp/lib/test/expect/expectError',
|
|
3
|
-
);
|
|
4
|
-
|
|
5
|
-
const validateIdentityCreateTransitionStateFactory = require(
|
|
6
|
-
'@dashevo/dpp/lib/identity/stateTransition/IdentityCreateTransition/validation/state/validateIdentityCreateTransitionStateFactory',
|
|
7
|
-
);
|
|
8
|
-
|
|
9
1
|
const getIdentityCreateTransitionFixture = require('@dashevo/dpp/lib/test/fixtures/getIdentityCreateTransitionFixture');
|
|
10
2
|
|
|
11
|
-
const IdentityAlreadyExistsError = require(
|
|
12
|
-
'@dashevo/dpp/lib/errors/consensus/state/identity/IdentityAlreadyExistsError',
|
|
13
|
-
);
|
|
14
|
-
|
|
15
3
|
const createStateRepositoryMock = require('@dashevo/dpp/lib/test/mocks/createStateRepositoryMock');
|
|
16
|
-
|
|
4
|
+
|
|
5
|
+
const protocolVersion = require('@dashevo/dpp/lib/version/protocolVersion');
|
|
6
|
+
const { default: loadWasmDpp } = require('../../../../../../../dist');
|
|
7
|
+
const generateRandomIdentifierAsync = require('../../../../../../../lib/test/utils/generateRandomIdentifierAsync');
|
|
8
|
+
const { expectValidationError } = require('../../../../../../../lib/test/expect/expectError');
|
|
17
9
|
|
|
18
10
|
describe('validateIdentityCreateTransitionStateFactory', () => {
|
|
19
11
|
let validateIdentityCreateTransitionState;
|
|
20
12
|
let stateTransition;
|
|
21
13
|
let stateRepositoryMock;
|
|
14
|
+
let identity;
|
|
15
|
+
|
|
16
|
+
let IdentityCreateTransition;
|
|
17
|
+
let IdentityPublicKey;
|
|
18
|
+
let IdentityAlreadyExistsError;
|
|
19
|
+
let Identity;
|
|
20
|
+
let IdentityCreateTransitionStateValidator;
|
|
21
|
+
|
|
22
|
+
before(async () => {
|
|
23
|
+
({
|
|
24
|
+
IdentityCreateTransition,
|
|
25
|
+
IdentityAlreadyExistsError,
|
|
26
|
+
IdentityPublicKey,
|
|
27
|
+
Identity,
|
|
28
|
+
IdentityCreateTransitionStateValidator,
|
|
29
|
+
} = await loadWasmDpp());
|
|
30
|
+
});
|
|
22
31
|
|
|
23
|
-
beforeEach(async function
|
|
24
|
-
const privateKey = 'af432c476f65211f45f48f1d42c9c0b497e56696aa1736b40544ef1a496af837';
|
|
32
|
+
beforeEach(async function () {
|
|
33
|
+
const privateKey = Buffer.from('af432c476f65211f45f48f1d42c9c0b497e56696aa1736b40544ef1a496af837', 'hex');
|
|
25
34
|
stateRepositoryMock = createStateRepositoryMock(this.sinonSandbox);
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
36
|
+
const validator = new IdentityCreateTransitionStateValidator(stateRepositoryMock);
|
|
37
|
+
validateIdentityCreateTransitionState = (st) => validator.validate(st);
|
|
30
38
|
|
|
31
|
-
stateTransition =
|
|
39
|
+
stateTransition = new IdentityCreateTransition(
|
|
40
|
+
getIdentityCreateTransitionFixture().toObject(),
|
|
41
|
+
);
|
|
32
42
|
|
|
33
43
|
await stateTransition.signByPrivateKey(privateKey, IdentityPublicKey.TYPES.ECDSA_SECP256K1);
|
|
34
44
|
|
|
35
45
|
const rawTransaction = '030000000137feb5676d0851337ea3c9a992496aab7a0b3eee60aeeb9774000b7f4bababa5000000006b483045022100d91557de37645c641b948c6cd03b4ae3791a63a650db3e2fee1dcf5185d1b10402200e8bd410bf516ca61715867666d31e44495428ce5c1090bf2294a829ebcfa4ef0121025c3cc7fbfc52f710c941497fd01876c189171ea227458f501afcb38a297d65b4ffffffff021027000000000000166a14152073ca2300a86b510fa2f123d3ea7da3af68dcf77cb0090a0000001976a914152073ca2300a86b510fa2f123d3ea7da3af68dc88ac00000000';
|
|
36
46
|
|
|
37
|
-
stateRepositoryMock.fetchTransaction.
|
|
47
|
+
stateRepositoryMock.fetchTransaction.returns({
|
|
48
|
+
data: Buffer.from(rawTransaction, 'hex'),
|
|
49
|
+
height: 42,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
identity = new Identity({
|
|
53
|
+
protocolVersion: protocolVersion.latestVersion,
|
|
54
|
+
id: await generateRandomIdentifierAsync(),
|
|
55
|
+
publicKeys: [
|
|
56
|
+
{
|
|
57
|
+
id: 0,
|
|
58
|
+
type: 0,
|
|
59
|
+
data: Buffer.alloc(36).fill('a'),
|
|
60
|
+
purpose: 0,
|
|
61
|
+
securityLevel: 0,
|
|
62
|
+
readOnly: false,
|
|
63
|
+
signature: Buffer.alloc(36).fill('a'),
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
balance: 0,
|
|
67
|
+
revision: 0,
|
|
68
|
+
});
|
|
38
69
|
});
|
|
39
70
|
|
|
40
71
|
it('should return invalid result if identity already exists', async () => {
|
|
41
|
-
stateRepositoryMock.fetchIdentity.
|
|
72
|
+
stateRepositoryMock.fetchIdentity.returns(identity);
|
|
42
73
|
|
|
43
74
|
const result = await validateIdentityCreateTransitionState(stateTransition);
|
|
44
75
|
|
|
45
|
-
expectValidationError(result, IdentityAlreadyExistsError
|
|
76
|
+
await expectValidationError(result, IdentityAlreadyExistsError);
|
|
46
77
|
|
|
47
78
|
const [error] = result.getErrors();
|
|
48
79
|
|
|
49
80
|
expect(error.getCode()).to.equal(4011);
|
|
50
|
-
expect(
|
|
51
|
-
expect(error.getIdentityId()).to.deep.equal(stateTransition.getIdentityId());
|
|
81
|
+
expect(error.getIdentityId()).to.exist();
|
|
82
|
+
expect(error.getIdentityId()).to.deep.equal(stateTransition.getIdentityId().toBuffer());
|
|
52
83
|
});
|
|
53
84
|
|
|
54
85
|
it('should return valid result if state transition is valid', async () => {
|
|
@@ -58,7 +89,7 @@ describe('validateIdentityCreateTransitionStateFactory', () => {
|
|
|
58
89
|
});
|
|
59
90
|
|
|
60
91
|
it('should return valid result on dry run', async () => {
|
|
61
|
-
stateRepositoryMock.fetchIdentity.
|
|
92
|
+
stateRepositoryMock.fetchIdentity.returns(identity);
|
|
62
93
|
|
|
63
94
|
stateTransition.getExecutionContext().enableDryRun();
|
|
64
95
|
|
package/test/unit/identity/stateTransition/IdentityTopUpTransition/IdentityTopUpTransition.spec.js
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
const stateTransitionTypes = require(
|
|
2
|
-
'@dashevo/dpp/lib/stateTransition/stateTransitionTypes',
|
|
3
|
-
);
|
|
4
|
-
|
|
5
|
-
const Identifier = require('@dashevo/dpp/lib/identifier/Identifier');
|
|
6
|
-
|
|
7
1
|
const getIdentityTopUpTransitionFixture = require('@dashevo/dpp/lib/test/fixtures/getIdentityTopUpTransitionFixture');
|
|
2
|
+
const getChainAssetLockProofFixture = require('@dashevo/dpp/lib/test/fixtures/getChainAssetLockProofFixture');
|
|
8
3
|
|
|
4
|
+
const stateTransitionTypes = require('@dashevo/dpp/lib/stateTransition/stateTransitionTypes');
|
|
9
5
|
const protocolVersion = require('@dashevo/dpp/lib/version/protocolVersion');
|
|
6
|
+
const { default: loadWasmDpp } = require('../../../../../dist');
|
|
10
7
|
|
|
11
8
|
describe('IdentityTopUpTransition', () => {
|
|
12
9
|
let rawStateTransition;
|
|
13
10
|
let stateTransition;
|
|
14
11
|
|
|
12
|
+
let IdentityTopUpTransition;
|
|
13
|
+
let InstantAssetLockProof;
|
|
14
|
+
let Identifier;
|
|
15
|
+
|
|
16
|
+
before(async () => {
|
|
17
|
+
({
|
|
18
|
+
IdentityTopUpTransition, InstantAssetLockProof, Identifier,
|
|
19
|
+
} = await loadWasmDpp());
|
|
20
|
+
});
|
|
21
|
+
|
|
15
22
|
beforeEach(() => {
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
rawStateTransition = getIdentityTopUpTransitionFixture().toObject();
|
|
24
|
+
|
|
25
|
+
stateTransition = new IdentityTopUpTransition(
|
|
26
|
+
rawStateTransition,
|
|
27
|
+
);
|
|
18
28
|
});
|
|
19
29
|
|
|
20
30
|
describe('#constructor', () => {
|
|
@@ -22,10 +32,17 @@ describe('IdentityTopUpTransition', () => {
|
|
|
22
32
|
expect(stateTransition.getAssetLockProof().toObject()).to.be.deep.equal(
|
|
23
33
|
rawStateTransition.assetLockProof,
|
|
24
34
|
);
|
|
25
|
-
expect(stateTransition.getIdentityId()).to.be.deep.equal(
|
|
35
|
+
expect(stateTransition.getIdentityId().toBuffer()).to.be.deep.equal(
|
|
26
36
|
rawStateTransition.identityId,
|
|
27
37
|
);
|
|
28
38
|
});
|
|
39
|
+
|
|
40
|
+
it('should create instance with chain asset lock proof', () => {
|
|
41
|
+
rawStateTransition.assetLockProof = getChainAssetLockProofFixture().toObject();
|
|
42
|
+
stateTransition = new IdentityTopUpTransition(rawStateTransition);
|
|
43
|
+
expect(stateTransition.getAssetLockProof().toObject())
|
|
44
|
+
.to.deep.equal(rawStateTransition.assetLockProof);
|
|
45
|
+
});
|
|
29
46
|
});
|
|
30
47
|
|
|
31
48
|
describe('#getType', () => {
|
|
@@ -36,13 +53,16 @@ describe('IdentityTopUpTransition', () => {
|
|
|
36
53
|
|
|
37
54
|
describe('#setAssetLockProof', () => {
|
|
38
55
|
it('should set asset lock proof', () => {
|
|
39
|
-
stateTransition.setAssetLockProof(
|
|
56
|
+
stateTransition.setAssetLockProof(
|
|
57
|
+
new InstantAssetLockProof(rawStateTransition.assetLockProof),
|
|
58
|
+
);
|
|
40
59
|
|
|
41
|
-
expect(stateTransition.assetLockProof
|
|
60
|
+
expect(stateTransition.assetLockProof.toObject())
|
|
61
|
+
.to.deep.equal(rawStateTransition.assetLockProof);
|
|
42
62
|
});
|
|
43
63
|
});
|
|
44
64
|
|
|
45
|
-
describe('#
|
|
65
|
+
describe('#getAssetLockProof', () => {
|
|
46
66
|
it('should return currently set asset lock proof', () => {
|
|
47
67
|
expect(stateTransition.getAssetLockProof().toObject()).to.deep.equal(
|
|
48
68
|
rawStateTransition.assetLockProof,
|
|
@@ -52,7 +72,7 @@ describe('IdentityTopUpTransition', () => {
|
|
|
52
72
|
|
|
53
73
|
describe('#getIdentityId', () => {
|
|
54
74
|
it('should return identity id', () => {
|
|
55
|
-
expect(stateTransition.getIdentityId()).to.deep.equal(
|
|
75
|
+
expect(stateTransition.getIdentityId().toBuffer()).to.deep.equal(
|
|
56
76
|
rawStateTransition.identityId,
|
|
57
77
|
);
|
|
58
78
|
});
|
|
@@ -60,7 +80,7 @@ describe('IdentityTopUpTransition', () => {
|
|
|
60
80
|
|
|
61
81
|
describe('#getOwnerId', () => {
|
|
62
82
|
it('should return owner id', () => {
|
|
63
|
-
expect(stateTransition.getOwnerId()).to.deep.equal(
|
|
83
|
+
expect(stateTransition.getOwnerId().toBuffer()).to.deep.equal(
|
|
64
84
|
rawStateTransition.identityId,
|
|
65
85
|
);
|
|
66
86
|
});
|
|
@@ -99,7 +119,7 @@ describe('IdentityTopUpTransition', () => {
|
|
|
99
119
|
protocolVersion: protocolVersion.latestVersion,
|
|
100
120
|
type: stateTransitionTypes.IDENTITY_TOP_UP,
|
|
101
121
|
assetLockProof: stateTransition.getAssetLockProof().toJSON(),
|
|
102
|
-
identityId: Identifier(rawStateTransition.identityId).toString(),
|
|
122
|
+
identityId: new Identifier(rawStateTransition.identityId).toString(),
|
|
103
123
|
signature: undefined,
|
|
104
124
|
});
|
|
105
125
|
});
|
|
@@ -113,7 +133,7 @@ describe('IdentityTopUpTransition', () => {
|
|
|
113
133
|
const identityId = result[0];
|
|
114
134
|
|
|
115
135
|
expect(identityId).to.be.an.instanceOf(Identifier);
|
|
116
|
-
expect(identityId).to.be.deep.equal(rawStateTransition.identityId);
|
|
136
|
+
expect(identityId.toBuffer()).to.be.deep.equal(rawStateTransition.identityId);
|
|
117
137
|
});
|
|
118
138
|
});
|
|
119
139
|
|
|
@@ -1,47 +1,66 @@
|
|
|
1
|
-
const applyIdentityTopUpTransitionFactory = require(
|
|
2
|
-
'@dashevo/dpp/lib/identity/stateTransition/IdentityTopUpTransition/applyIdentityTopUpTransitionFactory',
|
|
3
|
-
);
|
|
4
|
-
|
|
5
1
|
const getIdentityFixture = require('@dashevo/dpp/lib/test/fixtures/getIdentityFixture');
|
|
6
2
|
const getIdentityTopUpTransitionFixture = require('@dashevo/dpp/lib/test/fixtures/getIdentityTopUpTransitionFixture');
|
|
7
3
|
|
|
8
4
|
const { convertSatoshiToCredits } = require('@dashevo/dpp/lib/identity/creditsConverter');
|
|
9
5
|
|
|
10
6
|
const createStateRepositoryMock = require('@dashevo/dpp/lib/test/mocks/createStateRepositoryMock');
|
|
11
|
-
|
|
12
|
-
const
|
|
7
|
+
|
|
8
|
+
const { default: loadWasmDpp } = require('../../../../../dist');
|
|
9
|
+
const generateRandomIdentifierAsync = require('../../../../../lib/test/utils/generateRandomIdentifierAsync');
|
|
13
10
|
|
|
14
11
|
describe('applyIdentityTopUpTransitionFactory', () => {
|
|
15
12
|
let stateTransition;
|
|
16
13
|
let applyIdentityTopUpTransition;
|
|
17
14
|
let stateRepositoryMock;
|
|
18
15
|
let identity;
|
|
19
|
-
let fetchAssetLockTransactionOutputMock;
|
|
20
16
|
let executionContext;
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
let StateTransitionExecutionContext;
|
|
19
|
+
let IdentityTopUpTransition;
|
|
20
|
+
let Identity;
|
|
21
|
+
|
|
22
|
+
let applyIdentityTopUpTransitionDPP;
|
|
23
|
+
|
|
24
|
+
before(async () => {
|
|
25
|
+
({
|
|
26
|
+
StateTransitionExecutionContext,
|
|
27
|
+
IdentityTopUpTransition,
|
|
28
|
+
applyIdentityTopUpTransition: applyIdentityTopUpTransitionDPP,
|
|
29
|
+
Identity,
|
|
30
|
+
} = await loadWasmDpp());
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
beforeEach(async function beforeEach() {
|
|
34
|
+
const rawIdentity = getIdentityFixture().toObject();
|
|
35
|
+
// Patch identity id to match expectation of wasm Identity class
|
|
36
|
+
rawIdentity.id = await generateRandomIdentifierAsync();
|
|
37
|
+
identity = new Identity(rawIdentity);
|
|
24
38
|
|
|
25
39
|
stateRepositoryMock = createStateRepositoryMock(this.sinonSandbox);
|
|
26
|
-
stateRepositoryMock.fetchIdentity.
|
|
40
|
+
stateRepositoryMock.fetchIdentity.returns(identity);
|
|
27
41
|
|
|
28
|
-
|
|
42
|
+
const rawTransaction = '030000000137feb5676d0851337ea3c9a992496aab7a0b3eee60aeeb9774000b7f4bababa5000000006b483045022100d91557de37645c641b948c6cd03b4ae3791a63a650db3e2fee1dcf5185d1b10402200e8bd410bf516ca61715867666d31e44495428ce5c1090bf2294a829ebcfa4ef0121025c3cc7fbfc52f710c941497fd01876c189171ea227458f501afcb38a297d65b4ffffffff021027000000000000166a14152073ca2300a86b510fa2f123d3ea7da3af68dcf77cb0090a0000001976a914152073ca2300a86b510fa2f123d3ea7da3af68dc88ac00000000';
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
stateRepositoryMock.fetchTransaction.returns({
|
|
45
|
+
data: Buffer.from(rawTransaction, 'hex'),
|
|
46
|
+
height: 42,
|
|
47
|
+
});
|
|
31
48
|
|
|
32
|
-
stateTransition
|
|
49
|
+
stateTransition = new IdentityTopUpTransition(
|
|
50
|
+
getIdentityTopUpTransitionFixture().toObject(),
|
|
51
|
+
);
|
|
33
52
|
|
|
34
|
-
|
|
53
|
+
executionContext = new StateTransitionExecutionContext();
|
|
35
54
|
|
|
36
|
-
|
|
55
|
+
stateTransition.setExecutionContext(executionContext);
|
|
37
56
|
|
|
38
|
-
applyIdentityTopUpTransition =
|
|
57
|
+
applyIdentityTopUpTransition = (st) => applyIdentityTopUpTransitionDPP(
|
|
39
58
|
stateRepositoryMock,
|
|
40
|
-
|
|
59
|
+
st,
|
|
41
60
|
);
|
|
42
61
|
});
|
|
43
62
|
|
|
44
|
-
it('should store identity created from state transition', async ()
|
|
63
|
+
it('should store identity created from state transition', async function () {
|
|
45
64
|
const balanceBeforeTopUp = identity.getBalance();
|
|
46
65
|
|
|
47
66
|
const balanceToTopUp = convertSatoshiToCredits(
|
|
@@ -50,35 +69,24 @@ describe('applyIdentityTopUpTransitionFactory', () => {
|
|
|
50
69
|
|
|
51
70
|
await applyIdentityTopUpTransition(stateTransition);
|
|
52
71
|
|
|
53
|
-
|
|
54
|
-
|
|
72
|
+
const { args: [updatedIdentity] } = stateRepositoryMock.updateIdentity.firstCall;
|
|
73
|
+
|
|
74
|
+
expect(updatedIdentity.getBalance()).to.be.equal(balanceBeforeTopUp + balanceToTopUp);
|
|
75
|
+
expect(updatedIdentity.getBalance()).to.be.greaterThan(balanceBeforeTopUp);
|
|
55
76
|
|
|
56
77
|
expect(stateRepositoryMock.updateIdentity).to.have.been.calledOnceWithExactly(
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
updatedIdentity,
|
|
79
|
+
this.sinonSandbox.match.instanceOf(StateTransitionExecutionContext),
|
|
59
80
|
);
|
|
60
81
|
|
|
61
82
|
expect(stateRepositoryMock.markAssetLockTransactionOutPointAsUsed).to.have.been
|
|
62
83
|
.calledOnceWithExactly(
|
|
63
84
|
stateTransition.getAssetLockProof().getOutPoint(),
|
|
64
|
-
executionContext,
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
expect(fetchAssetLockTransactionOutputMock)
|
|
68
|
-
.to.be.calledOnceWithExactly(
|
|
69
|
-
stateTransition.getAssetLockProof(),
|
|
70
|
-
executionContext,
|
|
71
85
|
);
|
|
72
86
|
});
|
|
73
87
|
|
|
74
|
-
it('should store biggest possible identity on dry run', async ()
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
const balanceBeforeTopUp = biggestPossibleIdentity.getBalance();
|
|
78
|
-
|
|
79
|
-
const balanceToTopUp = convertSatoshiToCredits(
|
|
80
|
-
stateTransition.getAssetLockProof().getOutput().satoshis,
|
|
81
|
-
);
|
|
88
|
+
it('should store biggest possible identity on dry run', async function () {
|
|
89
|
+
const biggestPossibleBalance = 18446744073709552000;
|
|
82
90
|
|
|
83
91
|
executionContext.enableDryRun();
|
|
84
92
|
|
|
@@ -86,23 +94,17 @@ describe('applyIdentityTopUpTransitionFactory', () => {
|
|
|
86
94
|
|
|
87
95
|
executionContext.disableDryRun();
|
|
88
96
|
|
|
89
|
-
|
|
97
|
+
const { args: [biggestPossibleIdentity] } = stateRepositoryMock.updateIdentity.firstCall;
|
|
98
|
+
expect(biggestPossibleIdentity.getBalance()).to.be.equal(biggestPossibleBalance);
|
|
90
99
|
|
|
91
100
|
expect(stateRepositoryMock.updateIdentity).to.have.been.calledOnceWithExactly(
|
|
92
101
|
biggestPossibleIdentity,
|
|
93
|
-
|
|
102
|
+
this.sinonSandbox.match.instanceOf(StateTransitionExecutionContext),
|
|
94
103
|
);
|
|
95
104
|
|
|
96
105
|
expect(stateRepositoryMock.markAssetLockTransactionOutPointAsUsed).to.have.been
|
|
97
106
|
.calledOnceWithExactly(
|
|
98
107
|
stateTransition.getAssetLockProof().getOutPoint(),
|
|
99
|
-
executionContext,
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
expect(fetchAssetLockTransactionOutputMock)
|
|
103
|
-
.to.be.calledOnceWithExactly(
|
|
104
|
-
stateTransition.getAssetLockProof(),
|
|
105
|
-
executionContext,
|
|
106
108
|
);
|
|
107
109
|
});
|
|
108
110
|
});
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
const getIdentityTopUpTransitionFixture = require('@dashevo/dpp/lib/test/fixtures/getIdentityTopUpTransitionFixture');
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
);
|
|
3
|
+
const createStateRepositoryMock = require('@dashevo/dpp/lib/test/mocks/createStateRepositoryMock');
|
|
4
|
+
const { default: loadWasmDpp } = require('../../../../../../../dist');
|
|
6
5
|
|
|
7
6
|
describe('validateIdentityTopUpTransitionStateFactory', () => {
|
|
8
7
|
let validateIdentityTopUpTransitionState;
|
|
9
8
|
let stateTransition;
|
|
9
|
+
let stateRepositoryMock;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
let IdentityTopUpTransition;
|
|
12
|
+
let IdentityTopUpTransitionStateValidator;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
before(async () => {
|
|
15
|
+
({
|
|
16
|
+
IdentityTopUpTransition,
|
|
17
|
+
IdentityTopUpTransitionStateValidator,
|
|
18
|
+
} = await loadWasmDpp());
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
beforeEach(function () {
|
|
22
|
+
stateRepositoryMock = createStateRepositoryMock(this.sinonSandbox);
|
|
23
|
+
|
|
24
|
+
stateTransition = new IdentityTopUpTransition(
|
|
25
|
+
getIdentityTopUpTransitionFixture().toObject(),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const validator = new IdentityTopUpTransitionStateValidator(stateRepositoryMock);
|
|
29
|
+
|
|
30
|
+
validateIdentityTopUpTransitionState = (st) => validator.validate(
|
|
31
|
+
st,
|
|
32
|
+
);
|
|
15
33
|
});
|
|
16
34
|
|
|
17
35
|
it('should return valid result', async () => {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const getChainAssetLockFixture = require('@dashevo/dpp/lib/test/fixtures/getChainAssetLockProofFixture');
|
|
2
|
+
|
|
3
|
+
const { default: loadWasmDpp } = require('../../../../../dist');
|
|
4
|
+
|
|
5
|
+
describe('ChainAssetLockProof', () => {
|
|
6
|
+
let ChainAssetLockProof;
|
|
7
|
+
let chainAssetLockProof;
|
|
8
|
+
let chainAssetLockProofJS;
|
|
9
|
+
|
|
10
|
+
before(async () => {
|
|
11
|
+
({ ChainAssetLockProof } = await loadWasmDpp());
|
|
12
|
+
|
|
13
|
+
chainAssetLockProofJS = getChainAssetLockFixture();
|
|
14
|
+
chainAssetLockProof = new ChainAssetLockProof(
|
|
15
|
+
chainAssetLockProofJS.toObject(),
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('#getType', () => {
|
|
20
|
+
it('should return correct type', () => {
|
|
21
|
+
expect(chainAssetLockProof.getType())
|
|
22
|
+
.to.equal(chainAssetLockProofJS.getType());
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('#getCoreChainLockedHeight', () => {
|
|
27
|
+
it('should return correct coreChainLockedHeight', () => {
|
|
28
|
+
expect(chainAssetLockProof.getCoreChainLockedHeight())
|
|
29
|
+
.to.equal(chainAssetLockProofJS.getCoreChainLockedHeight());
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('#getOutPoint', () => {
|
|
34
|
+
it('should return correct outPoint', () => {
|
|
35
|
+
expect(chainAssetLockProof.getOutPoint())
|
|
36
|
+
.to.deep.equal(chainAssetLockProofJS.getOutPoint());
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe('#toJSON', () => {
|
|
41
|
+
it('should return correct JSON', () => {
|
|
42
|
+
expect(chainAssetLockProof.toJSON())
|
|
43
|
+
.to.deep.equal(chainAssetLockProofJS.toJSON());
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('#toObject', () => {
|
|
48
|
+
it('should return correct object', () => {
|
|
49
|
+
expect(chainAssetLockProof.toObject())
|
|
50
|
+
.to.deep.equal(chainAssetLockProofJS.toObject());
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe('#createIdentifier', () => {
|
|
55
|
+
it('should return correct identifier', () => {
|
|
56
|
+
const identifier = chainAssetLockProof.createIdentifier();
|
|
57
|
+
const identifierJS = chainAssetLockProofJS.createIdentifier();
|
|
58
|
+
|
|
59
|
+
expect(identifier.toBuffer())
|
|
60
|
+
.to.deep.equal(identifierJS.toBuffer());
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|