Reuse event parsers from the auto-generated code #1508

Open
opened 2024-11-20 08:03:34 +00:00 by fyrchik · 0 comments
Owner

Consider this

func ParsePutSuccess(e *state.ContainedNotificationEvent) (event.Event, error) {

It could (almost) be reduced to an invocation of

func (e *PutSuccessEvent) FromStackItem(item *stackitem.Array) error {

Let's reuse event parsers where possible.
We might want to retain our types though, because cid.ID is better than util.Uint256.

Consider this https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/a339b52a6038f0746a54acd8f668ea57a8541fd5/pkg/morph/event/container/put.go#L80 It could (almost) be reduced to an invocation of https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/commit/a2c2791146d65887c14fb38a531c01a318fe84cc/rpcclient/container/client.go#L388 Let's reuse event parsers where possible. We might want to retain our types though, because `cid.ID` is better than `util.Uint256`.
fyrchik added the
good first issue
refactoring
internal
labels 2024-11-20 08:03:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1508
No description provided.