diff --git a/core/constants/network-crypto.go b/core/constants/network-crypto.go index 5a140d2..fe54cf2 100644 --- a/core/constants/network-crypto.go +++ b/core/constants/network-crypto.go @@ -21,6 +21,10 @@ var ( } ) +func ToCryptoType(v string) CryptoType { + return cryptoTypeName[v] +} + func (ct CryptoType) String() string { return cryptoTypeID[ct] } diff --git a/core/constants/network-port.go b/core/constants/network-port.go index b0f5355..e4c6bad 100644 --- a/core/constants/network-port.go +++ b/core/constants/network-port.go @@ -24,6 +24,10 @@ var ( } ) +func ToPortType(v string) PortType { + return portTypeName[v] +} + func (pt PortType) String() string { return portTypeID[pt] }