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.
Details
Details
- Reviewers
PiRK - Group Reviewers
Restricted Project - Commits
- rABC12cff4fe1b5c: [ecash-lib] Better behavior of withPrefix() method in Address class
npm test, CI
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
modules/ecash-lib/src/address/address.test.ts | ||
---|---|---|
592 ↗ | (On Diff #52483) | this test description is copypasta, tho the test is right. we also fix this. |
modules/ecash-lib/src/address/address.ts | ||
---|---|---|
324–327 ↗ | (On Diff #52483) | how about |
Comment Actions
take suggestion, return this instead of new construction
modules/ecash-lib/src/address/address.ts | ||
---|---|---|
324–327 ↗ | (On Diff #52483) | much better, done |