Skip to content

Commit

Permalink
fix: update version buffer size for pox addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
janniks committed Jul 19, 2022
1 parent 62355bc commit b7acc7d
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 263 deletions.
16 changes: 9 additions & 7 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
Expand Up @@ -26,7 +26,7 @@
"devDependencies": {
"@changesets/cli": "^2.23.0",
"@janniks/typedoc-plugin-monorepo": "^0.4.2-1",
"@janniks/typedoc-theme-stacks": "^1.0.1",
"@janniks/typedoc-theme-stacks": "^1.0.3",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^22.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/stacking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"devDependencies": {
"@types/jest": "^26.0.22",
"bitcoinjs-lib": "^5.2.0",
"jest": "^26.6.3",
"jest-fetch-mock": "^3.0.3",
"jest-module-name-mapper": "^0.1.5",
Expand Down
8 changes: 4 additions & 4 deletions packages/stacking/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ export class StackingClient {
burnBlockHeight: number;
}) {
const { hashMode, data } = decodeBtcAddress(poxAddress);
const hashModeBuffer = bufferCV(toBuffer(BigInt(hashMode)));
const hashModeBuffer = bufferCV(toBuffer(BigInt(hashMode), 1));
const hashbytes = bufferCV(data);
const address = tupleCV({
hashbytes,
Expand Down Expand Up @@ -565,7 +565,7 @@ export class StackingClient {

if (poxAddress) {
const { hashMode, data } = decodeBtcAddress(poxAddress);
const hashModeBuffer = bufferCV(toBuffer(BigInt(hashMode)));
const hashModeBuffer = bufferCV(toBuffer(BigInt(hashMode), 1));
const hashbytes = bufferCV(data);
address = someCV(
tupleCV({
Expand Down Expand Up @@ -612,7 +612,7 @@ export class StackingClient {
nonce?: IntegerType;
}) {
const { hashMode, data } = decodeBtcAddress(poxAddress);
const hashModeBuffer = bufferCV(toBuffer(BigInt(hashMode)));
const hashModeBuffer = bufferCV(toBuffer(BigInt(hashMode), 1));
const hashbytes = bufferCV(data);
const address = tupleCV({
hashbytes,
Expand Down Expand Up @@ -654,7 +654,7 @@ export class StackingClient {
rewardCycle: number;
}) {
const { hashMode, data } = decodeBtcAddress(poxAddress);
const hashModeBuffer = bufferCV(toBuffer(BigInt(hashMode)));
const hashModeBuffer = bufferCV(toBuffer(BigInt(hashMode), 1));
const hashbytes = bufferCV(data);
const address = tupleCV({
hashbytes,
Expand Down

0 comments on commit b7acc7d

Please sign in to comment.