Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arhtudormorar committed Sep 23, 2024
1 parent 24742d7 commit 0121f34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hwProvider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,20 @@ describe("test hwProvider", () => {
data: Buffer.from("Hello World"),
address: Address.fromBech32("erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"),
version: 42
});
});

const messageComputer = new MessageComputer();
const serializedMessage = messageComputer.computeBytesForSigning(messageToSign);

hwApp.messageSignature = "abba";

const messageComputer = new MessageComputer();

const signedMessage = await hwProvider.signMessage(messageToSign);

assert.equal(Buffer.from(signedMessage.data).toString(), "Hello World");
assert.equal(signedMessage.address?.toString(), "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th");
assert.equal(signedMessage.version, 42);
assert.equal(Buffer.from(signedMessage.signature!).toString("hex"), "abba");
assert.deepEqual(serializedMessage, messageComputer.computeBytesForSigning(signedMessage));
assert.deepEqual(messageComputer.computeBytesForSigning(messageToSign), messageComputer.computeBytesForSigning(signedMessage));
});
});

Expand Down

0 comments on commit 0121f34

Please sign in to comment.