Skip to content

refactor genesis building logic in avm and platformvm #3949

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DracoLi
Copy link
Contributor

@DracoLi DracoLi commented May 8, 2025

Why this should be merged

Resolves #2613, we no longer need static structs to create genesis.

How this works

  • Removes StaticService from both plaftformvm and avm
  • Move logic for building genesis to BuildGenesis

How this was tested

unit test

"Jz9ayEDt7dx9hDx45aXALujWmL9ZUuqe7",
}

func TestBuildGenesis(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added back this test, which was removed in #2589. I think its worth keeping for testing the BuildGenesis function, but please let me know if this should just be removed or needs adjustments.

@DracoLi DracoLi force-pushed the dl/remove-static-service branch from 90ec163 to 9d9fbcd Compare May 8, 2025 15:14
@DracoLi DracoLi requested a review from joshua-kim May 8, 2025 20:55
@@ -88,7 +80,7 @@ type BuildGenesisReply struct {

// BuildGenesis returns the UTXOs such that at least one address in [args.Addresses] is
// referenced in the UTXO.
func (*StaticService) BuildGenesis(_ *http.Request, args *BuildGenesisArgs, reply *BuildGenesisReply) error {
func BuildGenesis(args *BuildGenesisArgs, reply *BuildGenesisReply) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also get rid of all these args/reply structs and just make them parameters/return values/structs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep good point, i'll update this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Refactor static service structs into static functions
2 participants