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

Update ProposeGenesis in TestUtils to remove redundant Initialize() #3972

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

hpatel292-seneca
Copy link
Contributor

This Fixes: #3781

The code I updated

txs.AddRange(
                validatorSet.Validators.Select(
                    validator => Transaction.Create(
                        nonce++,
                        GenesisProposer,
                        null,
                        actions: new IAction[]
                            {
                                new Initialize(
                                    validatorSet: validatorSet,
                                    states: ImmutableDictionary.Create<Address, IValue>()),
                            }.Select(x => x.PlainValue),
                        timestamp: DateTimeOffset.MinValue)));

to

txs.Add(
    Transaction.Create(
        nonce++,
        GenesisProposer,
        null,
        actions: new IAction[]
        {
            new Initialize(
                validatorSet: validatorSet,
                states: ImmutableDictionary.Create<Address, IValue>()),
        }.Select(x => x.PlainValue),
        timestamp: DateTimeOffset.MinValue));

@CLAassistant
Copy link

CLAassistant commented Oct 15, 2024

CLA assistant check
All committers have signed the CLA.

@Atralupus
Copy link
Member

Please rebase. Congratulations on your first contribution to the Libplanet!

@OnedgeLee OnedgeLee added no changelog Bypasses changelog check hacktoberfest Newcomer-welcoming issues for Hacktoberfest labels Oct 15, 2024
@hpatel292-seneca
Copy link
Contributor Author

Hi @Atralupus, I rebase based on the latest changes in main.

riemannulus
riemannulus previously approved these changes Oct 16, 2024
Copy link
Member

@riemannulus riemannulus left a comment

Choose a reason for hiding this comment

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

LGTM!

Atralupus
Atralupus previously approved these changes Oct 16, 2024
Copy link
Member

@Atralupus Atralupus left a comment

Choose a reason for hiding this comment

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

Thanks you 💯

Copy link
Contributor

@OnedgeLee OnedgeLee left a comment

Choose a reason for hiding this comment

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

These changes affect genesis block, and changes on genesis block hash will change the order of transactions on test.
So, test/Libplanet.Tests/TestUtils.cs need to be modified like below.

(1, 0, new[] { "A", "B", "C", "E", null }, _txFx.Address2),
(0, 0, new[] { "A,D", "B", "C", "E", null }, _txFx.Address1),
(2, 0, new[] { "A,D", "B", "C", "E", "F" }, _txFx.Address3),

Please check this commit!

@hpatel292-seneca
Copy link
Contributor Author

Hi @OnedgeLee, I am not sure what you want me to update.

@OnedgeLee OnedgeLee dismissed stale reviews from Atralupus and riemannulus via b631910 October 18, 2024 00:37
@OnedgeLee OnedgeLee self-requested a review October 18, 2024 00:42
OnedgeLee
OnedgeLee previously approved these changes Oct 18, 2024
@OnedgeLee
Copy link
Contributor

Hi @OnedgeLee, I am not sure what you want me to update.

I've added a commit for test fixture update.
Thank you for your contribution!

@OnedgeLee OnedgeLee merged commit 68d8f42 into planetarium:main Oct 18, 2024
21 of 22 checks passed
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 no changelog Bypasses changelog check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove redundant Initialize() on TestUtils
5 participants