Skip to content

Commit

Permalink
test: added more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersuweijie committed Mar 28, 2024
1 parent da0231c commit dd2bbfa
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/custom_queriers/custom_queriers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,22 @@ func TestWithTfAndAllianceButCallTf(t *testing.T) {
_, err = querier(sdk.Context{}, bz)
require.Fail(t, "should panic")
}

func TestWithTfAndAllianceButRandomCall(t *testing.T) {
tfQuerier := bindings.CustomQuerier(&bindings.QueryPlugin{})
allianceQuerier := alliancebindings.CustomQuerier(&alliancebindings.QueryPlugin{})
querier := CustomQueriers(tfQuerier, allianceQuerier)

query := sdk.NewCoin("denom", sdk.NewInt(1))
bz, err := json.Marshal(query)
require.NoError(t, err)

// We call querier but it will panic because we don't have a keeper
_, err = querier(sdk.Context{}, bz)
require.Error(t, err)
}

func TestRegisterCustomPlugins(t *testing.T) {
options := RegisterCustomPlugins(nil, nil, nil)
require.Len(t, options, 2)
}

0 comments on commit dd2bbfa

Please sign in to comment.