diff --git a/Scarb.toml b/Scarb.toml index 9dae385..e1bc383 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -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" } diff --git a/src/interfaces.cairo b/src/interfaces.cairo index 5948f36..a1e679f 100644 --- a/src/interfaces.cairo +++ b/src/interfaces.cairo @@ -61,11 +61,18 @@ pub trait IUtuRelay { height_proof: Option ); - fn challenge_block( - ref self: TContractState, block_height: u64, blocks: Array - ) -> 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; } diff --git a/src/utu_relay.cairo b/src/utu_relay.cairo index 055ec05..7c863c8 100644 --- a/src/utu_relay.cairo +++ b/src/utu_relay.cairo @@ -124,15 +124,6 @@ pub mod UtuRelay { } } - - fn challenge_block( - ref self: ContractState, block_height: u64, blocks: Array - ) -> 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) }