Skip to content

Commit bbc750c

Browse files
authored
fix: make identity key add work with v0.24 (#16)
* chore: update dash to 0.24.3 * fix: update identity add key with 0.24 changes * chore: add wasm-dpp required for identity key additions
1 parent c4fdd9e commit bbc750c

File tree

3 files changed

+137
-134
lines changed

3 files changed

+137
-134
lines changed

1-Identities-and-Names/identity-update-add-key.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// See https://dashplatform.readme.io/docs/tutorial-update-an-identity
22
const Dash = require('dash');
3-
const IdentityPublicKey = require('@dashevo/dpp/lib/identity/IdentityPublicKey');
3+
const { IdentityPublicKey, IdentityPublicKeyWithWitness } = require('@dashevo/wasm-dpp');
44
const dotenv = require('dotenv');
55
dotenv.config();
66

@@ -30,13 +30,14 @@ const updateIdentityAddKey = async () => {
3030

3131
const identityPublicKey = identityPrivateKey.toPublicKey().toBuffer();
3232

33-
const newPublicKey = new IdentityPublicKey({
33+
const newPublicKey = new IdentityPublicKeyWithWitness({
3434
id: newKeyId,
3535
type: IdentityPublicKey.TYPES.ECDSA_SECP256K1,
36+
data: identityPublicKey,
3637
purpose: IdentityPublicKey.PURPOSES.AUTHENTICATION,
3738
securityLevel: IdentityPublicKey.SECURITY_LEVELS.HIGH,
38-
data: identityPublicKey,
3939
readOnly: false,
40+
signature: Buffer.alloc(0),
4041
});
4142

4243
const updateAdd = {

0 commit comments

Comments
 (0)