chainreg: export ChainCode to new pkg

Moves chainCode from the lnd package to the chainreg package,
where it is exported and can be used by other packages.
This commit is contained in:
Eugene
2020-09-29 08:56:18 -07:00
committed by eugene
parent afb6ad295e
commit 933b959aa8
8 changed files with 80 additions and 67 deletions

25
chainreg/chaincode.go Normal file
View File

@@ -0,0 +1,25 @@
package chainreg
// ChainCode is an enum-like structure for keeping track of the chains
// currently supported within lnd.
type ChainCode uint32
const (
// BitcoinChain is Bitcoin's chain.
BitcoinChain ChainCode = iota
// LitecoinChain is Litecoin's chain.
LitecoinChain
)
// String returns a string representation of the target ChainCode.
func (c ChainCode) String() string {
switch c {
case BitcoinChain:
return "bitcoin"
case LitecoinChain:
return "litecoin"
default:
return "kekcoin"
}
}