Skip to content

Commit

Permalink
Update types and btc header (paritytech#313)
Browse files Browse the repository at this point in the history
* Update ValidatorInfo type

* Update bitcoin header

* Fix chainx_types

* Add RpcTotalAssetInfo
  • Loading branch information
liuchengxu authored Oct 28, 2020
1 parent 98b2919 commit ba8151e
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 101 deletions.
16 changes: 8 additions & 8 deletions cli/src/res/btc_genesis_params_testnet.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"network": "Testnet",
"confirmation_number": 4,
"height": 1863782,
"hash": "0000000000000028b60eab797448c45f3d3a2e330a01c6185972a0f17c343596",
"version": 536870912,
"previous_header_hash": "0000000033d510af6a3efd5b5b9f80b3ff4b7726781952eadc858b1f25c4e264",
"merkle_root_hash": "45d052603c79655f94bff51d6c011ab44287aba39765bd2b911acebd863e8d73",
"time": 1603244738,
"bits": 436259028,
"nonce": 3031814716
"height": 1865225,
"hash": "000000000000000ebe4d600e523ac18285d5ffd4a15ce7f7e94427bcb9d5daec",
"version": 671080448,
"previous_header_hash": "00000000000000266addf9be31441caa8ee034dcc98e5e12afce43857b113846",
"merkle_root_hash": "e3f1880660223b676ee6645e1d249818d2ad34404d7c83b3142dd2bff609893b",
"time": 1603865822,
"bits": 436254651,
"nonce": 3239452607
}
2 changes: 1 addition & 1 deletion scripts/chainx-js/chainx_rpc_manual.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"isOptional": true
}
],
"type": "BTreeMap<AssetId, TotalAssetInfo>"
"type": "BTreeMap<AssetId, RpcTotalAssetInfo>"
}
}
}
111 changes: 59 additions & 52 deletions scripts/chainx-js/chainx_types_manual.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,22 @@
"order_type": "OrderType",
"created_at": "BlockNumber"
},
"RpcOrder": {
"order_id": "OrderId",
"side": "Side",
"price": "Price",
"amount": "Balance",
"pair_id": "TradingPairId",
"submitter": "AccountId",
"order_type": "OrderType",
"created_at": "BlockNumber",
"status": "OrderStatus",
"remaining": "Balance",
"executed_indices": "Vec<TradingHistoryIndex>",
"already_filled": "Balance",
"reserved_balance": "Balance",
"last_update_at": "BlockNumber"
},
"TotalAssetInfo": {
"info": "AssetInfo",
"balance": "BTreeMap<AssetType, Balance>",
"is_online": "bool",
"restrictions": "AssetRestrictions"
},
"NominatorLedger": {
"nomination": "Balance",
"last_vote_weight": "VoteWeight",
"last_vote_weight_update": "BlockNumber",
"unbonded_chunks": "Vec<Unbonded>"
},
"Unbonded": {
"value": "Balance",
"locked_until": "BlockNumber"
},
"WithdrawalRecordId": "u32",
"WithdrawalState": {
"_enum": [
Expand Down Expand Up @@ -184,60 +178,85 @@
"RuntimeInterface"
]
},
"RpcTotalAssetInfo": {
"info": "AssetInfo",
"balance": "BTreeMap<AssetType, RpcBalance>",
"is_online": "bool",
"restrictions": "AssetRestrictions"
},
"RpcOrder": {
"order_id": "OrderId",
"side": "Side",
"price": "RpcPrice",
"amount": "RpcBalance",
"pair_id": "TradingPairId",
"submitter": "AccountId",
"order_type": "OrderType",
"created_at": "BlockNumber",
"status": "OrderStatus",
"remaining": "RpcBalance",
"executed_indices": "Vec<TradingHistoryIndex>",
"already_filled": "RpcBalance",
"reserved_balance": "RpcBalance",
"last_update_at": "BlockNumber"
},
"RpcWithdrawalRecord": {
"asset_id": "AssetId",
"applicant": "AccountId",
"balance": "RpcBalance",
"addr": "String",
"ext": "String",
"height": "BlockNumber",
"state": "WithdrawalState"
},
"ValidatorInfo": {
"account": "AccountId",
"registered_at": "BlockNumber",
"is_chilled": "bool",
"last_chilled": "Option<BlockNumber>",
"total": "Balance",
"last_total_vote_weight": "VoteWeight",
"total_nomination": "RpcBalance",
"last_total_vote_weight": "RpcVoteWeight",
"last_total_vote_weight_update": "BlockNumber",
"is_validating": "bool",
"self_bonded": "Balance",
"self_bonded": "RpcBalance",
"referral_id": "String",
"reward_pot_account": "AccountId",
"reward_pot_balance": "Balance"
"reward_pot_balance": "RpcBalance"
},
"FullPairInfo": {
"base_currency": "AssetId",
"highest_bid": "Price",
"highest_bid": "RpcPrice",
"id": "TradingPairId",
"latest_price": "Price",
"latest_price": "RpcPrice",
"latest_price_updated_at": "BlockNumber",
"lowest_ask": "Price",
"max_valid_bid": "Price",
"min_valid_ask": "Price",
"lowest_ask": "RpcPrice",
"max_valid_bid": "RpcPrice",
"min_valid_ask": "RpcPrice",
"pip_decimals": "u32",
"quote_currency": "AssetId",
"tick_decimals": "u32",
"tradable": "bool"
},
"NominatorLedger": {
"nomination": "Balance",
"last_vote_weight": "VoteWeight",
"last_vote_weight_update": "BlockNumber",
"unbonded_chunks": "Vec<Unbonded>"
},
"MiningAssetInfo": {
"asset_id": "AssetId",
"mining_power": "FixedAssetPower",
"reward_pot": "AccountId",
"reward_pot_balance": "Balance",
"last_total_mining_weight": "MiningWeight",
"reward_pot_balance": "RpcBalance",
"last_total_mining_weight": "RpcMiningWeight",
"last_total_mining_weight_update": "BlockNumber"
},
"Unbonded": {
"value": "Balance",
"locked_until": "BlockNumber"
},
"Depth": {
"asks": "Vec<(Price, Balance)>",
"bids": "Vec<(Price, Balance)>"
"asks": "Vec<(RpcPrice, RpcBalance)>",
"bids": "Vec<(RpcPrice, RpcBalance)>"
},
"Page": {
"page_index": "u32",
"page_size": "u32",
"data": "Vec<RpcOrder>"
},
"AssetRestrictions": {
"bits": "u32"
},
"String": "Text",
"Price": "u128",
"Balance": "u128",
Expand All @@ -247,20 +266,8 @@
"RpcBalance": "String",
"RpcMiningWeight": "String",
"RpcVoteWeight": "String",
"AssetRestrictions": {
"bits": "u32"
},
"OrderInfo": "Order",
"HandicapInfo": "Handicap",
"FullIdentification": "ValidatorId",
"WithdrawalRecordOf": "WithdrawalRecord",
"RpcWithdrawalRecord": {
"asset_id": "AssetId",
"applicant": "AccountId",
"balance": "Balance",
"addr": "String",
"ext": "String",
"height": "BlockNumber",
"state": "WithdrawalState"
}
"WithdrawalRecordOf": "WithdrawalRecord"
}
2 changes: 1 addition & 1 deletion scripts/chainx-js/res/chainx_rpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"isOptional": true
}
],
"type": "BTreeMap<AssetId, TotalAssetInfo>"
"type": "BTreeMap<AssetId, RpcTotalAssetInfo>"
}
},
"xspot": {
Expand Down
85 changes: 46 additions & 39 deletions scripts/chainx-js/res/chainx_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
"assetId": "AssetId",
"miningPower": "FixedAssetPower",
"rewardPot": "AccountId",
"rewardPotBalance": "Balance",
"lastTotalMiningWeight": "MiningWeight",
"rewardPotBalance": "RpcBalance",
"lastTotalMiningWeight": "RpcMiningWeight",
"lastTotalMiningWeightUpdate": "BlockNumber"
},
"AssetLedger": {
Expand Down Expand Up @@ -219,22 +219,6 @@
"orderType": "OrderType",
"createdAt": "BlockNumber"
},
"RpcOrder": {
"orderId": "OrderId",
"side": "Side",
"price": "Price",
"amount": "Balance",
"pairId": "TradingPairId",
"submitter": "AccountId",
"orderType": "OrderType",
"createdAt": "BlockNumber",
"status": "OrderStatus",
"remaining": "Balance",
"executedIndices": "Vec<TradingHistoryIndex>",
"alreadyFilled": "Balance",
"reservedBalance": "Balance",
"lastUpdateAt": "BlockNumber"
},
"TotalAssetInfo": {
"info": "AssetInfo",
"balance": "BTreeMap<AssetType, Balance>",
Expand Down Expand Up @@ -347,36 +331,68 @@
"RuntimeInterface"
]
},
"RpcTotalAssetInfo": {
"info": "AssetInfo",
"balance": "BTreeMap<AssetType, RpcBalance>",
"isOnline": "bool",
"restrictions": "AssetRestrictions"
},
"RpcOrder": {
"orderId": "OrderId",
"side": "Side",
"price": "RpcPrice",
"amount": "RpcBalance",
"pairId": "TradingPairId",
"submitter": "AccountId",
"orderType": "OrderType",
"createdAt": "BlockNumber",
"status": "OrderStatus",
"remaining": "RpcBalance",
"executedIndices": "Vec<TradingHistoryIndex>",
"alreadyFilled": "RpcBalance",
"reservedBalance": "RpcBalance",
"lastUpdateAt": "BlockNumber"
},
"RpcWithdrawalRecord": {
"assetId": "AssetId",
"applicant": "AccountId",
"balance": "RpcBalance",
"addr": "String",
"ext": "String",
"height": "BlockNumber",
"state": "WithdrawalState"
},
"ValidatorInfo": {
"account": "AccountId",
"registeredAt": "BlockNumber",
"isChilled": "bool",
"lastChilled": "Option<BlockNumber>",
"total": "Balance",
"lastTotalVoteWeight": "VoteWeight",
"totalNomination": "RpcBalance",
"lastTotalVoteWeight": "RpcVoteWeight",
"lastTotalVoteWeightUpdate": "BlockNumber",
"isValidating": "bool",
"selfBonded": "Balance",
"selfBonded": "RpcBalance",
"referralId": "String",
"rewardPotAccount": "AccountId",
"rewardPotBalance": "Balance"
"rewardPotBalance": "RpcBalance"
},
"FullPairInfo": {
"baseCurrency": "AssetId",
"highestBid": "Price",
"highestBid": "RpcPrice",
"id": "TradingPairId",
"latestPrice": "Price",
"latestPrice": "RpcPrice",
"latestPriceUpdatedAt": "BlockNumber",
"lowestAsk": "Price",
"maxValidBid": "Price",
"minValidAsk": "Price",
"lowestAsk": "RpcPrice",
"maxValidBid": "RpcPrice",
"minValidAsk": "RpcPrice",
"pipDecimals": "u32",
"quoteCurrency": "AssetId",
"tickDecimals": "u32",
"tradable": "bool"
},
"Depth": {
"asks": "Vec<(Price, Balance)>",
"bids": "Vec<(Price, Balance)>"
"asks": "Vec<(RpcPrice, RpcBalance)>",
"bids": "Vec<(RpcPrice, RpcBalance)>"
},
"Page": {
"pageIndex": "u32",
Expand All @@ -390,14 +406,5 @@
"RpcMiningWeight": "String",
"RpcVoteWeight": "String",
"FullIdentification": "ValidatorId",
"WithdrawalRecordOf": "WithdrawalRecord",
"RpcWithdrawalRecord": {
"assetId": "AssetId",
"applicant": "AccountId",
"balance": "Balance",
"addr": "String",
"ext": "String",
"height": "BlockNumber",
"state": "WithdrawalState"
}
"WithdrawalRecordOf": "WithdrawalRecord"
}

0 comments on commit ba8151e

Please sign in to comment.