Skip to content

Commit

Permalink
Merge branch 'main' into 2024-09-09-watchlist-renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
hardyjosh authored Sep 9, 2024
2 parents 02245bf + 29161eb commit 26c6dd4
Show file tree
Hide file tree
Showing 32 changed files with 869 additions and 350 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/manual-package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ on:
jobs:
release:
runs-on: ubuntu-latest
env:
DEPLOYMENT_KEY: ${{ github.ref == 'refs/heads/main' && secrets.PRIVATE_KEY || secrets.PRIVATE_KEY_DEV }}
DEPLOY_METABOARD_ADDRESS: ${{ vars.CI_DEPLOY_SEPOLIA_METABOARD_ADDRESS }}
CI_FORK_SEPOLIA_BLOCK_NUMBER: ${{ vars.CI_FORK_SEPOLIA_BLOCK_NUMBER }}
CI_FORK_SEPOLIA_DEPLOYER_ADDRESS: ${{ vars.CI_FORK_SEPOLIA_DEPLOYER_ADDRESS }}
CI_DEPLOY_SEPOLIA_RPC_URL: ${{ secrets.CI_DEPLOY_SEPOLIA_RPC_URL || vars.CI_DEPLOY_SEPOLIA_RPC_URL }}
CI_SEPOLIA_METABOARD_URL: ${{ vars.CI_SEPOLIA_METABOARD_URL }}
CI_DEPLOY_POLYGON_RPC_URL: ${{ secrets.CI_DEPLOY_POLYGON_RPC_URL }}
RPC_URL_ETHEREUM_FORK: ${{ secrets.RPC_URL_ETHEREUM_FORK }}
CI_DEPLOY_FLARE_RPC_URL: ${{ secrets.CI_DEPLOY_FLARE_RPC_URL }}
COMMIT_SHA: ${{ github.sha }}
outputs:
version: ${{ env.NEW_VERSION }}
steps:
Expand Down
27 changes: 26 additions & 1 deletion .github/workflows/tauri-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,33 @@ jobs:
CI_SEPOLIA_METABOARD_URL: ${{ vars.CI_SEPOLIA_METABOARD_URL }}
RPC_URL_ETHEREUM_FORK: ${{ secrets.RPC_URL_ETHEREUM_FORK }}
COMMIT_SHA: ${{ github.sha }}

steps:
- name: Free up disk space in action runner (Ubuntu)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get clean
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Free up disk space in action runner (Macos)
if: matrix.platform == 'macos-13' || matrix.platform == 'macos-14'
run: |
sudo rm -rf \
"$AGENT_TOOLSDIRECTORY" \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/lib/node_modules \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
df -h /
find /Applications/ -name "Xcode*" | sort -r | tail --lines=+2 | xargs rm -rf
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/tauri.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,31 @@ jobs:
RPC_URL_ETHEREUM_FORK: ${{ secrets.RPC_URL_ETHEREUM_FORK }}
COMMIT_SHA: ${{ github.sha }}
steps:
- name: Free up disk space in action runner
- name: Free up disk space in action runner (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get clean
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Free up disk space in action runner (Macos)
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: |
sudo rm -rf \
"$AGENT_TOOLSDIRECTORY" \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/lib/node_modules \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
df -h /
find /Applications/ -name "Xcode*" | sort -r | tail --lines=+2 | xargs rm -rf
- uses: actions/checkout@v4
with:
Expand All @@ -48,3 +67,4 @@ jobs:
working-directory: ./tauri-app
- run: nix develop .#tauri-shell --command cargo tauri build --verbose
working-directory: ./tauri-app
- run: nix develop .#tauri-shell --command tauri-rs-test
30 changes: 16 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ derive_builder = "0.20.0"
thirtyfour = "0.31.0"
test-context = "0.3.0"
portpicker = "0.1.1"
rain-orderbook-env = { path = "crates/env" }
rain-erc = { git = "https://github.com/rainlanguage/rain.erc", rev = "80bb411b161c1ee992a7974d325a783214046d5b" }
rain-error-decoding = { git = "https://github.com/rainlanguage/rain.error", rev = "72d9577fdaf7135113847027ba951f9a43b41827" }

Expand Down
1 change: 0 additions & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ tokio = { workspace = true, features = ["sync", "macros", "io-util", "rt", "time
httpmock = "0.7.0"
serde_json = { workspace = true }
rain-metadata = { workspace = true }
rain-orderbook-env = { workspace = true }
2 changes: 1 addition & 1 deletion crates/cli/src/commands/order/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ _ _: 0 0;
:;
#handle-add-order
:;"#,
raindex_version = rain_orderbook_env::GH_COMMIT_SHA
raindex_version = "1234"
)
.to_string()
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands/order/calldata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ _ _: 0 0;
#handle-add-order
:;",
rpc_server.url("/rpc").as_str(),
raindex_version = rain_orderbook_env::GH_COMMIT_SHA
raindex_version = "1234"
);

let dotrain_path = "./test_dotrain1.rain";
Expand Down
1 change: 0 additions & 1 deletion crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ csv = { workspace = true }
chrono = { workspace = true }
futures = { workspace = true }
rain-error-decoding = { workspace = true }
rain-orderbook-env = { workspace = true }

[target.'cfg(not(target_family = "wasm"))'.dependencies]
tokio = { workspace = true, features = ["full"] }
Expand Down
48 changes: 20 additions & 28 deletions crates/common/src/add_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,18 +269,18 @@ impl AddOrderArgs {

#[cfg(test)]
mod tests {
use super::*;
use rain_orderbook_app_settings::{
deployer::Deployer,
network::Network,
order::{Order, OrderIO},
scenario::Scenario,
token::Token,
};
use rain_orderbook_test_fixtures::LocalEvm;
use std::sync::Arc;

use rain_orderbook_app_settings::deployer::Deployer;
use rain_orderbook_app_settings::network::Network;
use rain_orderbook_app_settings::order::{Order, OrderIO};
use rain_orderbook_app_settings::scenario::Scenario;
use rain_orderbook_app_settings::token::Token;
use rain_orderbook_env::CI_DEPLOY_POLYGON_RPC_URL;
use url::Url;

use super::*;

#[test]
fn test_try_generate_meta() {
let dotrain_body = String::from(
Expand Down Expand Up @@ -378,7 +378,7 @@ price: 2e18;
async fn test_add_order_random_vault_id_generation() {
let network = Network {
name: "test-network".to_string(),
rpc: Url::parse(CI_DEPLOY_POLYGON_RPC_URL).unwrap(),
rpc: Url::parse("https://some-rpc.com").unwrap(),
chain_id: 137,
label: None,
network_id: None,
Expand Down Expand Up @@ -458,7 +458,7 @@ _ _: 0 0;
#handle-add-order
_ _: 0 0;
"#,
raindex_version = rain_orderbook_env::GH_COMMIT_SHA
raindex_version = "1234"
);
let result = AddOrderArgs::new_from_deployment(dotrain.to_string(), deployment)
.await
Expand All @@ -473,9 +473,10 @@ _ _: 0 0;

#[tokio::test]
async fn test_into_add_order_call() {
let local_evm = LocalEvm::new_with_tokens(2).await;
let network = Network {
name: "test-network".to_string(),
rpc: Url::parse(CI_DEPLOY_POLYGON_RPC_URL).unwrap(),
rpc: Url::parse(&local_evm.url()).unwrap(),
chain_id: 137,
label: None,
network_id: None,
Expand All @@ -484,9 +485,7 @@ _ _: 0 0;
let network_arc = Arc::new(network);
let deployer = Deployer {
network: network_arc.clone(),
address: "0xF14E09601A47552De6aBd3A0B165607FaFd2B5Ba"
.parse::<Address>()
.unwrap(),
address: *local_evm.deployer.address(),
label: None,
};
let deployer_arc = Arc::new(deployer);
Expand Down Expand Up @@ -556,16 +555,13 @@ _ _: 0 0;
#handle-add-order
_ _: 0 0;
"#,
raindex_version = rain_orderbook_env::GH_COMMIT_SHA
raindex_version = "1234"
);
let result = AddOrderArgs::new_from_deployment(dotrain.to_string(), deployment)
.await
.unwrap();

let add_order_call = result
.try_into_call(CI_DEPLOY_POLYGON_RPC_URL.to_string())
.await
.unwrap();
let add_order_call = result.try_into_call(local_evm.url()).await.unwrap();

assert_eq!(add_order_call.config.validInputs.len(), 2);
assert_eq!(add_order_call.config.validOutputs.len(), 1);
Expand Down Expand Up @@ -596,16 +592,12 @@ _ _: 0 0;

assert_eq!(
add_order_call.tasks[0].evaluable.interpreter,
"0x6352593f4018c99df731de789e2a147c7fb29370"
.parse::<Address>()
.unwrap()
*local_evm.interpreter.address()
);

assert_eq!(
add_order_call.tasks[0].evaluable.store,
"0xde38ad4b13d5258a5653e530ecdf0ca71b4e8a51"
.parse::<Address>()
.unwrap()
*local_evm.store.address()
);

assert_eq!(add_order_call.tasks[0].evaluable.bytecode.len(), 111);
Expand All @@ -616,7 +608,7 @@ _ _: 0 0;
async fn test_add_order_post_action() {
let network = Network {
name: "test-network".to_string(),
rpc: Url::parse(CI_DEPLOY_POLYGON_RPC_URL).unwrap(),
rpc: Url::parse("https://some-rpc.com").unwrap(),
chain_id: 137,
label: None,
network_id: None,
Expand Down Expand Up @@ -696,7 +688,7 @@ _ _: 0 0;
#handle-add-order
_ _: 0 0;
"#,
raindex_version = rain_orderbook_env::GH_COMMIT_SHA
raindex_version = "1234"
);
let result = AddOrderArgs::new_from_deployment(dotrain.to_string(), deployment.clone())
.await
Expand Down
2 changes: 1 addition & 1 deletion crates/common/src/dotrain_order/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::GH_COMMIT_SHA;
use crate::{
add_order::{ORDERBOOK_ADDORDER_POST_TASK_ENTRYPOINTS, ORDERBOOK_ORDER_ENTRYPOINTS},
rainlang::compose_to_rainlang,
Expand All @@ -13,7 +14,6 @@ use rain_orderbook_app_settings::{
merge::MergeError,
Config, ParseConfigSourceError,
};
use rain_orderbook_env::GH_COMMIT_SHA;
use serde::Serialize;
use thiserror::Error;
use typeshare::typeshare;
Expand Down
Loading

0 comments on commit 26c6dd4

Please sign in to comment.