File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,12 +5,14 @@ import (
55 "encoding/json"
66 "fmt"
77 "os"
8+ "sort"
89 "strings"
910
1011 "github.com/spf13/cobra"
1112
1213 "github.com/oasisprotocol/oasis-core/go/common/crypto/signature"
1314 consensusPretty "github.com/oasisprotocol/oasis-core/go/common/prettyprint"
15+ "github.com/oasisprotocol/oasis-core/go/consensus/api/transaction"
1416 registry "github.com/oasisprotocol/oasis-core/go/registry/api"
1517 staking "github.com/oasisprotocol/oasis-core/go/staking/api"
1618 "github.com/oasisprotocol/oasis-core/go/staking/api/token"
@@ -182,8 +184,15 @@ var showCmd = &cobra.Command{
182184
183185 fmt .Printf ("Gas costs for network %s:" , npa .PrettyPrintNetwork ())
184186 fmt .Println ()
185- for kind , cost := range consensusParams .GasCosts {
186- fmt .Printf (" - %-26s %d" , kind + ":" , cost )
187+
188+ // Print costs ordered by kind.
189+ kinds := make ([]string , 0 , len (consensusParams .GasCosts ))
190+ for k := range consensusParams .GasCosts {
191+ kinds = append (kinds , string (k ))
192+ }
193+ sort .Strings (kinds )
194+ for _ , k := range kinds {
195+ fmt .Printf (" - %-26s %d" , k + ":" , consensusParams .GasCosts [transaction .Op (k )])
187196 fmt .Println ()
188197 }
189198 return
You can’t perform that action at this time.
0 commit comments