Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
Functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shuplenkov committed Apr 16, 2020
1 parent 6358e3c commit 99ca879
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('getDocumentsHandlerFactory', function main() {
let dataContract;
let identityPrivateKey;
let accumulatedFee;
let publicKeyId;

before(async () => {
const {
Expand Down Expand Up @@ -62,6 +63,7 @@ describe('getDocumentsHandlerFactory', function main() {
});
const pubKeyBase = publicKey.toBuffer()
.toString('base64');
publicKeyId = 0;

identityPrivateKey = privateKey;

Expand Down Expand Up @@ -107,7 +109,7 @@ describe('getDocumentsHandlerFactory', function main() {
dataContract = getDataContractFixture(identity.getId());

const dataContractStateTransition = dpp.dataContract.createStateTransition(dataContract);
dataContractStateTransition.sign(identity.getPublicKeyById(1), identityPrivateKey);
dataContractStateTransition.sign(identity.getPublicKeyById(publicKeyId), identityPrivateKey);

accumulatedFee += dataContractStateTransition.calculateFee();

Expand All @@ -128,7 +130,7 @@ describe('getDocumentsHandlerFactory', function main() {
const documentTransition = dpp.document.createStateTransition({
create: [document],
});
documentTransition.sign(identity.getPublicKeyById(1), identityPrivateKey);
documentTransition.sign(identity.getPublicKeyById(publicKeyId), identityPrivateKey);

accumulatedFee += documentTransition.calculateFee();

Expand All @@ -153,7 +155,7 @@ describe('getDocumentsHandlerFactory', function main() {
const documentTransition = dpp.document.createStateTransition({
create: [document],
});
documentTransition.sign(identity.getPublicKeyById(1), identityPrivateKey);
documentTransition.sign(identity.getPublicKeyById(publicKeyId), identityPrivateKey);

try {
await dapiClient.applyStateTransition(documentTransition);
Expand Down

0 comments on commit 99ca879

Please sign in to comment.