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

As BlockChain<T>.Id keeps being changed, an app (library client) should be aware of that #184

Closed
dahlia opened this issue Apr 9, 2019 · 5 comments
Labels
hacktoberfest Newcomer-welcoming issues for Hacktoberfest help wanted Extra attention is needed stale The issue is stale suggestion Suggestion or feature request

Comments

@dahlia
Copy link
Contributor

dahlia commented Apr 9, 2019

Every time a branch (fork) chain is made and the main chain is switched, BlockChain<T>.Id also changes. As BlockChain<T>.Id keeps being changed, an app (library client) should be aware of that. I suggest to make BlockChain<T> constructor to take a idChanged event callback, e.g.,:

Guid chainId = (Guid)ReadPref("chainId");
var chain = new BlockChain<Action>(
    policy,
    store,
    id: chainId,

    idChanged: newId => WritePref("chainId", newId)
    // This is called with an automatically generated Guid
    // also when BlockChain<Action> is instantiated
    // if chainId is null.
);
@dahlia dahlia added the suggestion Suggestion or feature request label Apr 9, 2019
@dahlia dahlia added good first issue Good for newcomers hacktoberfest Newcomer-welcoming issues for Hacktoberfest help wanted Extra attention is needed and removed good first issue Good for newcomers labels Sep 30, 2019
@dahlia
Copy link
Contributor Author

dahlia commented Sep 30, 2019

This could be achieved by adding ChainId property into BlockChain<T>.TipChangedEventArgs class. See also #517 and #526.

@stale
Copy link

stale bot commented Nov 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale The issue is stale label Nov 29, 2019
@dahlia
Copy link
Contributor Author

dahlia commented Sep 28, 2020

This could be achieved by adding ChainId property into BlockChain<T>.TipChangedEventArgs class. See also #517 and #526.

BlockChain<T>.TipChanged event is gone and replaced by IRenderer<T>.RenderBlock(). It might be solved by adding Guid chainId parameter to that method. See also #963 and #970.

@stale stale bot removed the stale The issue is stale label Sep 28, 2020
@stale
Copy link

stale bot commented Nov 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale The issue is stale label Nov 27, 2020
@dahlia dahlia changed the title As BlockChain<T>.Id keeps being changed, an app (library client) should be aware of that As BlockChain<T>.Id keeps being changed, an app (library client) should be aware of that Apr 14, 2021
@stale stale bot removed the stale The issue is stale label Apr 14, 2021
@stale
Copy link

stale bot commented Jun 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale The issue is stale label Jun 16, 2021
OnedgeLee pushed a commit to OnedgeLee/libplanet that referenced this issue Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Newcomer-welcoming issues for Hacktoberfest help wanted Extra attention is needed stale The issue is stale suggestion Suggestion or feature request
Projects
None yet
Development

No branches or pull requests

2 participants