Skip to content

Commit

Permalink
refactor: doc & remove unimplemented function
Browse files Browse the repository at this point in the history
  • Loading branch information
Th0rgal committed Nov 1, 2024
1 parent ecaea1d commit d9cdbbc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2024_07"

[dependencies]
starknet = "2.8.4"
utils = { git = "https://github.com/keep-starknet-strange/raito.git" }
utils = { git = "https://github.com/keep-starknet-strange/raito.git", rev = "02a13045b7074ae2b3247431cd91f1ad76263fb2" }

[dev-dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.31.0" }
Expand Down
15 changes: 11 additions & 4 deletions src/interfaces.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,18 @@ pub trait IUtuRelay<TContractState> {
height_proof: Option<HeightProof>
);

fn challenge_block(
ref self: TContractState, block_height: u64, blocks: Array<BlockHeader>
) -> bool;

/// Returns the status of a block given its hash.
///
/// This function retrieves information about any registered block, regardless of whether
/// it is part of the canonical chain or not. The returned status includes:
/// - registration_timestamp: when the block was registered
/// - prev_block_digest: hash of the previous block
/// - pow: proof of work value
fn get_status(self: @TContractState, block_hash: Digest) -> BlockStatus;

/// Returns the hash of the block at the specified height in the canonical chain.
///
/// This function retrieves the block hash for a given height in the canonical chain.
/// If no block is set at this height, it returns an empty Digest (Zero::zero()).
fn get_block(self: @TContractState, height: u64) -> Digest;
}
9 changes: 0 additions & 9 deletions src/utu_relay.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ pub mod UtuRelay {
}
}


fn challenge_block(
ref self: ContractState, block_height: u64, blocks: Array<BlockHeader>
) -> bool {
// Implementation for challenge_block
// For now, we'll just return false
false
}

fn get_status(self: @ContractState, block_hash: Digest) -> BlockStatus {
self.blocks.read(block_hash)
}
Expand Down

0 comments on commit d9cdbbc

Please sign in to comment.