Skip to content

Commit

Permalink
Refactor for stable + btc
Browse files Browse the repository at this point in the history
  • Loading branch information
otaliptus committed Jan 4, 2024
1 parent c788b48 commit d60f2d0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
EXCLUDE_BTC: 1
RUST_VERSION_STABLE: 1.75.0
RUST_VERSION_BETA: 1.76.0
# RUST_VERSION_STABLE: 1.75.0
# RUST_VERSION_BETA: 1.76.0
# RUST_VERSION_NIGHTLY: nightly-2023-12-31


Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: beta
toolchain: stable
# toolchain: "1.76.0"
# target: "x86_64-unknown-linux-gnu"
override: true
Expand All @@ -105,6 +105,8 @@ jobs:
.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set toolchain stable
run: rustup override set stable
- name: Run lint
run: |
if ! SKIP_GUEST_BUILD=1 make lint ; then
Expand Down
6 changes: 6 additions & 0 deletions adapters/bitcoin/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ mod tests {

#[tokio::test]
async fn get_utxos() {
if std::env::var("EXCLUDE_BTC").is_ok() {
return;
}
let node = get_bitcoin_node();

let utxos = node.get_utxos().await.unwrap();
Expand All @@ -318,6 +321,9 @@ mod tests {

#[tokio::test]
async fn list_wallets() {
if std::env::var("EXCLUDE_BTC").is_ok() {
return;
}
let node = get_bitcoin_node();

let wallets = node.list_wallets().await.unwrap();
Expand Down
21 changes: 21 additions & 0 deletions adapters/bitcoin/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ mod tests {

#[tokio::test]
async fn get_finalized_header() {
if std::env::var("EXCLUDE_BTC").is_ok() {
return;
}
let da_service = get_service().await;

let get_curr_header = da_service
Expand Down Expand Up @@ -551,6 +554,9 @@ mod tests {

#[tokio::test]
async fn get_block_at() {
if std::env::var("EXCLUDE_BTC").is_ok() {
return;
}
let da_service = get_service().await;

da_service
Expand All @@ -561,6 +567,9 @@ mod tests {

#[tokio::test]
async fn extract_relevant_blobs() {
if std::env::var("EXCLUDE_BTC").is_ok() {
return;
}
let da_service = get_service().await;

let block = da_service
Expand All @@ -578,6 +587,9 @@ mod tests {

#[tokio::test]
async fn extract_relevant_blobs_with_proof() {
if std::env::var("EXCLUDE_BTC").is_ok() {
return;
}
let da_service = get_service().await;

let block = da_service
Expand Down Expand Up @@ -650,6 +662,9 @@ mod tests {

#[tokio::test]
async fn send_transaction() {
if std::env::var("EXCLUDE_BTC").is_ok() {
return;
}
let da_service = get_service().await;

let blob = "01000000b60000002adbd76606f2bd4125080e6f44df7ba2d728409955c80b8438eb1828ddf23e3c12188eeac7ecf6323be0ed5668e21cc354fca90d8bca513d6c0a240c26afa7007b758bf2e7670fafaf6bf0015ce0ff5aa802306fc7e3f45762853ffc37180fe64a0000000001fea6ac5b8751120fb62fff67b54d2eac66aef307c7dde1d394dea1e09e43dd44c800000000000000135d23aee8cb15c890831ff36db170157acaac31df9bba6cd40e7329e608eabd0000000000000000";
Expand All @@ -661,6 +676,9 @@ mod tests {

#[tokio::test]
async fn send_transaction_with_fee_rate() {
if std::env::var("EXCLUDE_BTC").is_ok() {
return;
}
let da_service = get_service().await;
let fee_rate = da_service
.client
Expand All @@ -681,6 +699,9 @@ mod tests {

#[tokio::test]
async fn check_signature() {
if std::env::var("EXCLUDE_BTC").is_ok() {
return;
}
let rpc = BitcoinNode::new(
"http://localhost:38332".to_string(),
"chainway".to_string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ error[E0310]: the parameter type `S` may not live long enough
help: consider adding an explicit lifetime bound
|
101| struct Runtime<C: Context, S: TestSpec + 'static> {
| +++++++++
| +++++++++

0 comments on commit d60f2d0

Please sign in to comment.