From fd99353a5bb024f6313f30d851c76e5883b0aac0 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Wed, 14 Nov 2018 01:16:57 +0000 Subject: [PATCH] Change wording --- server/config/config.go | 8 ++++---- server/config/toml.go | 2 +- types/context.go | 12 ++++++------ x/auth/ante.go | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/server/config/config.go b/server/config/config.go index 668128c5cb44..086d03d61620 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -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 @@ -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 { @@ -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, }} } diff --git a/server/config/toml.go b/server/config/toml.go index e989049ac5ad..3abf0ed30103 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -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 diff --git a/types/context.go b/types/context.go index 8028b8e1b1d3..070ec532fc95 100644 --- a/types/context.go +++ b/types/context.go @@ -13,7 +13,7 @@ import ( ) const ( - DefaultLimitTxSigs = 7 + DefaultTxSigLimit = 7 ) /* @@ -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 } @@ -146,7 +146,7 @@ const ( contextKeyVoteInfos contextKeyGasMeter contextKeyMinimumFees - contextKeyLimitTxSigs + contextKeyTxSigLimit ) // NOTE: Do not expose MultiStore. @@ -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) } @@ -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 diff --git a/x/auth/ante.go b/x/auth/ante.go index b198c50ba4b6..4cd8e07561f1 100644 --- a/x/auth/ante.go +++ b/x/auth/ante.go @@ -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() {