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
- Branch
- better-prefix-behavior
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 32281 Build 64052: Build Diff ecash-lib-tests · ecash-lib-integration-tests · cashtab-tests · ecash-agora-tests · ecash-agora-integration-tests Build 64051: arc lint + arc unit
Event Timeline
modules/ecash-lib/src/address/address.test.ts | ||
---|---|---|
592 | this test description is copypasta, tho the test is right. we also fix this. |
modules/ecash-lib/src/address/address.ts | ||
---|---|---|
324–327 | how about |
Comment Actions
take suggestion, return this instead of new construction
modules/ecash-lib/src/address/address.ts | ||
---|---|---|
324–327 | much better, done |