-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
337e6a5
commit 92487c5
Showing
10 changed files
with
206 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
sui-execution/latest/sui-move-natives/src/native_tx_context.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use better_any::{Tid, TidAble}; | ||
use move_core_types::account_address::AccountAddress; | ||
use sui_types::base_types::{EpochId, TransactionDigest, TxContext}; | ||
use sui_types::messages_checkpoint::CheckpointTimestamp; | ||
|
||
#[derive(Debug, Tid)] | ||
pub struct NativeTxContext { | ||
/// Signer/sender of the transaction | ||
pub sender: AccountAddress, | ||
/// Digest of the current transaction | ||
pub digest: TransactionDigest, | ||
/// The current epoch number | ||
pub epoch: EpochId, | ||
/// Timestamp that the epoch started at | ||
pub epoch_timestamp_ms: CheckpointTimestamp, | ||
/// Number of `ObjectID`'s generated during execution of the current transaction | ||
pub ids_created: u64, | ||
} | ||
|
||
impl From<&TxContext> for NativeTxContext { | ||
fn from(tx_context: &TxContext) -> Self { | ||
NativeTxContext { | ||
sender: AccountAddress::new(tx_context.sender().to_inner()), | ||
digest: tx_context.digest(), | ||
epoch: tx_context.epoch(), | ||
epoch_timestamp_ms: tx_context.epoch_timestamp_ms(), | ||
ids_created: 0, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters