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

Commit

Permalink
tests: update functional tests to the latest Drive (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Shuplenkov authored Apr 18, 2020
1 parent 29c9b6d commit 4741e9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('getDataContractHandlerFactory', function main() {

// eslint-disable-next-line no-underscore-dangle
const publicKeyHash = PublicKey.fromBuffer(Buffer.from(pubKeyBase, 'base64'))._getID();
publicKeyId = 1;
publicKeyId = 0;

await coreAPI.generateToAddress(500, addressString);

Expand Down
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 4741e9d

Please sign in to comment.