Skip to content

Commit

Permalink
feat: Change capacity field to String type in RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
xxuejie committed Apr 10, 2019
1 parent 4c8166c commit 9925d4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions util/jsonrpc-types/src/blockchain.rs
Expand Up @@ -45,7 +45,7 @@ impl From<CoreScript> for Script {

#[derive(Clone, Default, Serialize, Deserialize, PartialEq, Eq, Hash, Debug)]
pub struct CellOutput {
pub capacity: Capacity,
pub capacity: String,
pub data: Bytes,
pub lock: Script,
#[serde(rename = "type")]
Expand All @@ -56,7 +56,7 @@ impl From<CoreCellOutput> for CellOutput {
fn from(core: CoreCellOutput) -> CellOutput {
let (capacity, data, lock, type_) = core.destruct();
CellOutput {
capacity,
capacity: capacity.to_string(),
data: Bytes::new(data),
lock: lock.into(),
type_: type_.map(Into::into),
Expand All @@ -81,7 +81,7 @@ impl TryFrom<CellOutput> for CoreCellOutput {
};

Ok(CoreCellOutput::new(
capacity,
capacity.parse::<Capacity>()?,
data.into_vec(),
lock.try_into()?,
type_,
Expand Down

0 comments on commit 9925d4e

Please sign in to comment.