Skip to content

Commit

Permalink
Merge pull request #406 from GridPlus/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
douglance authored Jun 1, 2022
2 parents 9cba8af + feb941c commit 7a1b3ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gridplus-sdk",
"version": "1.3.3",
"version": "1.3.4",
"description": "SDK to interact with GridPlus Lattice1 device",
"scripts": {
"build": "tsc -p tsconfig.json",
Expand Down
12 changes: 6 additions & 6 deletions src/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import {
ethMsgProtocol,
HANDLE_LARGER_CHAIN_ID,
MAX_CHAIN_ID_BYTES,
signingSchema,
signingSchema
} from './constants';
import {
buildSignerPathBuf,
ensureHexBuffer,
fixLen,
isAsciiStr,
splitFrames,
splitFrames
} from './util';

const buildEthereumMsgRequest = function (input) {
Expand Down Expand Up @@ -415,14 +415,14 @@ const buildEthRawTx = function (tx, sig, address) {
// See: https://github.com/ethereumjs/ethereumjs-tx/blob/master/src/transaction.ts#L187
newRawTx.push(stripZeros(newSig.r));
newRawTx.push(stripZeros(newSig.s));
let rlpEncodedWithSig = rlpEncode(newRawTx);
let rlpEncodedWithSig = Buffer.from(rlpEncode(newRawTx));
if (tx.type) {
rlpEncodedWithSig = Buffer.concat([
Buffer.from([tx.type]),
rlpEncodedWithSig,
]);
}
return { rawTx: Buffer.from(rlpEncodedWithSig).toString('hex'), sigWithV: newSig };
return { rawTx: rlpEncodedWithSig.toString('hex'), sigWithV: newSig };
};

// Attach a recovery parameter to a signature by brute-forcing ECRecover
Expand Down Expand Up @@ -919,9 +919,9 @@ function get_personal_sign_prefix(L) {

function get_rlp_encoded_preimage(rawTx, txType) {
if (txType) {
return Buffer.concat([Buffer.from([txType]), rlpEncode(rawTx)]);
return Buffer.concat([Buffer.from([txType]), Buffer.from(rlpEncode(rawTx))]);
} else {
return rlpEncode(rawTx);
return Buffer.from(rlpEncode(rawTx));
}
}

Expand Down

0 comments on commit 7a1b3ab

Please sign in to comment.