Skip to content

Commit

Permalink
[force-deploy] branch burn frozen after block (#4391)
Browse files Browse the repository at this point in the history
* [force-upgrade] commit binary for generate stdlib by command `cargo run --bin stdlib -- -v 12 -m StdlibUpgradeScripts -f upgrade_from_v11_to_v12 -a 0u64 -a 16080000u64 -a 5u64 -a 1000u64`

* [force-upgrade] fixed force deploy unitetest for new burn logic

* [force-upgrade] fix cargo fmt

* [force-upgrade] fix cargo fmt

* [force-upgrade] fix cargo fmt

* [force-upgrade] reformat codes

* update test test_package_init_function

* rm unused import

---------

Co-authored-by: nk_ysg <nk_ysg@163.com>
  • Loading branch information
welbon and nkysg authored Feb 9, 2025
1 parent c311d7a commit 12e97df
Show file tree
Hide file tree
Showing 22 changed files with 233 additions and 152 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev
starcoin-decrypt = { path = "commons/decrypt" }
starcoin-dev = { path = "vm/dev" }
starcoin-executor = { path = "executor" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "9eaa8f97aa40d3ab19bfbe90fb720ac63268a613" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "2b7adac5f1d5ae6a4abba6559a4de75e8307b783" }
starcoin-genesis = { path = "genesis" }
starcoin-logger = { path = "commons/logger" }
starcoin-metrics = { path = "commons/metrics" }
Expand Down
13 changes: 8 additions & 5 deletions chain/force-upgrade/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@

use anyhow::format_err;
use starcoin_types::account::DEFAULT_EXPIRATION_TIME;
use starcoin_types::identifier::Identifier;
use starcoin_types::language_storage::ModuleId;
use starcoin_types::{
account::{Account, DEFAULT_MAX_GAS_AMOUNT},
transaction::SignedUserTransaction,
};
use starcoin_vm_types::account_config::core_code_address;
use starcoin_vm_types::transaction::ScriptFunction;
use starcoin_vm_types::{
account_config::STC_TOKEN_CODE_STR,
genesis_config::ChainId,
Expand All @@ -37,17 +33,24 @@ impl ForceUpgrade {
})
.ok_or_else(|| format_err!("Can not find upgrade package {}", package_file))?;

/* test in test_package_init_function
let init_script = ScriptFunction::new(
ModuleId::new(
core_code_address(),
Identifier::new("StdlibUpgradeScripts").unwrap(),
),
Identifier::new("upgrade_from_v11_to_v12").unwrap(),
vec![],
vec![],
vec![
bcs_ext::to_bytes(&0u64).unwrap(), // TODO(BobOng): [force-upgrade] to confirm main burn block
bcs_ext::to_bytes(&16090000u64).unwrap(),
bcs_ext::to_bytes(&5u64).unwrap(),
bcs_ext::to_bytes(&1000u64).unwrap(),
],
);
assert_eq!(package.init_script().unwrap(), &init_script);
*/

Ok(account.sign_txn(RawUserTransaction::new(
*account.address(),
Expand Down
Loading

0 comments on commit 12e97df

Please sign in to comment.