|
13 | 13 | #![allow(dead_code)] |
14 | 14 | #![allow(unused_imports)] |
15 | 15 | #![allow(clippy::too_many_arguments, clippy::doc_lazy_continuation)] |
| 16 | + |
16 | 17 | use diem_types::{ |
17 | 18 | account_address::AccountAddress, |
18 | 19 | transaction::{EntryFunction, TransactionPayload}, |
@@ -260,6 +261,10 @@ pub enum EntryFunctionCall { |
260 | 261 | id: u64, |
261 | 262 | }, |
262 | 263 |
|
| 264 | + /// testnet helper to allow testnet root account to set flip the boundary bit |
| 265 | + /// used for testing cli tools for polling and triggering |
| 266 | + EpochBoundarySmokeEnableTrigger {}, |
| 267 | + |
263 | 268 | EpochBoundarySmokeTriggerEpoch {}, |
264 | 269 |
|
265 | 270 | /// Only a Voucher of the validator can flip the unjail bit. |
@@ -539,7 +544,7 @@ pub enum EntryFunctionCall { |
539 | 544 | friend_account: AccountAddress, |
540 | 545 | }, |
541 | 546 |
|
542 | | - /// will only succesfully vouch if the two are not related by ancestry |
| 547 | + /// will only successfully vouch if the two are not related by ancestry |
543 | 548 | /// prevents spending a vouch that would not be counted. |
544 | 549 | /// to add a vouch and ignore this check use insist_vouch |
545 | 550 | VouchVouchFor { |
@@ -700,6 +705,7 @@ impl EntryFunctionCall { |
700 | 705 | multisig_address, |
701 | 706 | id, |
702 | 707 | } => donor_voice_txs_vote_veto_tx(multisig_address, id), |
| 708 | + EpochBoundarySmokeEnableTrigger {} => epoch_boundary_smoke_enable_trigger(), |
703 | 709 | EpochBoundarySmokeTriggerEpoch {} => epoch_boundary_smoke_trigger_epoch(), |
704 | 710 | JailUnjailByVoucher { addr } => jail_unjail_by_voucher(addr), |
705 | 711 | LibraCoinClaimMintCapability {} => libra_coin_claim_mint_capability(), |
@@ -1509,6 +1515,23 @@ pub fn donor_voice_txs_vote_veto_tx( |
1509 | 1515 | )) |
1510 | 1516 | } |
1511 | 1517 |
|
| 1518 | +/// testnet helper to allow testnet root account to set flip the boundary bit |
| 1519 | +/// used for testing cli tools for polling and triggering |
| 1520 | +pub fn epoch_boundary_smoke_enable_trigger() -> TransactionPayload { |
| 1521 | + TransactionPayload::EntryFunction(EntryFunction::new( |
| 1522 | + ModuleId::new( |
| 1523 | + AccountAddress::new([ |
| 1524 | + 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, |
| 1525 | + 0, 0, 0, 1, |
| 1526 | + ]), |
| 1527 | + ident_str!("epoch_boundary").to_owned(), |
| 1528 | + ), |
| 1529 | + ident_str!("smoke_enable_trigger").to_owned(), |
| 1530 | + vec![], |
| 1531 | + vec![], |
| 1532 | + )) |
| 1533 | +} |
| 1534 | + |
1512 | 1535 | pub fn epoch_boundary_smoke_trigger_epoch() -> TransactionPayload { |
1513 | 1536 | TransactionPayload::EntryFunction(EntryFunction::new( |
1514 | 1537 | ModuleId::new( |
@@ -2353,7 +2376,7 @@ pub fn vouch_revoke(friend_account: AccountAddress) -> TransactionPayload { |
2353 | 2376 | )) |
2354 | 2377 | } |
2355 | 2378 |
|
2356 | | -/// will only succesfully vouch if the two are not related by ancestry |
| 2379 | +/// will only successfully vouch if the two are not related by ancestry |
2357 | 2380 | /// prevents spending a vouch that would not be counted. |
2358 | 2381 | /// to add a vouch and ignore this check use insist_vouch |
2359 | 2382 | pub fn vouch_vouch_for(friend_account: AccountAddress) -> TransactionPayload { |
@@ -2730,6 +2753,16 @@ mod decoder { |
2730 | 2753 | } |
2731 | 2754 | } |
2732 | 2755 |
|
| 2756 | + pub fn epoch_boundary_smoke_enable_trigger( |
| 2757 | + payload: &TransactionPayload, |
| 2758 | + ) -> Option<EntryFunctionCall> { |
| 2759 | + if let TransactionPayload::EntryFunction(_script) = payload { |
| 2760 | + Some(EntryFunctionCall::EpochBoundarySmokeEnableTrigger {}) |
| 2761 | + } else { |
| 2762 | + None |
| 2763 | + } |
| 2764 | + } |
| 2765 | + |
2733 | 2766 | pub fn epoch_boundary_smoke_trigger_epoch( |
2734 | 2767 | payload: &TransactionPayload, |
2735 | 2768 | ) -> Option<EntryFunctionCall> { |
@@ -3352,6 +3385,10 @@ static SCRIPT_FUNCTION_DECODER_MAP: once_cell::sync::Lazy<EntryFunctionDecoderMa |
3352 | 3385 | "donor_voice_txs_vote_veto_tx".to_string(), |
3353 | 3386 | Box::new(decoder::donor_voice_txs_vote_veto_tx), |
3354 | 3387 | ); |
| 3388 | + map.insert( |
| 3389 | + "epoch_boundary_smoke_enable_trigger".to_string(), |
| 3390 | + Box::new(decoder::epoch_boundary_smoke_enable_trigger), |
| 3391 | + ); |
3355 | 3392 | map.insert( |
3356 | 3393 | "epoch_boundary_smoke_trigger_epoch".to_string(), |
3357 | 3394 | Box::new(decoder::epoch_boundary_smoke_trigger_epoch), |
|
0 commit comments