agentswap 0.13.0

AgentSwap CLI for requesting quotes, inspecting tokens and pools, managing intents, and registering an API key against the AgentSwap service.
1
2
3
4
5
6
7
8
9
10
11
12
13
// Regression tests for main behavior.
// Uses the parent module and existing fixtures.
use super::*;
    use service::submit::{NotConfirmed, TxStatus, EXIT_REVERTED, EXIT_UNKNOWN};

    #[test]
    fn exit_status_tells_refused_from_reverted_from_unknown() {
        assert_eq!(exit_code(&eyre::eyre!("refused before signing")), 1);
        for (status, code) in [(TxStatus::Reverted, EXIT_REVERTED), (TxStatus::Unknown, EXIT_UNKNOWN)] {
            let failure = NotConfirmed::check(Some("0xab"), Some(status), None).unwrap();
            assert_eq!(exit_code(&eyre::Report::new(failure)), code);
        }
    }