Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Feb 14, 2024
1 parent e7e10fe commit 9b7f2f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Message {
/**
* Number representing the message version.
*/
public version?: number;
public version: number;

constructor(options: { data: Uint8Array; signature?: Uint8Array; address?: IAddress; version?: number }) {
this.data = options.data;
Expand Down Expand Up @@ -60,14 +60,11 @@ export class MessageComputer {
}

unpackMessage(packedMessage: { message: string; signature?: string; address?: string; version?: number }): Message {
let dataHex = this.trimHexPrefix(packedMessage.message);
const dataHex = this.trimHexPrefix(packedMessage.message);
const data = Buffer.from(dataHex, "hex");

let signature: Uint8Array | undefined = undefined;
if (packedMessage.signature) {
let signatureHex = this.trimHexPrefix(packedMessage.signature);
signature = Buffer.from(signatureHex, "hex");
}
const signatureHex = this.trimHexPrefix(packedMessage.signature || "");
const signature = Buffer.from(signatureHex, "hex");

let address: Address | undefined = undefined;
if (packedMessage.address) {
Expand Down
2 changes: 1 addition & 1 deletion src/transactionsFactories/relayedTransactionsFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface IConfig {
}

/**
* Use this class to create both RelyedV1 and RelayedV2 transactions.
* Use this class to create both RelayedV1 and RelayedV2 transactions.
*/
export class RelayedTransactionsFactory {
private readonly config: IConfig;
Expand Down

0 comments on commit 9b7f2f2

Please sign in to comment.