Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejka committed Aug 2, 2024
1 parent 8c44c90 commit b33b6ab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions src/state.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,16 @@
pub struct ChainState {
/// Height of the current block.
pub block_height: u32, // not u256?

/// Total work done.
pub total_work: u256,

/// Best block.
pub best_block_hash: u256,

/// Current block.
pub current_target: u32,

/// Start of the current epoch.
pub epoch_start_time: u32,

/// Previous timestamps.
pub prev_timestamps: Span<u32>,

// TODO: utreexo_roots?
}

Expand All @@ -40,19 +34,14 @@ pub struct Block {
struct Header {
/// The version of the block.
pub version: u32,

/// The hash of the previous block in the blockchain.
pub prev_block_hash: u256,

/// The Merkle root hash of the transactions in the block.
pub merkle_root_hash: u256,

/// The timestamp of the block.
pub time: u32,

/// The difficulty target for mining the block.
pub bits: u32,

/// The nonce used in mining the block.
pub nonce: u32,
}
Expand All @@ -63,13 +52,10 @@ struct Header {
pub struct Transaction {
/// The version of the transaction.
pub version: i32,

/// The inputs of the transaction.
pub inputs: Span<TxIn>,

/// The outputs of the transaction.
pub outputs: Span<TxOut>,

/// The lock time of the transaction.
pub lock_time: u32,
}
Expand All @@ -80,7 +66,6 @@ pub struct Transaction {
pub struct TxOut {
/// The value of the output.
value: i64,

/// The public key script of the output.
pk_script: @ByteArray,
}
Expand All @@ -91,13 +76,10 @@ pub struct TxOut {
pub struct TxIn {
/// The transaction ID of the input.
txid: u256,

/// The index of the input.
index: u32,

/// The script of the input.
script: @ByteArray,

/// The sequence of the input.
sequence: u32,
}
Expand Down
2 changes: 1 addition & 1 deletion src/validation.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ fn adjust_difficulty(self: @ChainState, block: @Block) -> (u32, u32) {
fn validate_merkle_root(self: @ChainState, block: @Block) -> Result<(), ByteArray> {
// TODO: implement
Result::Ok(())
}
}

0 comments on commit b33b6ab

Please sign in to comment.