Skip to content
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 @@ -12,8 +12,8 @@ const InvalidMasternodeIdentityError = require('./errors/InvalidMasternodeIdenti
function createMasternodeIdentityFactory(
dpp,
identityRepository,
getWithdrawPubKeyTypeFromPayoutScript,
getPublicKeyFromPayoutScript,
// getWithdrawPubKeyTypeFromPayoutScript,
// getPublicKeyFromPayoutScript,
) {
/**
* @typedef createMasternodeIdentity
Expand All @@ -29,7 +29,7 @@ function createMasternodeIdentityFactory(
identifier,
pubKeyData,
pubKeyType,
payoutScript,
// payoutScript,
) {
const publicKeys = [{
id: 0,
Expand All @@ -41,18 +41,19 @@ function createMasternodeIdentityFactory(
data: Buffer.from(pubKeyData),
}];

if (payoutScript) {
const withdrawPubKeyType = getWithdrawPubKeyTypeFromPayoutScript(payoutScript);

publicKeys.push({
id: 1,
type: withdrawPubKeyType,
purpose: IdentityPublicKey.PURPOSES.WITHDRAW,
securityLevel: IdentityPublicKey.SECURITY_LEVELS.CRITICAL,
readOnly: false,
data: getPublicKeyFromPayoutScript(payoutScript, withdrawPubKeyType),
});
}
// TODO: Enable keys when we have support of non unique keys in DPP
// if (payoutScript) {
// const withdrawPubKeyType = getWithdrawPubKeyTypeFromPayoutScript(payoutScript);
//
// publicKeys.push({
// id: 1,
// type: withdrawPubKeyType,
// purpose: IdentityPublicKey.PURPOSES.WITHDRAW,
// securityLevel: IdentityPublicKey.SECURITY_LEVELS.CRITICAL,
// readOnly: false,
// data: getPublicKeyFromPayoutScript(payoutScript, withdrawPubKeyType),
// });
// }

const identity = new Identity({
protocolVersion: dpp.getProtocolVersion(),
Expand Down
2 changes: 1 addition & 1 deletion packages/js-drive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"echo": "node scripts/echo",
"lint": "eslint .",
"test": "yarn run test:coverage",
"test:coverage": "nyc --check-coverage --stmts=93 --branch=85 --funcs=90 --lines=90 yarn run mocha './test/unit/**/*.spec.js' './test/integration/**/*.spec.js'",
"test:coverage": "nyc --check-coverage --stmts=93 --branch=85 --funcs=90 --lines=88 yarn run mocha './test/unit/**/*.spec.js' './test/integration/**/*.spec.js'",
"test:unit": "mocha './test/unit/**/*.spec.js'",
"test:integration": "mocha './test/integration/**/*.spec.js'"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ function expectDeterministicAppHashFactory(groveDBStore) {
return expectDeterministicAppHash;
}

describe('synchronizeMasternodeIdentitiesFactory', function main() {
// TODO: Enable keys when we have support of non unique keys in DPP
describe.skip('synchronizeMasternodeIdentitiesFactory', function main() {
this.timeout(10000);
let container;
let coreHeight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ describe('createMasternodeIdentityFactory', () => {
}
});

it('should create masternode identity with payoutScript public key', async () => {
// TODO: Enable keys when we have support of non unique keys in DPP
it.skip('should create masternode identity with payoutScript public key', async () => {
const identityId = generateRandomIdentifier();
const pubKeyData = Buffer.from([0]);
const pubKeyType = IdentityPublicKey.TYPES.ECDSA_HASH160;
Expand Down