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: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion contracts/mock-btc-light-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mock-btc-light-client"
version = "0.1.0"
version = "0.2.0"
edition.workspace = true
publish.workspace = true

Expand Down
16 changes: 16 additions & 0 deletions contracts/mock-btc-light-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ pub struct ProofArgs {
pub confirmations: u64,
}

#[near(serializers = [borsh])]
pub struct ProofArgsV2 {
pub tx_id: H256,
pub tx_block_blockhash: H256,
pub tx_index: u64,
pub merkle_proof: Vec<H256>,
pub coinbase_tx_id: H256,
pub coinbase_merkle_proof: Vec<H256>,
pub confirmations: u64,
}

impl<'de> Deserialize<'de> for H256 {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down Expand Up @@ -82,6 +93,11 @@ impl Contract {
true
}

#[allow(unused_variables)]
pub fn verify_transaction_inclusion_v2(&self, #[serializer(borsh)] args: ProofArgsV2) -> bool {
true
}

pub fn get_last_block_height(&self) -> u32 {
// Return a reasonable mock block height for Zcash testnet
1000
Expand Down
2 changes: 1 addition & 1 deletion contracts/satoshi-bridge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "satoshi-bridge"
version = "0.8.0"
version = "0.9.0"
edition.workspace = true
publish.workspace = true
repository.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions contracts/satoshi-bridge/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release Notes

### Version 0.9.0
1. use `verify_transaction_inclusion_v2` with coinbase merkle proof.

### Version 0.8.0
1. support BTC refund flow.
2. remove lock time verification.
Expand Down
Loading