Skip to content

Commit

Permalink
build(deps): use tagged version of consumer plugin (#4043) (#4044)
Browse files Browse the repository at this point in the history
(cherry picked from commit b387b0f)

Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
mergify[bot] and julienrbrt authored Mar 20, 2024
1 parent bb222a2 commit acc2e5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions ignite/internal/plugin/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ import (
"github.com/ignite/cli/v28/ignite/services/plugin"
)

// TODO use released version of app-consumer.
const consumerPlugin = "github.com/ignite/apps/consumer"
const (
PluginConsumerVersion = "consumer/v0.1.0"
PluginConsumerPath = "github.com/ignite/apps/consumer@" + PluginConsumerVersion
)

// ConsumerWriteGenesis writes validators in the consumer module genesis.
// NOTE(tb): Using a plugin for this task avoids having the interchain-security
// dependency in Ignite.
func ConsumerWriteGenesis(ctx context.Context, c plugin.Chainer) error {
_, err := Execute(ctx, consumerPlugin, []string{"writeGenesis"}, plugin.WithChain(c))
_, err := Execute(ctx, PluginConsumerPath, []string{"writeGenesis"}, plugin.WithChain(c))
if err != nil {
return errors.Errorf("execute consumer plugin 'writeGenesis': %w", err)
}
Expand All @@ -27,7 +29,7 @@ func ConsumerWriteGenesis(ctx context.Context, c plugin.Chainer) error {
// NOTE(tb): Using a plugin for this task avoids having the interchain-security
// dependency in Ignite.
func ConsumerIsInitialized(ctx context.Context, c plugin.Chainer) (bool, error) {
out, err := Execute(ctx, consumerPlugin, []string{"isInitialized"}, plugin.WithChain(c))
out, err := Execute(ctx, PluginConsumerPath, []string{"isInitialized"}, plugin.WithChain(c))
if err != nil {
return false, errors.Errorf("execute consumer plugin 'isInitialized': %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions ignite/internal/plugin/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestConsumerPlugin(t *testing.T) {
chainer.EXPECT().ConfigPath().Return("configpath").Maybe()
chainer.EXPECT().Home().Return(path, nil).Maybe()
chainer.EXPECT().RPCPublicAddress().Return("rpcPublicAddress", nil).Maybe()
_, err = Execute(context.Background(), consumerPlugin, []string{"writeGenesis"}, plugin.WithChain(chainer))
_, err = Execute(context.Background(), PluginConsumerPath, []string{"writeGenesis"}, plugin.WithChain(chainer))
require.NoError(t, err)
},
expectedOutput: "true",
Expand All @@ -117,7 +117,7 @@ func TestConsumerPlugin(t *testing.T) {

out, err := Execute(
context.Background(),
consumerPlugin,
PluginConsumerPath,
tt.args,
plugin.WithChain(chainer),
)
Expand Down

0 comments on commit acc2e5c

Please sign in to comment.