Skip to content

Commit

Permalink
Merge pull request #2 from xpladev/my/test-x
Browse files Browse the repository at this point in the history
test: validity of transaction bytes generated by CreateAndSignTx()
  • Loading branch information
Moonyongjung committed Sep 4, 2023
2 parents 682a9f9 + 58b0389 commit 687ea0f
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 10 deletions.
12 changes: 12 additions & 0 deletions client/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ func ResetModuleAndMsgXplac(xplac *XplaClient) *XplaClient {
WithMsgType("").
WithMsg(nil)
}

func (xplac *XplaClient) EncodedTxbytesToJsonTx(txbytes []byte) ([]byte, error) {
sdkTx, err := xplac.GetEncoding().TxConfig.TxDecoder()(txbytes)
if err != nil {
return nil, err
}
jsonTx, err := xplac.GetEncoding().TxConfig.TxJSONEncoder()(sdkTx)
if err != nil {
return nil, err
}
return jsonTx, nil
}
Loading

0 comments on commit 687ea0f

Please sign in to comment.