HomePhabricator

[ecash-lib] Better behavior of withPrefix() method in Address class

Description

[ecash-lib] Better behavior of withPrefix() method in Address class

Summary: We could expect a user to call withPrefix("ecash:") on, say, every address in an array of ecash: addresses to ensure they all have the same prefix. Better to return unchanged if no prefix change than to throw an error. Do it that way.

Test Plan: npm test, CI

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: tobias_ruck

Differential Revision: https://reviews.bitcoinabc.org/D17623

Details

Event Timeline