Skip to content

Commit

Permalink
chore(js-sdk): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pshenmic committed Dec 24, 2024
1 parent 8f79b69 commit 9925a68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { signStateTransition } from '../../signStateTransition';
/**
* Broadcast document onto the platform
*
* @param {Platform} this - bound instance class
* @param {Object} documents
* @param {ExtendedDocument[]} [documents.create]
* @param {ExtendedDocument[]} [documents.replace]
* @param {ExtendedDocument[]} [documents.delete]
* @param identity - identity
* @param keyIndex - identity key index
*/
export default async function broadcast(
this: Platform,
Expand All @@ -21,7 +21,6 @@ export default async function broadcast(
delete?: ExtendedDocument[],
},
identity: any,
keyIndex : number,
): Promise<any> {
this.logger.debug('[Document#broadcast] Broadcast documents', {
create: documents.create?.length || 0,
Expand Down Expand Up @@ -54,7 +53,7 @@ export default async function broadcast(

this.logger.silly('[Document#broadcast] Created documents batch transition');

await signStateTransition(this, documentsBatchTransition, identity, keyIndex ?? 1);
await signStateTransition(this, documentsBatchTransition, identity, 1);

// Broadcast state transition also wait for the result to be obtained
await broadcastStateTransition(this, documentsBatchTransition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ export async function transfer(
receiver: Identity,
sender: Identity,
): Promise<any> {
this.logger.debug('[Document#transfer] Transfer document');
this.logger.debug(`[Document#transfer] Transfer document ${document.getId().toString()}
from ${sender.getId().toString} to {${receiver.getId().toString()}`);
await this.initialize();

const identityContractNonce = await this.nonceManager
.bumpIdentityContractNonce(sender.getId(), document.getDataContractId());

const documentsBatchTransition = document
.createTransferTransition(receiver.getId(), BigInt(identityContractNonce));
.createTransferStateTransition(receiver.getId(), BigInt(identityContractNonce));

await signStateTransition(this, documentsBatchTransition, sender, 1);

Expand Down

0 comments on commit 9925a68

Please sign in to comment.