diff --git a/.github/workflows/book.yaml b/.github/workflows/book.yaml index 6ed80422..8db70081 100644 --- a/.github/workflows/book.yaml +++ b/.github/workflows/book.yaml @@ -109,24 +109,4 @@ jobs: name: github-pages path: ${{ runner.temp }}/artifact.tar retention-days: 1 - if-no-files-found: error - - deploy: - # Only deploy if a push to main - if: github.ref_name == 'main' && github.event_name == 'push' - runs-on: ubuntu-latest - needs: [test, lint, build] - - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e352f284..2ef226cb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,7 +7,7 @@ on: jobs: test: name: test - runs-on: macos-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/arbiter-core/src/data_collection.rs b/arbiter-core/src/data_collection.rs index 1e0bc9ff..cccc1bdb 100644 --- a/arbiter-core/src/data_collection.rs +++ b/arbiter-core/src/data_collection.rs @@ -163,7 +163,7 @@ impl EventLogger { /// directories or files, or writing to the files. pub fn run(self) -> Result<(), RevmMiddlewareError> { let receiver = self.receiver.unwrap(); - let dir = self.directory.unwrap_or("./out".into()); + let dir = self.directory.unwrap_or("./data".into()); let file_name = self.file_name.unwrap_or("output".into()); std::thread::spawn(move || { let mut logs: BTreeMap>> = BTreeMap::new(); diff --git a/arbiter-core/src/tests/data_output.rs b/arbiter-core/src/tests/data_output.rs deleted file mode 100644 index e499978a..00000000 --- a/arbiter-core/src/tests/data_output.rs +++ /dev/null @@ -1,94 +0,0 @@ -use tokio::io::AsyncReadExt; -use tracing_test::traced_test; - -use super::*; -use crate::data_collection::EventLogger; - -#[traced_test] -#[tokio::test(flavor = "multi_thread")] -async fn data_capture() { - let (env, client) = startup_user_controlled().unwrap(); - let (arbx, arby, lex) = deploy_liquid_exchange(client.clone()).await.unwrap(); - println!("Deployed contracts"); - - let listener = EventLogger::builder() - .add(arbx.events(), "arbx") - .add(arby.events(), "arby") - .add(lex.events(), "lex"); - - listener.run().unwrap(); - - for _ in 0..5 { - arbx.approve(client.address(), U256::from(1)) - .send() - .await - .unwrap() - .await - .unwrap(); - arby.approve(client.address(), U256::from(1)) - .send() - .await - .unwrap() - .await - .unwrap(); - lex.set_price(U256::from(10u128.pow(18))) - .send() - .await - .unwrap() - .await - .unwrap(); - } - - env.stop(); - tokio::fs::remove_dir_all("./out").await.unwrap(); -} - -#[traced_test] -#[tokio::test(flavor = "multi_thread")] -async fn data_capture_output_validation() { - let (env, client) = startup_user_controlled().unwrap(); - let (arbx, arby, lex) = deploy_liquid_exchange(client.clone()).await.unwrap(); - let listener = EventLogger::builder() - .add(arbx.events(), "arbx") - .add(arby.events(), "arby") - .add(lex.events(), "lex"); - - listener.run().unwrap(); - - for _ in 0..5 { - arbx.approve(client.address(), U256::from(1)) - .send() - .await - .unwrap() - .await - .unwrap(); - arby.approve(client.address(), U256::from(1)) - .send() - .await - .unwrap() - .await - .unwrap(); - lex.set_price(U256::from(10u128.pow(18))) - .send() - .await - .unwrap() - .await - .unwrap(); - } - - env.stop(); - let mut file0 = tokio::fs::File::open("./out/output.json").await.unwrap(); - let mut contents0 = vec![]; - file0.read_to_end(&mut contents0).await.unwrap(); - let contents0 = String::from_utf8(contents0).unwrap(); - - let mut file1 = tokio::fs::File::open("./src/tests/output_test.json") - .await - .unwrap(); - let mut contents1 = vec![]; - file1.read_to_end(&mut contents1).await.unwrap(); - let contents1 = String::from_utf8(contents1).unwrap(); - - assert_eq!(contents0, contents1); - tokio::fs::remove_dir_all("./out").await.unwrap(); -} diff --git a/arbiter-core/src/tests/mod.rs b/arbiter-core/src/tests/mod.rs index e1a382b4..1c03f26a 100644 --- a/arbiter-core/src/tests/mod.rs +++ b/arbiter-core/src/tests/mod.rs @@ -4,7 +4,6 @@ // mod interaction; mod clients; mod contracts; -mod data_output; mod derives; mod environment_control; mod middleware_instructions; diff --git a/arbiter-core/src/tests/output_test.json b/arbiter-core/src/tests/output_test.json deleted file mode 100644 index 4fe4e5c4..00000000 --- a/arbiter-core/src/tests/output_test.json +++ /dev/null @@ -1 +0,0 @@ -{"arbx":{"ApprovalFilter":[{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"},{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"},{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"},{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"},{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"}]},"arby":{"ApprovalFilter":[{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"},{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"},{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"},{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"},{"owner":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","spender":"0x2efdc9eecfee3a776209fcb8e9a83a6b221d74f5","amount":"0x1"}]},"lex":{"PriceChangeFilter":[{"price":"0xde0b6b3a7640000"},{"price":"0xde0b6b3a7640000"},{"price":"0xde0b6b3a7640000"},{"price":"0xde0b6b3a7640000"},{"price":"0xde0b6b3a7640000"}]}} \ No newline at end of file