Skip to content

Commit

Permalink
Rename bitcoin-move light_client.move to bitcoin.move (#1649)
Browse files Browse the repository at this point in the history
* Rename bitcoin-move light_client.move to bitcoin.move

* fixup
  • Loading branch information
jolestar authored May 6, 2024
1 parent 5c0d754 commit 5e0c120
Show file tree
Hide file tree
Showing 14 changed files with 380 additions and 396 deletions.
4 changes: 2 additions & 2 deletions crates/rooch-executor/src/actor/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use moveos_types::transaction::{FunctionCall, MoveOSTransaction, VerifiedMoveAct
use rooch_genesis::FrameworksGasParameters;
use rooch_store::RoochStore;
use rooch_types::address::MultiChainAddress;
use rooch_types::bitcoin::light_client::BitcoinLightClientModule;
use rooch_types::bitcoin::BitcoinModule;
use rooch_types::framework::address_mapping::AddressMappingModule;
use rooch_types::framework::auth_validator::{AuthValidatorCaller, TxValidateResult};
use rooch_types::framework::ethereum_light_client::EthereumLightClientModule;
Expand Down Expand Up @@ -130,7 +130,7 @@ impl ExecutorActor {
match RoochMultiChainID::try_from(chain_id.id())? {
RoochMultiChainID::Bitcoin => {
let action = VerifiedMoveAction::Function {
call: BitcoinLightClientModule::create_submit_new_block_call_bytes(
call: BitcoinModule::create_submit_new_block_call_bytes(
block_height,
block_hash,
block_body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,18 @@ fn test_submit_block() {
.unwrap();

// let moveos = binding_test.reader_executor.moveos().read();
let bitcoin_light_client_module = binding_test
.as_module_binding::<rooch_types::bitcoin::light_client::BitcoinLightClientModule>(
);
let bitcoin_module = binding_test.as_module_binding::<rooch_types::bitcoin::BitcoinModule>();
assert_eq!(
bitcoin_light_client_module
.get_block(block_hash)
.unwrap()
.unwrap(),
bitcoin_module.get_block(block_hash).unwrap().unwrap(),
block_header
);

assert_eq!(
bitcoin_light_client_module
.get_block_by_height(height)
.unwrap()
.unwrap(),
bitcoin_module.get_block_by_height(height).unwrap().unwrap(),
block_header
);
assert_eq!(
bitcoin_light_client_module
.get_latest_block_height()
.unwrap()
.unwrap(),
bitcoin_module.get_latest_block_height().unwrap().unwrap(),
height
);
println!("txdata len: {}", bitcoin_txdata.len());
Expand All @@ -88,7 +77,7 @@ fn test_submit_block() {
}

//this test takes too long time in debug mod run it in release mod, use command:
//RUST_LOG=debug cargo test --release --package rooch-framework-tests --lib -- --include-ignored tests::bitcoin_light_client_test::test_utxo_progress
//RUST_LOG=debug cargo test --release --package rooch-framework-tests --lib -- --include-ignored tests::bitcoin_test::test_utxo_progress
#[test]
fn test_utxo_progress() {
let _ = tracing_subscriber::fmt::try_init();
Expand Down
2 changes: 1 addition & 1 deletion crates/rooch-framework-tests/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) RoochNetwork
// SPDX-License-Identifier: Apache-2.0

mod bitcoin_light_client_test;
mod bitcoin_test;
mod brc20_test;
mod chain_id_test;
mod empty_tests;
Expand Down
8 changes: 3 additions & 5 deletions crates/rooch-relayer/src/actor/bitcoin_relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use moveos_types::module_binding::MoveFunctionCaller;
use rooch_config::BitcoinRelayerConfig;
use rooch_executor::proxy::ExecutorProxy;
use rooch_types::{
bitcoin::light_client::BitcoinLightClientModule,
bitcoin::BitcoinModule,
multichain_id::RoochMultiChainID,
transaction::{L1Block, L1BlockWithBody},
};
Expand Down Expand Up @@ -67,10 +67,8 @@ impl BitcoinRelayer {
return Ok(());
}
self.latest_sync_timestamp = chrono::Utc::now().timestamp() as u64;
let bitcoin_light_client = self
.move_caller
.as_module_binding::<BitcoinLightClientModule>();
let latest_block_height_in_rooch = bitcoin_light_client.get_latest_block_height()?;
let bitcoin_module = self.move_caller.as_module_binding::<BitcoinModule>();
let latest_block_height_in_rooch = bitcoin_module.get_latest_block_height()?;
let latest_block_hash_in_bitcoin = self.rpc_client.get_best_block_hash().await?;
let latest_block_header_info = self
.rpc_client
Expand Down
194 changes: 0 additions & 194 deletions crates/rooch-types/src/bitcoin/light_client.rs

This file was deleted.

Loading

0 comments on commit 5e0c120

Please sign in to comment.