-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sc-meta upgrade support for more releases, refactor
- Loading branch information
1 parent
9028a27
commit a777bcb
Showing
11 changed files
with
207 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
mod upgrade_0_31; | ||
mod upgrade_0_32; | ||
mod upgrade_0_39; | ||
mod upgrade_common; | ||
mod upgrade_print; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use super::upgrade_common::{replace_in_files, version_bump_in_cargo_toml}; | ||
use crate::folder_structure::RelevantDirectory; | ||
use ruplacer::Query; | ||
use std::path::Path; | ||
|
||
/// Migrate `0.30` to `0.31.0`, including the version bump. | ||
pub fn upgrade_to_31_0(dir: &RelevantDirectory) { | ||
v_0_31_replace_in_files(dir.path.as_ref()); | ||
|
||
let (from_version, to_version) = dir.upgrade_in_progress.unwrap(); | ||
version_bump_in_cargo_toml(&dir.path, from_version, to_version); | ||
} | ||
|
||
fn v_0_31_replace_in_files(sc_crate_path: &Path) { | ||
replace_in_files( | ||
sc_crate_path, | ||
"*rs", | ||
&[Query::substring("#[var_args]", "")][..], | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use super::upgrade_common::{replace_in_files, version_bump_in_cargo_toml}; | ||
use crate::folder_structure::RelevantDirectory; | ||
use ruplacer::Query; | ||
use std::path::Path; | ||
|
||
/// Migrate `0.30` to `0.31.0`, including the version bump. | ||
pub fn upgrade_to_32_0(dir: &RelevantDirectory) { | ||
v_0_32_replace_in_files(dir.path.as_ref()); | ||
|
||
let (from_version, to_version) = dir.upgrade_in_progress.unwrap(); | ||
version_bump_in_cargo_toml(&dir.path, from_version, to_version); | ||
} | ||
|
||
fn v_0_32_replace_in_files(sc_crate_path: &Path) { | ||
replace_in_files( | ||
sc_crate_path, | ||
"*rs", | ||
&[Query::substring( | ||
"TokenIdentifier::egld()", | ||
"EgldOrEsdtTokenIdentifier::egld()", | ||
)][..], | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.