Skip to content

Commit

Permalink
build release
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Oct 2, 2023
1 parent 39769b7 commit 80da98a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions framework/cached-packages/src/libra_framework_sdk_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ pub enum EntryFunctionCall {
account_public_key_bytes: Vec<u8>,
},

/// 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 {},
Expand All @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -1559,6 +1559,23 @@ pub fn dummy_use_fn_from_diem_std(account_public_key_bytes: Vec<u8>) -> 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 {
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -2840,6 +2840,16 @@ mod decoder {
}
}

pub fn jail_unjail_by_voucher(payload: &TransactionPayload) -> Option<EntryFunctionCall> {
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<EntryFunctionCall> {
Expand Down Expand Up @@ -2873,16 +2883,6 @@ mod decoder {
}
}

pub fn jail_unjail_by_voucher(payload: &TransactionPayload) -> Option<EntryFunctionCall> {
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<EntryFunctionCall> {
if let TransactionPayload::EntryFunction(script) = payload {
Some(EntryFunctionCall::MultisigAccountAddOwner {
Expand Down Expand Up @@ -3485,6 +3485,10 @@ static SCRIPT_FUNCTION_DECODER_MAP: once_cell::sync::Lazy<EntryFunctionDecoderMa
"dummy_use_fn_from_diem_std".to_string(),
Box::new(decoder::dummy_use_fn_from_diem_std),
);
map.insert(
"jail_unjail_by_voucher".to_string(),
Box::new(decoder::jail_unjail_by_voucher),
);
map.insert(
"gas_coin_claim_mint_capability".to_string(),
Box::new(decoder::gas_coin_claim_mint_capability),
Expand All @@ -3497,10 +3501,6 @@ static SCRIPT_FUNCTION_DECODER_MAP: once_cell::sync::Lazy<EntryFunctionDecoderMa
"gas_coin_mint_to_impl".to_string(),
Box::new(decoder::gas_coin_mint_to_impl),
);
map.insert(
"jail_unjail_by_voucher".to_string(),
Box::new(decoder::jail_unjail_by_voucher),
);
map.insert(
"multisig_account_add_owner".to_string(),
Box::new(decoder::multisig_account_add_owner),
Expand Down
Binary file modified framework/releases/head.mrb
Binary file not shown.

0 comments on commit 80da98a

Please sign in to comment.