Skip to content
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

Provide an activity and action builders for fields validation #44

Open
1 task done
kallydev opened this issue Jun 14, 2024 · 1 comment
Open
1 task done

Provide an activity and action builders for fields validation #44

kallydev opened this issue Jun 14, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@kallydev
Copy link
Member

What feature is it?

actionBuilder := activity.NewActionBuilder(type.TransactionTransfer, from, to)
actionBuilder.SetPlatform(decentralized.Platform1Inch)

action, err := actionBuilder.Build() // Build and check all fields.

What problem does this feature solve?

Using Activity and Action structures directly can easily lead to invalid or missing values in some fields, which can be avoided using builder pattern.

Additional description

No response

This is not a duplicated feature request or new worker proposal

@kallydev kallydev added the enhancement New feature or request label Jun 14, 2024
@kallydev kallydev transferred this issue from RSS3-Network/Node Jun 14, 2024
@kallydev
Copy link
Member Author

This can ensure that the necessary fields are assigned at compile time, but the checks for the values of the fields are still at runtime.

@kallydev kallydev self-assigned this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant