fix: rollback height->Height in x/upgrade plan.DueAt formatting (#9416)

* 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 <48813565+technicallyty@users.noreply.github.com>
This commit is contained in:
Robert Zaremba 2021-05-28 22:06:06 +02:00 committed by GitHub
parent 80330ec17c
commit 917fb765d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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())
}

View File

@ -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)
}

View File

@ -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: .",
},
}