Skip to content

Commit

Permalink
refactor(common-scripts): default allowlist for bitcoin address decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
homura committed Jun 14, 2024
1 parent 664e810 commit 1737c2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/common-scripts/src/omnilock-bitcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const BTC_PREFIX = "CKB (Bitcoin Layer) transaction: 0x";
*/
export function decodeAddress(
address: string,
allows: SupportedBtcAddressType[]
allows: SupportedBtcAddressType[] = ["P2WPKH", "P2PKH"]
): ArrayLike<number> {
const btcAddressFlagSize = 1;
const hashSize = 20;
Expand Down
2 changes: 1 addition & 1 deletion packages/common-scripts/src/omnilock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function createOmnilockScript(
[IdentityFlagsType.IdentityFlagsBitcoin],
bitcoin.decodeAddress(
omnilockInfo.auth.content,
omnilockInfo.auth.allows || ["P2WPKH", "P2PKH"]
omnilockInfo.auth.allows
),
omnilockArgs
)
Expand Down

0 comments on commit 1737c2f

Please sign in to comment.