-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: events #136
feat: events #136
Conversation
@kimurayu45z |
x/tokenconverter/keeper/convert.go
Outdated
@@ -57,5 +57,12 @@ func (k Keeper) BurnAndMint(ctx context.Context, amount math.Int, address sdk.Ac | |||
return err | |||
} | |||
|
|||
if err := sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&types.EventBurnAndMint{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EventConvertでいいかも
x/liquiditypool/keeper/position.go
Outdated
@@ -133,6 +142,10 @@ func (k Keeper) RemovePosition(ctx context.Context, id uint64) { | |||
storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) | |||
store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.PositionKey)) | |||
store.Delete(GetPositionIDBytes(id)) | |||
|
|||
_ = sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&types.EventRemovePosition{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DB操作に関するigniteに自動生成された関数はイベントなしでいいわ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Txに絡めてイベント発火したいってこと?細かく出すならDBで出した方がいいと思うが
x/liquiditypool/keeper/position.go
Outdated
@@ -45,6 +45,14 @@ func (k Keeper) AppendPosition(ctx context.Context, position types.Position) uin | |||
// Set the ID of the appended value | |||
position.Id = count | |||
k.SetPosition(ctx, position) | |||
_ = sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&types.EventSetPosition{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppendXXXもIgnite自動生成のdb関数だからイベントなしで
uint64 pool_id = 1; | ||
} | ||
|
||
message EventSetPosition { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setは内部処理の単語なのでCreate, Updateという単語を使いたい
close #131
Overview