Skip to content

Commit

Permalink
Removes GasAdjustment from ChainSpec override (#717) (#751)
Browse files Browse the repository at this point in the history
(cherry picked from commit a84f42d)

Co-authored-by: Reece Williams <[email protected]>
  • Loading branch information
mergify[bot] and Reecepbcups authored Sep 7, 2023
1 parent 9fdcff6 commit 64a7179
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
8 changes: 2 additions & 6 deletions chainspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ type ChainSpec struct {
// Must be set.
Version string

// GasAdjustment and NoHostMount are pointers in ChainSpec
// NoHostMount is a pointers in ChainSpec
// so zero-overrides can be detected from omitted overrides.
GasAdjustment *float64
NoHostMount *bool
NoHostMount *bool

// Embedded ChainConfig to allow for simple JSON definition of a ChainSpec.
ibc.ChainConfig
Expand Down Expand Up @@ -127,9 +126,6 @@ func (s *ChainSpec) applyConfigOverrides(cfg ibc.ChainConfig) (*ibc.ChainConfig,
cfg.ChainID = prefix + s.suffix()
}

if s.GasAdjustment != nil {
cfg.GasAdjustment = *s.GasAdjustment
}
if s.NoHostMount != nil {
cfg.NoHostMount = *s.NoHostMount
}
Expand Down
13 changes: 0 additions & 13 deletions chainspec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,6 @@ func TestChainSpec_Config(t *testing.T) {
baseCfg, err := baseSpec.Config(zaptest.NewLogger(t))
require.NoError(t, err)

t.Run("GasAdjustment", func(t *testing.T) {
g := float64(1234.5)
require.NotEqual(t, baseCfg.GasAdjustment, g)

s := baseSpec
s.GasAdjustment = &g

cfg, err := s.Config(zaptest.NewLogger(t))
require.NoError(t, err)

require.Equal(t, g, cfg.GasAdjustment)
})

t.Run("NoHostMount", func(t *testing.T) {
m := true
require.NotEqual(t, baseCfg.NoHostMount, m)
Expand Down

0 comments on commit 64a7179

Please sign in to comment.