Skip to content

Commit

Permalink
Change wording
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Treglia committed Nov 14, 2018
1 parent 90d964f commit fd99353
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (

const (
defaultMinimumFees = ""
defaultLimitTxSigs = 7
defaultTxSigLimit = 7
)

// BaseConfig defines the server's basic configuration
type BaseConfig struct {
// Tx minimum fee
MinFees string `mapstructure:"minimum_fees"`
LimitTxSigs int `mapstructure:"limit_tx_sigs"`
TxSigLimit int `mapstructure:"tx_sig_limit"`
}

// Config defines the server's top level configuration
Expand All @@ -27,7 +27,7 @@ type Config struct {
func (c *Config) SetMinimumFees(fees sdk.Coins) { c.MinFees = fees.String() }

// SetLimitTxSigs the total number of signatures per transaction
func (c *Config) SetLimitTxSigs(limitTxSigs int) { c.LimitTxSigs = limitTxSigs }
func (c *Config) SetLimitTxSigs(txSigLimit int) { c.TxSigLimit = txSigLimit }

// SetMinimumFee sets the minimum fee.
func (c *Config) MinimumFees() sdk.Coins {
Expand All @@ -41,5 +41,5 @@ func (c *Config) MinimumFees() sdk.Coins {
// DefaultConfig returns server's default configuration.
func DefaultConfig() *Config { return &Config{BaseConfig{
MinFees: defaultMinimumFees,
LimitTxSigs: defaultLimitTxSigs,
TxSigLimit: defaultTxSigLimit,
}} }
2 changes: 1 addition & 1 deletion server/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const defaultConfigTemplate = `# This is a TOML config file.
minimum_fees = "{{ .BaseConfig.MinFees }}"
# Limit total number of signatures per transaction
limit_tx_sigs = {{ .BaseConfig.LimitTxSigs }}
tx_sig_limit = {{ .BaseConfig.TxSigLimit }}
`

var configTemplate *template.Template
Expand Down
12 changes: 6 additions & 6 deletions types/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
DefaultLimitTxSigs = 7
DefaultTxSigLimit = 7
)

/*
Expand Down Expand Up @@ -52,7 +52,7 @@ func NewContext(ms MultiStore, header abci.Header, isCheckTx bool, logger log.Lo
c = c.WithVoteInfos(nil)
c = c.WithGasMeter(NewInfiniteGasMeter())
c = c.WithMinimumFees(Coins{})
c = c.WithLimitTxSigs(DefaultLimitTxSigs)
c = c.WithTxSigLimit(DefaultTxSigLimit)
return c
}

Expand Down Expand Up @@ -146,7 +146,7 @@ const (
contextKeyVoteInfos
contextKeyGasMeter
contextKeyMinimumFees
contextKeyLimitTxSigs
contextKeyTxSigLimit
)

// NOTE: Do not expose MultiStore.
Expand Down Expand Up @@ -180,7 +180,7 @@ func (c Context) IsCheckTx() bool { return c.Value(contextKeyIsCheckTx).(bool) }

func (c Context) MinimumFees() Coins { return c.Value(contextKeyMinimumFees).(Coins) }

func (c Context) LimitTxSigs() int { return c.Value(contextKeyLimitTxSigs).(int) }
func (c Context) TxSigLimit() int { return c.Value(contextKeyTxSigLimit).(int) }

func (c Context) WithMultiStore(ms MultiStore) Context { return c.withValue(contextKeyMultiStore, ms) }

Expand Down Expand Up @@ -235,8 +235,8 @@ func (c Context) WithMinimumFees(minFees Coins) Context {
return c.withValue(contextKeyMinimumFees, minFees)
}

func (c Context) WithLimitTxSigs(maxSigsCheck int) Context {
return c.withValue(contextKeyLimitTxSigs, maxSigsCheck)
func (c Context) WithTxSigLimit(maxSigsCheck int) Context {
return c.withValue(contextKeyTxSigLimit, maxSigsCheck)
}

// Cache the multistore and return a new cached context. The cached context is
Expand Down
2 changes: 1 addition & 1 deletion x/auth/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func NewAnteHandler(am AccountKeeper, fck FeeCollectionKeeper) sdk.AnteHandler {
fck.AddCollectedFees(newCtx, stdTx.Fee.Amount)
}

for i := 0; i < len(stdSigs) && i < ctx.LimitTxSigs(); i++ {
for i := 0; i < len(stdSigs) && i < ctx.TxSigLimit(); i++ {
// check signature, return account with incremented nonce
signerAccs[i], res = processSig(newCtx, signerAccs[i], stdSigs[i], signBytesList[i], simulate)
if !res.IsOK() {
Expand Down

0 comments on commit fd99353

Please sign in to comment.