diff --git a/framework/cached-packages/src/libra_framework_sdk_builder.rs b/framework/cached-packages/src/libra_framework_sdk_builder.rs index 22857560f..1a0c45888 100644 --- a/framework/cached-packages/src/libra_framework_sdk_builder.rs +++ b/framework/cached-packages/src/libra_framework_sdk_builder.rs @@ -256,6 +256,12 @@ pub enum EntryFunctionCall { account_public_key_bytes: Vec, }, + /// Only a Voucher of the validator can flip the unjail bit. + /// This is a way to make sure the validator is ready to rejoin. + JailUnjailByVoucher { + addr: AccountAddress, + }, + /// Only callable in tests and testnets where the core resources account exists. /// Claim the delegated mint capability and destroy the delegated token. GasCoinClaimMintCapability {}, @@ -273,12 +279,6 @@ pub enum EntryFunctionCall { amount: u64, }, - /// Only a Voucher of the validator can flip the unjail bit. - /// This is a way to make sure the validator is ready to rejoin. - JailUnjailByVoucher { - addr: AccountAddress, - }, - /// Similar to add_owners, but only allow adding one owner. MultisigAccountAddOwner { new_owner: AccountAddress, @@ -734,10 +734,10 @@ impl EntryFunctionCall { DummyUseFnFromDiemStd { account_public_key_bytes, } => dummy_use_fn_from_diem_std(account_public_key_bytes), + JailUnjailByVoucher { addr } => jail_unjail_by_voucher(addr), GasCoinClaimMintCapability {} => gas_coin_claim_mint_capability(), GasCoinDelegateMintCapability { to } => gas_coin_delegate_mint_capability(to), GasCoinMintToImpl { dst_addr, amount } => gas_coin_mint_to_impl(dst_addr, amount), - JailUnjailByVoucher { addr } => jail_unjail_by_voucher(addr), MultisigAccountAddOwner { new_owner } => multisig_account_add_owner(new_owner), MultisigAccountAddOwners { new_owners } => multisig_account_add_owners(new_owners), MultisigAccountApproveTransaction { @@ -1559,6 +1559,23 @@ pub fn dummy_use_fn_from_diem_std(account_public_key_bytes: Vec) -> Transact )) } +/// Only a Voucher of the validator can flip the unjail bit. +/// This is a way to make sure the validator is ready to rejoin. +pub fn jail_unjail_by_voucher(addr: AccountAddress) -> TransactionPayload { + TransactionPayload::EntryFunction(EntryFunction::new( + ModuleId::new( + AccountAddress::new([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, + ]), + ident_str!("jail").to_owned(), + ), + ident_str!("unjail_by_voucher").to_owned(), + vec![], + vec![bcs::to_bytes(&addr).unwrap()], + )) +} + /// Only callable in tests and testnets where the core resources account exists. /// Claim the delegated mint capability and destroy the delegated token. pub fn gas_coin_claim_mint_capability() -> TransactionPayload { @@ -1613,23 +1630,6 @@ pub fn gas_coin_mint_to_impl(dst_addr: AccountAddress, amount: u64) -> Transacti )) } -/// Only a Voucher of the validator can flip the unjail bit. -/// This is a way to make sure the validator is ready to rejoin. -pub fn jail_unjail_by_voucher(addr: AccountAddress) -> TransactionPayload { - TransactionPayload::EntryFunction(EntryFunction::new( - ModuleId::new( - AccountAddress::new([ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, - ]), - ident_str!("jail").to_owned(), - ), - ident_str!("unjail_by_voucher").to_owned(), - vec![], - vec![bcs::to_bytes(&addr).unwrap()], - )) -} - /// Similar to add_owners, but only allow adding one owner. pub fn multisig_account_add_owner(new_owner: AccountAddress) -> TransactionPayload { TransactionPayload::EntryFunction(EntryFunction::new( @@ -2840,6 +2840,16 @@ mod decoder { } } + pub fn jail_unjail_by_voucher(payload: &TransactionPayload) -> Option { + if let TransactionPayload::EntryFunction(script) = payload { + Some(EntryFunctionCall::JailUnjailByVoucher { + addr: bcs::from_bytes(script.args().get(0)?).ok()?, + }) + } else { + None + } + } + pub fn gas_coin_claim_mint_capability( payload: &TransactionPayload, ) -> Option { @@ -2873,16 +2883,6 @@ mod decoder { } } - pub fn jail_unjail_by_voucher(payload: &TransactionPayload) -> Option { - if let TransactionPayload::EntryFunction(script) = payload { - Some(EntryFunctionCall::JailUnjailByVoucher { - addr: bcs::from_bytes(script.args().get(0)?).ok()?, - }) - } else { - None - } - } - pub fn multisig_account_add_owner(payload: &TransactionPayload) -> Option { if let TransactionPayload::EntryFunction(script) = payload { Some(EntryFunctionCall::MultisigAccountAddOwner { @@ -3485,6 +3485,10 @@ static SCRIPT_FUNCTION_DECODER_MAP: once_cell::sync::Lazy