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

Fee currency state transition test #30

Merged
merged 3 commits into from
Dec 6, 2023

Conversation

palango
Copy link

@palango palango commented Nov 10, 2023

Adds a simple fee currency transfer test.

The genesis initialisation of the SortedOracles contract is complicated, so instead I created a simple MockSortedOracle contract and use that instead. This is added to the optimism repo in celo-org/optimism#90.

Resolves celo-org/optimism#86

@palango palango force-pushed the palango/fee-currency-state-transition branch 4 times, most recently from 5c2c64a to 9469fa9 Compare November 21, 2023 12:56
@palango palango force-pushed the palango/fee-currency-state-transition-test branch from d31cd0f to 16fe6b3 Compare November 27, 2023 11:24
@palango palango changed the base branch from palango/fee-currency-state-transition to celo3 November 27, 2023 11:24
@@ -641,7 +641,7 @@ func DeveloperGenesisBlock(gasLimit uint64, faucet common.Address) *Genesis {
}

// Add state from celoGenesisAccounts
for addr, data := range celoGenesisAccounts() {
for addr, data := range celoGenesisAccounts(common.HexToAddress("0x2")) {
Copy link
Author

Choose a reason for hiding this comment

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

We could make this nicer with variadic args, but it felt like over-optimisation. Let me know if you disagree.

@palango palango marked this pull request as ready for review November 27, 2023 16:47
core/celo_genesis.go Outdated Show resolved Hide resolved
@palango palango force-pushed the palango/fee-currency-state-transition-test branch from 05653ac to 2066e27 Compare December 1, 2023 13:33
@palango palango force-pushed the palango/fee-currency-state-transition-test branch from 2066e27 to 38782aa Compare December 1, 2023 13:37
@palango
Copy link
Author

palango commented Dec 1, 2023

So the test actually found a bug: The basefee wasn't correctly converted into the fee currency for celo transactions. This addition makes the changes a bit more widespread, but I don't see a more concise way.

Copy link

@carterqw2 carterqw2 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@palango palango merged commit ec62655 into celo3 Dec 6, 2023
6 of 7 checks passed
@palango palango deleted the palango/fee-currency-state-transition-test branch December 6, 2023 12:33
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.

Add test of state transition with fee currency support
2 participants