Skip to content

Commit

Permalink
feat: adding error catching
Browse files Browse the repository at this point in the history
  • Loading branch information
HinsonSIDAN committed Feb 15, 2024
1 parent c21db6a commit a790718
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client/txmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ func (c *Client) TxManagerHistory() (*[]models.TxManagerState, error) {

func (c *Client) TxManagerSubmit(txHex string) (string, error) {
url := "/txmanager"
txBuffer, _ := hex.DecodeString(txHex)
txBuffer, err := hex.DecodeString(txHex)
if err != nil {
return "", err
}
resp, err := c.postBuffer(url, txBuffer)
if err != nil {
return "", err
Expand All @@ -42,7 +45,10 @@ func (c *Client) TxManagerSubmit(txHex string) (string, error) {

func (c *Client) TxManagerSubmitTurbo(txHex string) (string, error) {
url := "/txmanager/turbosubmit"
txBuffer, _ := hex.DecodeString(txHex)
txBuffer, err := hex.DecodeString(txHex)
if err != nil {
return "", err
}
resp, err := c.postBuffer(url, txBuffer)
if err != nil {
return "", err
Expand Down

0 comments on commit a790718

Please sign in to comment.