mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-05 18:43:47 +00:00
Add cashaddr address format for bitcoin cash
This commit is contained in:
@@ -553,7 +553,7 @@ it('Allows selection of slimcoin testnet', function(done) {
|
||||
it('Allows selection of bitcoin cash', function(done) {
|
||||
var params = {
|
||||
selectText: "BCH - Bitcoin Cash",
|
||||
firstAddress: "1JKvb6wKtsjNoCRxpZ4DGrbniML7z5U16A",
|
||||
firstAddress: "bitcoincash:qzlquk7w4hkudxypl4fgv8x279r754dkvur7jpcsps",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
@@ -3120,10 +3120,26 @@ it('Warns when entropy is filtered and discarded', function(done) {
|
||||
});
|
||||
});
|
||||
|
||||
// Bitcoin Cash address can be set to use cashaddr format
|
||||
it('Can use cashaddr format for bitcoin cash addresses', function(done) {
|
||||
driver.executeScript(function() {
|
||||
$(".use-bch-cashaddr-addresses").prop("checked", true);
|
||||
});
|
||||
driver.findElement(By.css('.phrase'))
|
||||
.sendKeys("abandon abandon ability");
|
||||
selectNetwork("BCH - Bitcoin Cash");
|
||||
driver.sleep(generateDelay).then(function() {
|
||||
getFirstAddress(function(address) {
|
||||
expect(address).toBe("bitcoincash:qzlquk7w4hkudxypl4fgv8x279r754dkvur7jpcsps");
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Bitcoin Cash address can be set to use bitpay format
|
||||
it('Can use bitpay format for bitcoin cash addresses', function(done) {
|
||||
driver.executeScript(function() {
|
||||
$(".use-bitpay-addresses").prop("checked", true);
|
||||
$(".use-bch-bitpay-addresses").prop("checked", true);
|
||||
});
|
||||
driver.findElement(By.css('.phrase'))
|
||||
.sendKeys("abandon abandon ability");
|
||||
@@ -3136,6 +3152,22 @@ it('Can use bitpay format for bitcoin cash addresses', function(done) {
|
||||
});
|
||||
});
|
||||
|
||||
// Bitcoin Cash address can be set to use legacy format
|
||||
it('Can use legacy format for bitcoin cash addresses', function(done) {
|
||||
driver.executeScript(function() {
|
||||
$(".use-bch-legacy-addresses").prop("checked", true);
|
||||
});
|
||||
driver.findElement(By.css('.phrase'))
|
||||
.sendKeys("abandon abandon ability");
|
||||
selectNetwork("BCH - Bitcoin Cash");
|
||||
driver.sleep(generateDelay).then(function() {
|
||||
getFirstAddress(function(address) {
|
||||
expect(address).toBe("1JKvb6wKtsjNoCRxpZ4DGrbniML7z5U16A");
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// End of tests ported from old suit, so no more comments above each test now
|
||||
|
||||
it('Can generate more addresses from a custom index', function(done) {
|
||||
|
||||
Reference in New Issue
Block a user