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

split preparation code into per-version modules #8839

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

Ekleog-NEAR
Copy link
Collaborator

@Ekleog-NEAR Ekleog-NEAR commented Mar 29, 2023

This is literally just cut-paste and adjust to calling the right functions for now. Further changes to get to the end-state of #8323 will come later

@Ekleog-NEAR Ekleog-NEAR added the C-housekeeping Category: Refactoring, cleanups, code quality label Mar 29, 2023
@Ekleog-NEAR Ekleog-NEAR requested a review from nagisa March 29, 2023 16:40
@Ekleog-NEAR Ekleog-NEAR requested a review from a team as a code owner March 29, 2023 16:40
@@ -109,301 +34,13 @@ fn validate_contract(code: &[u8], config: &VMConfig) -> Result<(), PrepareError>
///
/// The preprocessing includes injecting code for gas metering and metering the height of stack.
pub fn prepare_contract(original_code: &[u8], config: &VMConfig) -> Result<Vec<u8>, PrepareError> {
validate_contract(original_code, config)?;
prepare_v1::validate_contract(original_code, config)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should move this into prepare_contract for each version (even if v0 continues calling v1's validate_contract)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup! I’ve been trying to minimize changes here, keeping the same code structure, this will come along with the introduction of contract prep v2 :)

@near-bulldozer near-bulldozer bot merged commit e5d4cac into near:master Mar 30, 2023
nikurt pushed a commit to nikurt/nearcore that referenced this pull request Apr 5, 2023
This is literally just cut-paste and adjust to calling the right functions for now. Further changes to get to the end-state of near#8323 will come later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-housekeeping Category: Refactoring, cleanups, code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants