-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from pvyhnal-generalbytes/BPUB-805-convert-bech32
Bpub 805 convert bech32
- Loading branch information
Showing
3 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
bitrafael-client/src/test/java/com/generalbytes/bitrafael/api/wallet/bch/Bech32Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.generalbytes.bitrafael.api.wallet.bch; | ||
|
||
import org.bitcoinj.core.Address; | ||
import org.bitcoinj.params.MainNetParams; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class Bech32Test { | ||
@Test | ||
public void test() { | ||
assertEquals("11DstTXVTvo8DfczCQws6CHV718u74VV2", | ||
new Address(MainNetParams.get(), Bech32.decodeCashAddress("qqqq4077ywes2cmda80crheea4m7zznszvk5lqedw9")).toBase58()); | ||
assertEquals("1P3GQYtcWgZHrrJhUa4ctoQ3QoCU2F65nz", | ||
new Address(MainNetParams.get(), Bech32.decodeCashAddress("bitcoincash:qrcuqadqrzp2uztjl9wn5sthepkg22majyxw4gmv6p")).toBase58()); | ||
assertEquals("17WXKozdmX7zfjPRLZtJz5Avth4E3kq3xn", | ||
new Address(MainNetParams.get(), Bech32.decodeCashAddress("qprkvgvvlvn856mkhuuh0kxtu7ngnu2sr5xhsvwye4")).toBase58()); | ||
} | ||
} |