Closed OttoAllmendinger closed 4 years ago
I'm wondering whether it would be useful to have a ticket to track the deprecation of isValidCoin and its replacement with isValidNetwork.
It is a bit of a cosmetic issue so I decided it is not worth the backlog spam
See individual commits
00d19ce src/coins.js: add getMainnet/getTestnet
These methods are useful when grouping tests
3e22726 src/coins.js: add isDash to isValidNetwork
99c7060 src/coins.js: isValidCoin -> isValidNetwork
The function takes
network
as an argument after all.Add deprecation notice for old func.
b75742a src/networks.js: add tests
Make sure values are distinct unless explicitly grouped.
This method uncovered bug BG-16466.
Issue: BG-16465
06f0b92 src/networks.js: define coin network names
We need to describe some more relationships between networks. For instance, it is very useful to define
getMainnet(network)
andgetTestnet(network)
.These methods would fit well in
coins.js
and can be implemented using object equality on the constants defined innetwork.js
. However, importingnetwork.js
fromcoins.js
would lead to a circular import.This change allows using
coin.js
to contain utility methods fornetwork.js
without having circular import problems.