(txHash string)
| 488 | } |
| 489 | |
| 490 | func 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 | |
| 502 | func GetBlock(hashOrHeight interface{}) ([]byte, error) { |
| 503 | data, ontErr := sendRpcRequest("getblock", []interface{}{hashOrHeight, 1}) |
no test coverage detected