MCPcopy Create free account
hub / github.com/DNAProject/DNA / GetRawTransaction

Function GetRawTransaction

cmd/utils/gas.go:490–500  ·  view source on GitHub ↗
(txHash string)

Source from the content-addressed store, hash-verified

488}
489
490func GetRawTransaction(txHash string) ([]byte, error) {
491 data, ontErr := sendRpcRequest("getrawtransaction", []interface{}{txHash, 1})
492 if ontErr == nil {
493 return data, nil
494 }
495 switch ontErr.ErrorCode {
496 case ERROR_INVALID_PARAMS:
497 return nil, fmt.Errorf("invalid TxHash:%s", txHash)
498 }
499 return nil, ontErr.Error
500}
501
502func GetBlock(hashOrHeight interface{}) ([]byte, error) {
503 data, ontErr := sendRpcRequest("getblock", []interface{}{hashOrHeight, 1})

Callers 1

txInfoFunction · 0.92

Calls 2

sendRpcRequestFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected