Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
refactor: Refactor StdSignDoc to bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
code0xff committed Sep 10, 2024
1 parent e8996e8 commit a060c72
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frame/cosmos/x/auth/signing/src/sign_mode_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ pub enum SignModeHandlerError {
EmptyModeInfo,
DecodeTxError,
InvalidMsg,
InvalidMode,
SerializeError,
UnsupportedMode,
}

pub struct SignModeHandler;
Expand Down Expand Up @@ -109,11 +109,12 @@ impl traits::SignModeHandler for SignModeHandler {
msgs,
sequence: data.sequence.to_string(),
};
serde_json::to_value(sign_doc).map_err(|_| SignModeHandlerError::SerializeError)?.to_string().as_bytes().to_vec()

serde_json::to_vec(&sign_doc).map_err(|_| SignModeHandlerError::SerializeError)?
},
_ => return Err(SignModeHandlerError::InvalidMode),
_ => return Err(SignModeHandlerError::UnsupportedMode),
},
_ => return Err(SignModeHandlerError::InvalidMode),
_ => return Err(SignModeHandlerError::UnsupportedMode),
};

Ok(sign_bytes)
Expand Down

0 comments on commit a060c72

Please sign in to comment.