Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-zkp committed Nov 10, 2023
1 parent cd2bd7b commit a9fe81d
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 26 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ jobs:
go-version: 1.21
- run: make test_go

build_wasm:
name: build wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
with:
command: make build_wasm

test:
name: cargo test
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion bindings/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg(target_arch = "wasm32")]
pub mod contract_types;
#[cfg(feature = "web")]
pub mod json_rpc_signer;
pub mod rpc_client;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ use zklink_sdk_provider::response::{
SubAccountBalances, SubAccountOrders, TokenResp, TxHashOrDetailResp, TxResp, ZkLinkTxHistory,
};
use zklink_sdk_signers::zklink_signer::ZkLinkSignature;
use zklink_sdk_types::basic_types::bigunit_wrapper::BigUintSerdeWrapper;
use zklink_sdk_types::basic_types::tx_hash::TxHash;
use zklink_sdk_types::basic_types::{AccountId, BlockNumber, ChainId, SubAccountId, TokenId};
use zklink_sdk_types::prelude::BigUintSerdeWrapper;
use zklink_sdk_types::prelude::ZkLinkAddress;
use zklink_sdk_types::signatures::TxLayer1Signature as TypesTxLayer1Signature;
use zklink_sdk_types::tx_type::zklink_tx::ZkLinkTx;
Expand Down
15 changes: 7 additions & 8 deletions bindings/wasm/src/signer.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use crate::contract_types::funding::Funding;
use crate::contract_types::liquidation::Liquidation;
use crate::contract_types::{
auto_deleveraging::AutoDeleveraging, contract_matching::ContractMatching,
};
use crate::tx_types::change_pubkey::{ChangePubKey, Create2Data};
use crate::tx_types::contract::auto_deleveraging::AutoDeleveraging;
use crate::tx_types::contract::contract_matching::ContractMatching;
use crate::tx_types::contract::funding::Funding;
use crate::tx_types::contract::liquidation::Liquidation;
use crate::tx_types::forced_exit::ForcedExit;
use crate::tx_types::order_matching::{Order, OrderMatching};
use crate::tx_types::transfer::Transfer;
Expand All @@ -12,12 +11,12 @@ use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::JsValue;
use zklink_sdk_interface::signer::Signer as InterfaceSigner;
use zklink_sdk_types::basic_types::ZkLinkAddress;
use zklink_sdk_types::contract::{
use zklink_sdk_types::tx_type::change_pubkey::ChangePubKey as TxChangePubKey;
use zklink_sdk_types::tx_type::change_pubkey::Create2Data as ChangePubKeyCreate2Data;
use zklink_sdk_types::tx_type::contract::{
AutoDeleveraging as TxAutoDeleveraging, ContractMatching as TxContractMatching,
Funding as TxFunding, Liquidation as TxLiquidation,
};
use zklink_sdk_types::tx_type::change_pubkey::ChangePubKey as TxChangePubKey;
use zklink_sdk_types::tx_type::change_pubkey::Create2Data as ChangePubKeyCreate2Data;
use zklink_sdk_types::tx_type::forced_exit::ForcedExit as TxForcedExit;
use zklink_sdk_types::tx_type::order_matching::{
Order as TxOrder, OrderMatching as TxOrderMatching,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use std::str::FromStr;
use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::JsValue;
use zklink_sdk_types::basic_types::BigUint;
use zklink_sdk_types::contract::{
use zklink_sdk_types::tx_builder::AutoDeleveragingBuilder as TxAutoDeleveragingBuilder;
use zklink_sdk_types::tx_type::contract::{
AutoDeleveraging as AutoDeleveragingTx, ContractPrice as InnerContractPrice,
SpotPriceInfo as InnerSpotPriceInfo,
};
use zklink_sdk_types::tx_builder::AutoDeleveragingBuilder as TxAutoDeleveragingBuilder;

#[wasm_bindgen]
pub struct AutoDeleveraging {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use std::str::FromStr;
use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::JsValue;
use zklink_sdk_types::basic_types::BigUint;
use zklink_sdk_types::contract::{
Contract as InnerContract, ContractMatching as ContractMatchingTx,
};
use zklink_sdk_types::tx_builder::{
ContractBuilder as TxContractBuilder, ContractMatchingBuilder as TxContractMatchingBuilder,
};
use zklink_sdk_types::tx_type::contract::{
Contract as InnerContract, ContractMatching as ContractMatchingTx,
};

#[wasm_bindgen]
pub struct ContractMatching {
Expand Down Expand Up @@ -97,8 +97,8 @@ impl ContractBuilder {
size: String,
price: String,
direction: bool,
maker_fee_ratio: u8,
taker_fee_ratio: u8,
maker_fee_rate: u8,
taker_fee_rate: u8,
has_subsidy: bool,
) -> Result<ContractBuilder, JsValue> {
let inner = TxContractBuilder {
Expand All @@ -110,8 +110,8 @@ impl ContractBuilder {
size: BigUint::from_str(&size).unwrap(),
price: BigUint::from_str(&price).unwrap(),
direction,
maker_fee_ratio,
taker_fee_ratio,
maker_fee_rate,
taker_fee_rate,
has_subsidy,
};
Ok(ContractBuilder { inner })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ use std::str::FromStr;
use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::JsValue;
use zklink_sdk_types::basic_types::BigUint;
use zklink_sdk_types::contract::{Funding as InnerFunding, FundingRate as InnerFundingRate};
use zklink_sdk_types::tx_builder::FundingBuilder as TxFundingBuilder;
use zklink_sdk_types::tx_type::contract::{
Funding as InnerFunding, FundingRate as InnerFundingRate,
};

#[wasm_bindgen]
pub struct FundingRate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use std::str::FromStr;
use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::JsValue;
use zklink_sdk_types::basic_types::BigUint;
use zklink_sdk_types::contract::Liquidation as LiquidationTx;
use zklink_sdk_types::contract::{
use zklink_sdk_types::tx_builder::LiquidationBuilder as TxLiquidationBuilder;
use zklink_sdk_types::tx_type::contract::Liquidation as LiquidationTx;
use zklink_sdk_types::tx_type::contract::{
ContractPrice as InnerContractPrice, SpotPriceInfo as InnerSpotPriceInfo,
};
use zklink_sdk_types::tx_builder::LiquidationBuilder as TxLiquidationBuilder;

#[wasm_bindgen]
pub struct Liquidation {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::str::FromStr;
use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::JsValue;
use zklink_sdk_types::basic_types::BigUint;
use zklink_sdk_types::contract::{
use zklink_sdk_types::tx_type::contract::{
ContractPrice as InnerContractPrice, SpotPriceInfo as InnerSpotPriceInfo,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use serde::Deserialize;
use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::JsValue;
use zklink_sdk_types::contract::{
use zklink_sdk_types::tx_builder::UpdateGlobalVarBuilder as TxUpdateGlobalVarBuilder;
use zklink_sdk_types::tx_type::contract::{
FundingRate as InnerFundingRate, Parameter as ContractParameter,
UpdateGlobalVar as UpdateGlobalVarTx,
};
use zklink_sdk_types::tx_builder::UpdateGlobalVarBuilder as TxUpdateGlobalVarBuilder;

#[wasm_bindgen]
pub struct UpdateGlobalVar {
Expand Down
1 change: 1 addition & 0 deletions bindings/wasm/src/tx_types/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod change_pubkey;
pub mod contract;
pub mod forced_exit;
pub mod order_matching;
pub mod transfer;
Expand Down

0 comments on commit a9fe81d

Please sign in to comment.