Skip to content

Commit

Permalink
Update rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
crossle committed Oct 12, 2022
1 parent ba10b2c commit 1e2aa3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mixin/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,17 @@ func SignTransactionRaw(node string, account common.Address, rawStr string) (str
return hex.EncodeToString(d.Marshal()), nil
}

func SentRawTransaction(node string, raw string) error {
func SentRawTransaction(node string, raw string) (string, error) {
data, err := callRPC(node, "sendrawtransaction", []interface{}{raw})
if err != nil {
return err
return "", err
}
var resp struct {
Hash string `json:"hash"`
}
err = json.Unmarshal(data, &resp)
if err != nil {
return err
return "", err
}
return nil
return resp.Hash, nil
}

0 comments on commit 1e2aa3f

Please sign in to comment.