Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
RequiemOfSoul committed Nov 13, 2023
1 parent e5e0635 commit 7d43600
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
5 changes: 3 additions & 2 deletions bindings/sdk/src/ffi.udl
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ dictionary UpdateGlobalVarBuilder {
u64 serial_id;
};

dictionary FundingRate {
dictionary FundingInfo {
PairId pair_id;
BigUint price;
i16 funding_rate;
};

Expand Down Expand Up @@ -380,7 +381,7 @@ interface Parameter {
FeeAccount(AccountId account_id);
InsuranceFundAccount(AccountId account_id);
MarginInfo(MarginId margin_id, TokenId token_id, u8 ratio);
FundingRates( sequence<FundingRate> funding_rates );
FundingInfos( sequence<FundingInfo> infos );
InitialMarginRate(PairId pair_id, u16 rate);
MaintenanceMarginRate(PairId pair_id, u16 rate);
};
Expand Down
2 changes: 1 addition & 1 deletion provider/src/response.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bigdecimal::num_bigint::BigInt;
use bigdecimal::BigDecimal;
use std::collections::HashMap;
use bigdecimal::num_bigint::BigInt;

use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
Expand Down
9 changes: 6 additions & 3 deletions types/src/tx_type/contract/funding.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
use crate::basic_types::pack::pack_fee_amount;
use crate::basic_types::{AccountId, GetBytes, Nonce, PairId, SubAccountId, TokenId};
use crate::params::{FUNDING_RATE_BYTES, PAIR_BIT_WIDTH, PRICE_BIT_WIDTH, SIGNED_BATCH_FUNDING_BIT_WIDTH, SIGNED_FUNDING_BIT_WIDTH};
use crate::params::{
FUNDING_RATE_BYTES, PAIR_BIT_WIDTH, PRICE_BIT_WIDTH, SIGNED_BATCH_FUNDING_BIT_WIDTH,
SIGNED_FUNDING_BIT_WIDTH,
};
use crate::prelude::pad_front;
use crate::prelude::validator::*;
#[cfg(feature = "ffi")]
use crate::tx_builder::FundingBuilder;
use crate::tx_type::{TxTrait, ZkSignatureTrait};
use num::BigUint;
use num::traits::ToBytes;
use num::BigUint;
use serde::{Deserialize, Serialize};
use validator::Validate;
use zklink_sdk_signers::zklink_signer::ZkLinkSignature;
use zklink_sdk_utils::serde::BigUintSerdeAsRadix10Str;
use crate::prelude::pad_front;

#[derive(Default, Debug, Clone, Serialize, Deserialize, Validate)]
#[serde(rename_all = "camelCase")]
Expand Down
2 changes: 1 addition & 1 deletion types/src/tx_type/contract/update_global_var.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl GetBytes for Parameter {
.into_iter()
.chain(rate.to_be_bytes())
.collect(),
Parameter::FundingInfos{ infos } => infos.get_bytes(),
Parameter::FundingInfos { infos } => infos.get_bytes(),
});
bytes
}
Expand Down
4 changes: 3 additions & 1 deletion types/src/tx_type/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ pub fn order_nonce_validator(nonce: &Nonce) -> Result<(), ValidationError> {
///
pub fn parameter_validator(param: &Parameter) -> Result<(), ValidationError> {
match param {
Parameter::FundingInfos { infos: funding_rates } => {
Parameter::FundingInfos {
infos: funding_rates,
} => {
if funding_rates.len() != USED_POSITION_NUMBER {
return Err(ValidationError::new("update funding rates number mismatch"));
}
Expand Down

0 comments on commit 7d43600

Please sign in to comment.