diff --git a/events/publish.go b/events/publish.go index e154ce9ba6..2b1c4ff609 100644 --- a/events/publish.go +++ b/events/publish.go @@ -8,6 +8,7 @@ import ( "github.com/ovrclk/akash/sdkutil" dtypes "github.com/ovrclk/akash/x/deployment/types" mtypes "github.com/ovrclk/akash/x/market/types" + ptypes "github.com/ovrclk/akash/x/provider/types" abci "github.com/tendermint/tendermint/abci/types" tmclient "github.com/tendermint/tendermint/rpc/client" ctypes "github.com/tendermint/tendermint/rpc/core/types" @@ -99,5 +100,9 @@ func processEvent(bev abci.Event) (interface{}, bool) { return mev, true } + if mev, err := ptypes.ParseEvent(ev); err == nil { + return mev, true + } + return nil, false } diff --git a/events/publish_test.go b/events/publish_test.go index 39e09190c2..a10d25e69f 100644 --- a/events/publish_test.go +++ b/events/publish_test.go @@ -8,6 +8,7 @@ import ( "github.com/ovrclk/akash/testutil" dtypes "github.com/ovrclk/akash/x/deployment/types" mtypes "github.com/ovrclk/akash/x/market/types" + ptypes "github.com/ovrclk/akash/x/provider/types" "github.com/stretchr/testify/assert" ) @@ -25,6 +26,11 @@ func Test_processEvent(t *testing.T) { mtypes.EventBidClosed{ID: testutil.BidID(t), Price: testutil.Coin(t)}, mtypes.EventLeaseCreated{ID: testutil.LeaseID(t), Price: testutil.Coin(t)}, mtypes.EventLeaseClosed{ID: testutil.LeaseID(t), Price: testutil.Coin(t)}, + + // x/provider events + ptypes.EventProviderCreate{Owner: testutil.AccAddress(t)}, + ptypes.EventProviderUpdate{Owner: testutil.AccAddress(t)}, + ptypes.EventProviderDelete{Owner: testutil.AccAddress(t)}, } for _, test := range tests { diff --git a/x/market/types/event.go b/x/market/types/event.go index c1d1559bed..e474b56a73 100644 --- a/x/market/types/event.go +++ b/x/market/types/event.go @@ -18,9 +18,6 @@ const ( evActionLeaseCreated = "lease-created" evActionLeaseClosed = "lease-closed" - evOwnerKey = "owner" - evDSeqKey = "dseq" - evGSeqKey = "gseq" evOSeqKey = "oseq" evProviderKey = "provider" evPriceDenomKey = "price-denom" diff --git a/x/market/types/events_test.go b/x/market/types/events_test.go index 27d4f4d707..7b0cc643a3 100644 --- a/x/market/types/events_test.go +++ b/x/market/types/events_test.go @@ -17,6 +17,9 @@ var ( //keyParams = sdk.NewKVStoreKey(params.StoreKey) errWildcard = errors.New("wildcard string error can't be matched") + evOwnerKey = "owner" + evDSeqKey = "dseq" + evGSeqKey = "gseq" ) type testEventParsing struct {