Skip to content

Commit

Permalink
Consistency w/other branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkadiy Kukarkin committed Jan 18, 2017
1 parent 839a4ee commit 698f267
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/metadata/signatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,9 @@ function signStatement (stmt: StatementMsg, publisherId: PublisherId): Promise<S
})
}

function calculateSignature (stmt: StatementMsg, signer: { sign: (bytes: Buffer) => string }): Promise<Buffer> {
return new Promise((resolve, reject) => {
let bytes
try {
// encode statement protobuf
bytes = pb.stmt.Statement.encode(stmt)
} catch (err) {
return reject(err)
}

// sign the encoded statement message and set the signature
function calculateSignature (stmt: StatementMsg, signer: { sign: (bytes: Buffer) => Buffer }): Promise<Buffer> {
return Promise.resolve().then(() => {
const bytes = pb.stmt.Statement.encode(stmt)
return signBuffer(signer, bytes)
})
}
Expand Down

0 comments on commit 698f267

Please sign in to comment.