Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration test for auth failure between mining_device and a pool #1164

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
cargo build --manifest-path=roles/Cargo.toml
cargo build --manifest-path=utils/Cargo.toml

- name: Roles Integration Tests
run: |
cargo test --manifest-path=roles/Cargo.toml --verbose --test '*' -- --nocapture

- name: Run sv1-client-and-server example
run: |
cargo run --manifest-path=examples/sv1-client-and-server/Cargo.toml --bin client_and_server -- 60
Expand Down
2 changes: 2 additions & 0 deletions protocols/v2/roles-logic-sv2/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub enum Error {
HashrateError(InputError),
LogicErrorMessage(std::boxed::Box<AllMessages<'static>>),
JDSMissingTransactions,
MiningChannelError(u32),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to add this error type? Also, let's not prepend the variant with the word Error as it is redundant.

Suggested change
MiningChannelError(u32),
MiningChannel(u32),

}

impl From<BinarySv2Error> for Error {
Expand Down Expand Up @@ -153,6 +154,7 @@ impl Display for Error {
HashrateError(e) => write!(f, "Impossible to get Hashrate: {:?}", e),
LogicErrorMessage(e) => write!(f, "Message is well formatted but can not be handled: {:?}", e),
JDSMissingTransactions => write!(f, "JD server cannot propagate the block: missing transactions"),
MiningChannelError(e) => write!(f, "Mining channel error: {:?}", e),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we come up with a more descriptive error message here?

Suggested change
MiningChannelError(e) => write!(f, "Mining channel error: {:?}", e),
MiningChannel(e) => write!(f, "Mining channel error: {:?}", e),

}
}
}
Loading
Loading