Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Lee <[email protected]>
  • Loading branch information
fuxingloh and ivan-zynesis authored Sep 23, 2021
1 parent 63b8fc9 commit 7c70b6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/jellyfish-address/src/script/P2SH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ export function fromScriptP2SH (script: Script, network: NetworkName): string |
return toBase58Check(buffer, prefix)
}

function isBase58CheckP2PSH (decoded: DecodedBase58Check, network: NetworkName): boolean {
function isBase58CheckP2SH (decoded: DecodedBase58Check, network: NetworkName): boolean {
return decoded.prefix === getNetwork(network).scriptHashPrefix &&
decoded.buffer.length === 20
}

export function fromBase58CheckP2SH (decoded: DecodedBase58Check, network: NetworkName): Script | undefined {
if (!isBase58CheckP2PSH(decoded, network)) {
if (!isBase58CheckP2SH(decoded, network)) {
return undefined
}

Expand Down

0 comments on commit 7c70b6a

Please sign in to comment.