diff --git a/README.md b/README.md index 65afa36..7a8cced 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,6 @@ The following **functions** are available to templates: * `upper(str string)`: convert string to upper case * `lower(str string)`: convert string to lower case * `convertCurrency(coin string, value int64)`: convert the smallest unit of a coin to a human readable unit -* `convertAction(coin string)`: return "Farmed" word for Chia coin or "Mined" for other coins * `formatBlockURL(coin string, hash string)`: return the URL on the explorer website of the coin of the block identified by its hash * `formatTransactionURL(coin string, hash string)`: return the URL on the explorer website of the coin of the diff --git a/notification.go b/notification.go index 25410d5..8d9eeff 100644 --- a/notification.go +++ b/notification.go @@ -93,7 +93,6 @@ func (t *TelegramNotifier) formatMessage(templateFileName string, attachment int "upper": strings.ToUpper, "lower": strings.ToLower, "convertCurrency": ConvertCurrency, - "convertAction": ConvertAction, "formatBlockURL": FormatBlockURL, "formatTransactionURL": FormatTransactionURL, } diff --git a/templates/block.tmpl b/templates/block.tmpl index 94dcca1..661133d 100644 --- a/templates/block.tmpl +++ b/templates/block.tmpl @@ -1 +1 @@ -🎉 *{{ convertAction .Pool.Coin }}* [#{{ .Block.Number }}]({{ formatBlockURL .Pool.Coin .Block.Hash }}) _{{ printf "%.6f" (convertCurrency .Pool.Coin .Block.Reward) }} {{ upper .Pool.Coin }}_ +🎉 *{{ if (eq .Pool.Coin "xch") }}Farmed{{ else }}Mined{{ end }}* [#{{ .Block.Number }}]({{ formatBlockURL .Pool.Coin .Block.Hash }}) _{{ printf "%.6f" (convertCurrency .Pool.Coin .Block.Reward) }} {{ upper .Pool.Coin }}_ \ No newline at end of file diff --git a/utils.go b/utils.go index fa57434..88c29dd 100644 --- a/utils.go +++ b/utils.go @@ -33,18 +33,6 @@ func ConvertMojo(value float64) float64 { return value / MojoToXCHDivider } -// ConvertAction returns "Miner" for Ethereum and "Farmer" for Chia -// Because Chia is farmed and not mined -func ConvertAction(coin string) (string, error) { - switch coin { - case "eth": - return "Mined", nil - case "xch": - return "Farmed", nil - } - return "", fmt.Errorf("Coin %s not supported", coin) -} - // FormatBlockURL returns the URL on the respective blockchain explorer given the coin and the block hash func FormatBlockURL(coin string, hash string) (string, error) { switch coin {