Skip to content

Commit

Permalink
fix: rollback height->Height in x/upgrade plan.DueAt formatting (#9416)
Browse files Browse the repository at this point in the history
* fix: rollback height->Height in x/upgrade plan.DueAt formatting

* fix test

make test string match function rollback

* fix abci_test.go

lowercase height

Co-authored-by: Tyler <[email protected]>
  • Loading branch information
robert-zaremba and technicallyty authored May 28, 2021
1 parent 80330ec commit 917fb76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions x/upgrade/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ func TestNoSpuriousUpgrades(t *testing.T) {
func TestPlanStringer(t *testing.T) {
require.Equal(t, `Upgrade Plan
Name: test
Height: 100
height: 100
Info: .`, types.Plan{Name: "test", Height: 100, Info: ""}.String())

require.Equal(t, fmt.Sprintf(`Upgrade Plan
Name: test
Height: 100
height: 100
Info: .`), types.Plan{Name: "test", Height: 100, Info: ""}.String())
}

Expand Down
2 changes: 1 addition & 1 deletion x/upgrade/types/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ func (p Plan) ShouldExecute(ctx sdk.Context) bool {

// DueAt is a string representation of when this plan is due to be executed
func (p Plan) DueAt() string {
return fmt.Sprintf("Height: %d", p.Height)
return fmt.Sprintf("height: %d", p.Height)
}
4 changes: 2 additions & 2 deletions x/upgrade/types/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ func TestPlanString(t *testing.T) {
Info: "https://foo.bar/baz",
Height: 7890,
},
expect: "Upgrade Plan\n Name: by height\n Height: 7890\n Info: https://foo.bar/baz.",
expect: "Upgrade Plan\n Name: by height\n height: 7890\n Info: https://foo.bar/baz.",
},
"neither": {
p: types.Plan{
Name: "almost-empty",
},
expect: "Upgrade Plan\n Name: almost-empty\n Height: 0\n Info: .",
expect: "Upgrade Plan\n Name: almost-empty\n height: 0\n Info: .",
},
}

Expand Down

0 comments on commit 917fb76

Please sign in to comment.