Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

dev: use Default implementation for GenesisJson #968

Closed
tcoratger opened this issue Apr 15, 2024 · 2 comments · Fixed by #1121
Closed

dev: use Default implementation for GenesisJson #968

tcoratger opened this issue Apr 15, 2024 · 2 comments · Fixed by #1121
Assignees
Labels
enhancement Enhancement of the code, not introducing new features. good first issue Good first issue for people wanting to contribute to this project.

Comments

@tcoratger
Copy link
Collaborator

Describe Preferred Solution

After next release of Dojo and integration of dojoengine/dojo#1830, the

GenesisJson {
    // other fields
    .. Default::default()
}

pattern can be used to replace the following verbose construction:

Ok(GenesisJson {
parent_hash: FieldElement::ZERO,
state_root: FieldElement::ZERO,
number: 0,
timestamp: 0,
sequencer_address: self.compute_starknet_address(self.coinbase)?,
gas_prices: GasPrices::default(),
classes: self.classes,
fee_token: FeeTokenConfigJson {
name: "Ether".to_string(),
symbol: "ETH".to_string(),
decimals: 18,
storage: Some(self.fee_token_storage),
address: None,
class: None,
},
universal_deployer: None,
accounts: self.accounts,
contracts: self.contracts,
})

@tcoratger tcoratger added the enhancement Enhancement of the code, not introducing new features. label Apr 15, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Backlog in Kakarot on Starknet Apr 15, 2024
@tcoratger tcoratger added the good first issue Good first issue for people wanting to contribute to this project. label Apr 15, 2024
@0xicosahedron
Copy link
Contributor

can i work on this once release is done?

@tcoratger
Copy link
Collaborator Author

can i work on this once release is done?

Sure just assigned

@github-project-automation github-project-automation bot moved this from 🆕 Backlog to ✅ Done in Kakarot on Starknet May 27, 2024
anukkrit149 pushed a commit to karnotxyz/kakarot-rpc that referenced this issue Aug 9, 2024
<!--- Please provide a general summary of your changes in the title
above -->

<!-- Give an estimate of the time you spent on this PR in terms of work
days.
Did you spend 0.5 days on this PR or rather 2 days?  -->

Time spent on this PR: 0.2d

## Pull request type

<!-- Please try to limit your pull request to one type,
submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying,
or link to a relevant issue. -->

Resolves #<Issue number>

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added by
this PR. -->

-
-
-

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/968)
<!-- Reviewable:end -->
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhancement of the code, not introducing new features. good first issue Good first issue for people wanting to contribute to this project.
Projects
No open projects
Archived in project
2 participants