From 68f39fad9f809f8a9b58b0f25648d2d526feae9a Mon Sep 17 00:00:00 2001 From: vpanchal-supra Date: Tue, 17 Dec 2024 20:16:45 +0530 Subject: [PATCH] Modified aptos-gas-schedule-updator to support proposal script generation for supra governance --- aptos-move/aptos-gas-schedule-updator/src/lib.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/aptos-move/aptos-gas-schedule-updator/src/lib.rs b/aptos-move/aptos-gas-schedule-updator/src/lib.rs index 9a97618bad572..ea4184315f926 100644 --- a/aptos-move/aptos-gas-schedule-updator/src/lib.rs +++ b/aptos-move/aptos-gas-schedule-updator/src/lib.rs @@ -64,8 +64,8 @@ fn generate_script(gas_schedule: &GasScheduleV2) -> Result { emitln!(writer, "script {"); writer.indent(); - emitln!(writer, "use aptos_framework::supra_governance;"); - emitln!(writer, "use aptos_framework::gas_schedule;"); + emitln!(writer, "use supra_framework::supra_governance;"); + emitln!(writer, "use supra_framework::gas_schedule;"); emitln!(writer); emitln!(writer, "fun main(proposal_id: u64) {"); @@ -73,7 +73,7 @@ fn generate_script(gas_schedule: &GasScheduleV2) -> Result { emitln!( writer, - "let framework_signer = supra_governance::resolve(proposal_id, @{});\n", + "let framework_signer = supra_governance::supra_resolve(proposal_id, @{});\n", AccountAddress::ONE, ); @@ -83,8 +83,9 @@ fn generate_script(gas_schedule: &GasScheduleV2) -> Result { emitln!( writer, - "gas_schedule::set_gas_schedule(&framework_signer, gas_schedule_blob);" + "gas_schedule::set_for_next_epoch(&framework_signer, gas_schedule_blob);" ); + emitln!(writer, "supra_governance::reconfigure(&framework_signer);"); writer.unindent(); emitln!(writer, "}"); @@ -98,7 +99,7 @@ fn generate_script(gas_schedule: &GasScheduleV2) -> Result { fn aptos_framework_path() -> PathBuf { Path::join( Path::new(env!("CARGO_MANIFEST_DIR")), - "../framework/aptos-framework", + "../framework/supra-framework", ) } @@ -133,7 +134,7 @@ pub fn generate_update_proposal(args: &GenArgs) -> Result<()> { &generate_script(¤t_gas_schedule(feature_version))?, ); // TODO: use relative path here - pack.add_local_dep("AptosFramework", &aptos_framework_path().to_string_lossy()); + pack.add_local_dep("SupraFramework", &aptos_framework_path().to_string_lossy()); pack.write_to_disk(args.output.as_deref().unwrap_or("./proposal"))?;