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

[R4R]api: expose memo and source #39

Merged
merged 3 commits into from
Jun 3, 2019
Merged

[R4R]api: expose memo and source #39

merged 3 commits into from
Jun 3, 2019

Conversation

unclezoro
Copy link
Contributor

No description provided.

ackratos
ackratos previously approved these changes Jun 3, 2019
Copy link

@ackratos ackratos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change looks good. But better to have backward compatibility by adding GetMemo() and GetSource() methods to Msg interface and add a common base type i.e. Metadata to each msg types hold memo and source. Then we can pass in each create message function an vararg type MetadataSetter = func(Msg) Msg i.e.

func (c *client) MintToken(symbol string, amount int64, sync bool, MetadataSetter...) (*MintTokenResult, error) {

then user can inject memo and source on demand. And in broadcastMsg just call GetSource and GetMemo on Msg interface to get corresponding fields.

@unclezoro
Copy link
Contributor Author

the change looks good. But better to have backward compatibility by adding GetMemo() and GetSource() methods to Msg interface and add a common base type i.e. Metadata to each msg types hold memo and source. Then we can pass in each create message function an vararg type MetadataSetter = func(Msg) Msg i.e.

func (c *client) MintToken(symbol string, amount int64, sync bool, MetadataSetter...) (*MintTokenResult, error) {

then user can inject memo and source on demand. And in broadcastMsg just call GetSource and GetMemo on Msg interface to get corresponding fields.

You are right. Have changed into what you expected. Please check latest commit.

@unclezoro unclezoro merged commit 6442ea1 into master Jun 3, 2019
@unclezoro unclezoro deleted the memo branch July 12, 2019 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants