Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hardyjosh committed Sep 2, 2024
1 parent 992cfce commit 4c0409d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tauri-app/src-tauri/src/commands/order_quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,19 @@ pub async fn debug_order_quote(
#[cfg(test)]
mod tests {
use super::*;
use crate::error::CommandError;
use rain_orderbook_common::subgraph::SubgraphArgs;
use rain_orderbook_env::CI_DEPLOY_POLYGON_RPC_URL;
use rain_orderbook_subgraph_client::types::order_detail::{self, Bytes};
use std::str::FromStr;

#[tokio::test]
async fn test_debug_order_quote() {
let order = order_detail::Order {
id: order_detail::RainMetaV1::default(),
id: order_detail::RainMetaV1 {
0: "0x01".to_string(),
},
orderbook: order_detail::Orderbook {
id: Bytes("0x2f209e5b67a33b8fe96e28f24628df6da301c8eb".to_string()),
},
order_bytes: Bytes("0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000008e4bdeec7ceb9570d440676345da1dce10329f5b00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000076000000000000000000000000000000000000000000000000000000000000007e0eccd7aa9a9f8af012d11a874253fdd8b48fd35c63f21cf97d0c33f6d141268db0000000000000000000000006352593f4018c99df731de789e2a147c7fb29370000000000000000000000000de38ad4b13d5258a5653e530ecdf0ca71b4e8a51000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006250000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000001158e460913d000000000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000340aad21b3b7000008d5061727469616c2074726164650000000000000000000000000000000000008c636f6f6c646f776e2d6b65790000000000000000000000000000000000000088636f6f6c646f776e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000029a2241af62c00000000000000000000000000000000000000000000000000003782dace9d90000000000000000000000000000000000000000000000000000003782dace9d900008764656661756c7400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000e1b3eb06806601828976e491914e3de18b5d6b280000000000000000000000003c499c542cef5e3811e1192ce70d8cc03d5c33590000000000000000000000005757371414417b8c6caad45baef941abc7d3ab3296e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f00000000000000000000000000000000000000000000000000b1a2bc2ec50000896d696e20726174696f000000000000000000000000000000000000000000008d5072696365206368616e67652e000000000000000000000000000000000000000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000214e8348c4f0000000000000000000000010001bc609623f5020f6fc7481024862cd5ee3fff52d700000000000000000000000000000000000000000000000000000000000002c50c00000060008000c801b401e00204021c0220026c02840288170900070b200002001000000b1100030010000201100001011000003d1200003d120000001000030b11000401100002001000012b120000001000004812000100100004001000030b230005001000060b01000600100006001000050b020007070300000110000303100002031001044412000003100404211200001d020000110500021a10000001100004031000010c120000491100000110000501100002001000012b12000000100000211200001d0200000010000001100004031000010c1200004a0200003a14010701100006001000000b12000801100007001000000b12000801100001001000000b12000801100008001000000b12000801100009001000000b1200080110000c0110000b001000050110000700100005251200000110000a00100005211200001f120000001000040110000700100004251200000110000a00100004211200001f120000001000030110000700100003251200000110000a00100003211200001f120000001000020110000700100002251200000110000a00100002211200001f120000001000010110000700100001251200000110000a00100001211200001f1200001c1c00000a060104011000100110000f001000000110000e0110000d02250018001000020b010009001000010b11000a0806030600100000001000020b11000b00100001481200012e120000001000000010000305040101011000120110001100100000201200001d020000000202021207020600100001001000000c12000007111400061100000110000701100006001000000c1200003c12000000100003001000022b12000001100000011000072b120000001000042e12000005040101011000131a10000000100000241200001d0200000001010108050102011000170010000001100016011000152e12000001100014271300003b12000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000003c499c542cef5e3811e1192ce70d8cc03d5c33590000000000000000000000000000000000000000000000000000000000000006d302fedcbf6b3ea84812cde736439a97478b93fce4b546bc445f837f255893840000000000000000000000000000000000000000000000000000000000000001000000000000000000000000e1b3eb06806601828976e491914e3de18b5d6b280000000000000000000000000000000000000000000000000000000000000012d302fedcbf6b3ea84812cde736439a97478b93fce4b546bc445f837f25589384".to_string()) ,
order_hash: Bytes("0x01".to_string()),
owner: Bytes("0x01".to_string()),
Expand All @@ -165,7 +168,7 @@ mod tests {
active: true,
add_events: vec![],
meta: None,
timestamp_added: 0.into(),
timestamp_added: order_detail::BigInt(0.to_string()),
};

let inputIOIndex = 0;
Expand Down
1 change: 1 addition & 0 deletions tauri-app/src/lib/components/modal/ModalQuoteDebug.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ test('renders table with the correct data', async () => {
open: true,
order: {
id: '1',
orderbook: { id: '0x00' },
order_bytes: '0x123',
order_hash: '0x123',
owner: '0x123',
Expand Down
1 change: 1 addition & 0 deletions tauri-app/src/lib/queries/orderQuote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ if (import.meta.vitest) {
const result = await debugOrderQuote(
{
id: '1',
orderbook: { id: '0x00' },
order_bytes: '0x123',
order_hash: '0x123',
owner: '0x123',
Expand Down

0 comments on commit 4c0409d

Please sign in to comment.