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

tests: update functional tests to the latest Drive #259

Merged
merged 2 commits into from
Apr 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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