From 917fb765d6f62728b84d04c9797b81861f139242 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 28 May 2021 22:06:06 +0200 Subject: [PATCH] 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> --- x/upgrade/abci_test.go | 4 ++-- x/upgrade/types/plan.go | 2 +- x/upgrade/types/plan_test.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x/upgrade/abci_test.go b/x/upgrade/abci_test.go index 9735ae619638..18f1752737b6 100644 --- a/x/upgrade/abci_test.go +++ b/x/upgrade/abci_test.go @@ -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()) } diff --git a/x/upgrade/types/plan.go b/x/upgrade/types/plan.go index 57ac95027664..cdafbed8895a 100644 --- a/x/upgrade/types/plan.go +++ b/x/upgrade/types/plan.go @@ -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) } diff --git a/x/upgrade/types/plan_test.go b/x/upgrade/types/plan_test.go index fe59fea52ffb..338b7378755d 100644 --- a/x/upgrade/types/plan_test.go +++ b/x/upgrade/types/plan_test.go @@ -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: .", }, }