You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In x/nft we are using enum as a const. There is no need for this enum declaration as it is not part of any protobuf message. We can declare those values as const strings in Go code instead.
Such change will reduce the amount of code, remove confusing protobuf enum declaration and keep action names constant to avoid typos.
The text was updated successfully, but these errors were encountered:
Protobuf generated `Action` enum is replaced by a custom `Action` string
type.
This refactoring does not introduce and external API changes. Both JSON
and binary format is kept.
resolve#252
* refactor `x/nft.Action` type
Protobuf generated `Action` enum is replaced by a custom `Action` string
type.
This refactoring does not introduce and external API changes. Both JSON
and binary format is kept.
resolve#252
* use regexp to validate nft action string
We do not know the full list of possible nft actions, so when validating
an action name, we can only ensure that if follows certain naming
scheme.
* Redo nft actions registration.
Instead of using regexp to validate an action, provide a global action
index where all actions must be registered before using.
* statically register default nft actions
Instead of using init function, statically register all actions that
support for is implemented by the nft extension.
* add actions to app.go
* add default actions array
* fix nft tests
In
x/nft
we are using enum as a const. There is no need for this enum declaration as it is not part of any protobuf message. We can declare those values as const strings in Go code instead.Such change will reduce the amount of code, remove confusing protobuf enum declaration and keep action names constant to avoid typos.
The text was updated successfully, but these errors were encountered: