mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-25 15:55:18 +00:00
21 lines
336 B
Go
21 lines
336 B
Go
|
package util
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"strings"
|
||
|
|
||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||
|
)
|
||
|
|
||
|
func PrettyPrintCoins(coins sdk.Coins) string {
|
||
|
if len(coins) == 0 {
|
||
|
return ""
|
||
|
}
|
||
|
|
||
|
out := make([]string, 0, len(coins))
|
||
|
for _, coin := range coins {
|
||
|
out = append(out, coin.String())
|
||
|
}
|
||
|
return fmt.Sprintf("- %s", strings.Join(out, "\n- "))
|
||
|
}
|