+
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions blockchain/types/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ impl Block {
block_contents: &BlockContents,
timestamp: u64,
) -> Self {
assert!((timestamp == 0) ^ version.timestamps_are_supported());

let contents_hash = block_contents.hash();
let id = compute_block_id(
*version,
Expand Down
1 change: 1 addition & 0 deletions consensus/api/proto/consensus_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ enum ProposeTxResult {
InputRuleAmount = 53;
LedgerTxOutIndexOutOfBounds = 54;
FeeMapDigestMismatch = 55;
Timestamp = 56;
}

/// Response from TxPropose RPC call.
Expand Down
1 change: 1 addition & 0 deletions consensus/api/src/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ impl From<Error> for ProposeTxResult {
Error::InputRulesNotAllowed => Self::InputRulesNotAllowed,
Error::InputRule(ir) => ir.into(),
Error::UnknownMaskedAmountVersion => Self::UnknownMaskedAmountVersion,
Error::Timestamp(_) => Self::Timestamp,
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions consensus/enclave/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ pub struct FormBlockInputs {

/// Minting transactions coupled with configuration information.
pub mint_txs_with_config: Vec<(MintTx, MintConfigTx, MintConfig)>,

/// The timestamp to use for the block. ms since Unix epoch.
/// If timestamps are not supported by the block version this
/// value will be ignored and 0 will be used instead.
pub timestamp: u64,
}

/// The API for interacting with a consensus node's enclave.
Expand Down
2 changes: 2 additions & 0 deletions consensus/enclave/impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ rand_core = { version = "0.6", default-features = false }
subtle = { version = "2.4", default-features = false, features = ["i128"] }

[dev-dependencies]
assert_matches = "1"
mc-common = { path = "../../../common", features = ["loggers"] }
mc-crypto-multisig = { path = "../../../crypto/multisig" }
mc-ledger-db = { path = "../../../ledger/db", features = ["test_utils"] }
mc-transaction-core-test-utils = { path = "../../../transaction/core/test-utils" }

rand = "0.8"
rand_hc = "0.3"
yare = "2"

[build-dependencies]
mc-crypto-keys = { path = "../../../crypto/keys" }
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载