Skip to content

Commit f9609bb

Browse files
authored
remove SignedBalance in assets (paritytech#196)
* remove SignedBalance in assets * fix types json * remove signedbalance in types_gen
1 parent bb841e4 commit f9609bb

File tree

5 files changed

+3
-28
lines changed

5 files changed

+3
-28
lines changed

scripts/chainx-js/chainx_types_manual.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@
5151
"order_type": "OrderType",
5252
"created_at": "BlockNumber"
5353
},
54-
"SignedBalance": {
55-
"_enum": {
56-
"Negative": "Balance",
57-
"Positive": "Balance"
58-
}
59-
},
6054
"TotalAssetInfoForRpc": {
6155
"info": "AssetInfoForRpc",
6256
"balance": "BTreeMap<AssetType, String>",

scripts/chainx-js/res/chainx_types.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
{
2-
"SignedBalance": {
3-
"_enum": {
4-
"Negative": "Balance",
5-
"Positive": "Balance"
6-
}
7-
},
82
"AssetType": {
93
"_enum": [
104
"Usable",

scripts/chainx-js/types_gen.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def ctags_has_json_support():
4343

4444
NEW_TYPES = [
4545
"AssetType",
46-
"SignedBalance",
4746
"Chain",
4847
"AddrStr",
4948
"OrderExecutedInfo",
@@ -82,7 +81,6 @@ def ctags_has_json_support():
8281
"PriceFluctuation",
8382
"Selector",
8483
"Side",
85-
"SignedBalance",
8684
"StakingRequirement",
8785
"Token",
8886
"TradingHistoryIndex",

xpallets/assets/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub use xpallet_assets_registrar::{AssetInfo, Chain};
4848
pub use self::traits::{ChainT, OnAssetChanged};
4949
use self::trigger::AssetChangedTrigger;
5050
pub use self::types::{
51-
AssetErr, AssetRestriction, AssetRestrictions, AssetType, BalanceLock, SignedBalance,
52-
TotalAssetInfo, WithdrawalLimit,
51+
AssetErr, AssetRestriction, AssetRestrictions, AssetType, BalanceLock, TotalAssetInfo,
52+
WithdrawalLimit,
5353
};
5454

5555
pub type BalanceOf<T> =
@@ -109,14 +109,11 @@ decl_event!(
109109
pub enum Event<T> where
110110
<T as frame_system::Trait>::AccountId,
111111
Balance = BalanceOf<T>,
112-
SignedBalance = SignedBalance<T>,
113112
{
114113
Move(AssetId, AccountId, AssetType, AccountId, AssetType, Balance),
115114
Issue(AssetId, AccountId, Balance),
116115
Destory(AssetId, AccountId, Balance),
117116
Set(AssetId, AccountId, AssetType, Balance),
118-
/// change token balance, SignedBalance mark Positive or Negative
119-
Change(AssetId, AccountId, AssetType, SignedBalance),
120117
/// set AssetRestrictions for an Asset
121118
SetRestrictions(AssetId, AssetRestrictions),
122119
}

xpallets/assets/src/types.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@ pub use chainx_primitives::{Decimals, Desc, Token};
1414
pub use xp_runtime::Memo;
1515
use xpallet_assets_registrar::AssetInfo;
1616

17-
use super::{BalanceOf, Error, Trait};
17+
use super::{Error, Trait};
1818
use frame_support::traits::LockIdentifier;
1919

20-
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)]
21-
pub enum SignedBalance<T: Trait> {
22-
/// A positive imbalance (funds have been created but none destroyed).
23-
Positive(BalanceOf<T>),
24-
/// A negative imbalance (funds have been destroyed but none created).
25-
Negative(BalanceOf<T>),
26-
}
27-
2820
#[derive(PartialEq, PartialOrd, Ord, Eq, Clone, Copy, Encode, Decode, RuntimeDebug)]
2921
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
3022
pub enum AssetType {

0 commit comments

Comments
 (0)