diff --git a/golang/cosmos/types/stream/operation.go b/golang/cosmos/types/stream/operation.go index 0b1db879fb9..999c33d7dbe 100644 --- a/golang/cosmos/types/stream/operation.go +++ b/golang/cosmos/types/stream/operation.go @@ -112,12 +112,12 @@ func (so StreamOperation) Commit(ctx sdk.Context, priorPos StreamPosition, force } // COMMIT POINT - // Store and announce the marshalled stream cell. + // Store the marshalled stream cell. if err := so.state.Write(ctx, bz); err != nil { return err } - // Emit the conventional state change. + // Emit the advisory state change event. ctx.EventManager().EmitEvent( agoric.NewStateChangeEvent( so.state.StoreName(), diff --git a/golang/cosmos/x/vstorage/keeper/keeper.go b/golang/cosmos/x/vstorage/keeper/keeper.go index a20a56c0001..7bf24be765c 100644 --- a/golang/cosmos/x/vstorage/keeper/keeper.go +++ b/golang/cosmos/x/vstorage/keeper/keeper.go @@ -102,6 +102,19 @@ func (k Keeper) HasKeys(ctx sdk.Context, path string) bool { return iterator.Valid() } +func (k Keeper) SetStorageAndNotify(ctx sdk.Context, path, value string) { + k.LegacySetStorageAndNotify(ctx, path, value) + + // Emit the new state change event. + ctx.EventManager().EmitEvent( + agoric.NewStateChangeEvent( + k.GetStoreName(), + k.PathToEncodedKey(path), + []byte(value), + ), + ) +} + func (k Keeper) LegacySetStorageAndNotify(ctx sdk.Context, path, value string) { k.SetStorage(ctx, path, value)