From ecc00e89f826650ee6cfa8cc2dd0fc49f302c79c Mon Sep 17 00:00:00 2001 From: naach Date: Tue, 27 Oct 2020 16:38:07 +0700 Subject: [PATCH] test(fromOutputScript): add regtest case to fromOutputScript test --- test/unit/Address.ts | 12 ++++++++++++ test/unit/fixtures/Address.json | 3 +++ 2 files changed, 15 insertions(+) diff --git a/test/unit/Address.ts b/test/unit/Address.ts index 28ddd878..68e452d3 100644 --- a/test/unit/Address.ts +++ b/test/unit/Address.ts @@ -1082,6 +1082,18 @@ describe("#Address", (): void => { }) } ) + + fixtures.p2shRegTest.forEach( + (address: string): void => { + const p2shAddress: any = bitbox.Address.fromOutputScript( + scriptPubKey, + "regtest" + ) + it(`generate regtest address from output script`, (): void => { + assert.equal(p2shAddress, address) + }) + } + ) }) describe("#details", () => { diff --git a/test/unit/fixtures/Address.json b/test/unit/fixtures/Address.json index 1d3a53e3..73cced88 100644 --- a/test/unit/fixtures/Address.json +++ b/test/unit/fixtures/Address.json @@ -225,6 +225,9 @@ "p2shTestnet": [ "bchtest:pz0qcslrqn7hr44hsszwl4lw5r6udkg6zqh2hmtpyr" ], + "p2shRegTest": [ + "bchreg:pz0qcslrqn7hr44hsszwl4lw5r6udkg6zqdkp6gj89" + ], "mainnetXPriv": [ { "xpriv": "xprvA2WwD9mk1Qd3rMjQ4ZRHvCWCj47jbXjY9Nf7npNRBmGUJngpRAvJzNpNgt7h2dDQ5huG7yFwYfz4PFJDPzkqfvBNPHnaio4yAbbUuv3EBnL",