mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00

* [NOD-423] Rename BestBlock to SelectedTip * [NOD-423] Implement GetSelectedTip RPC command * [NOD-423] Add help to getSelectedTip command * [NOD-423] Fix getSelectedTip test * [NOD-423] Fix tests so they would compile. These tests will need to be rewriten at some point. * [NOD-423] Make integration test compile. Test need to be revisited * [NOD-423] Rename variables * [NOD-423] Change comment s about best block to selected tip. * [NOD-423] Update comment * [NOD-423] Change height to bluescore
75 lines
2.1 KiB
Go
75 lines
2.1 KiB
Go
// Copyright (c) 2014 The btcsuite developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package btcjson
|
|
|
|
// Standard JSON-RPC 2.0 errors.
|
|
var (
|
|
ErrRPCInvalidRequest = &RPCError{
|
|
Code: -32600,
|
|
Message: "Invalid request",
|
|
}
|
|
ErrRPCMethodNotFound = &RPCError{
|
|
Code: -32601,
|
|
Message: "Method not found",
|
|
}
|
|
ErrRPCInvalidParams = &RPCError{
|
|
Code: -32602,
|
|
Message: "Invalid parameters",
|
|
}
|
|
ErrRPCInternal = &RPCError{
|
|
Code: -32603,
|
|
Message: "Internal error",
|
|
}
|
|
ErrRPCParse = &RPCError{
|
|
Code: -32700,
|
|
Message: "Parse error",
|
|
}
|
|
)
|
|
|
|
// General application defined JSON errors.
|
|
const (
|
|
ErrRPCMisc RPCErrorCode = -1
|
|
ErrRPCForbiddenBySafeMode RPCErrorCode = -2
|
|
ErrRPCType RPCErrorCode = -3
|
|
ErrRPCInvalidAddressOrKey RPCErrorCode = -5
|
|
ErrRPCOutOfMemory RPCErrorCode = -7
|
|
ErrRPCInvalidParameter RPCErrorCode = -8
|
|
ErrRPCDatabase RPCErrorCode = -20
|
|
ErrRPCDeserialization RPCErrorCode = -22
|
|
ErrRPCVerify RPCErrorCode = -25
|
|
)
|
|
|
|
// Peer-to-peer client errors.
|
|
const (
|
|
ErrRPCClientNotConnected RPCErrorCode = -9
|
|
ErrRPCClientInInitialDownload RPCErrorCode = -10
|
|
ErrRPCClientNodeNotAdded RPCErrorCode = -24
|
|
)
|
|
|
|
// Specific Errors related to commands. These are the ones a user of the RPC
|
|
// server are most likely to see. Generally, the codes should match one of the
|
|
// more general errors above.
|
|
const (
|
|
ErrRPCBlockNotFound RPCErrorCode = -5
|
|
ErrRPCBlockCount RPCErrorCode = -5
|
|
ErrRPCSelectedTipHash RPCErrorCode = -5
|
|
ErrRPCDifficulty RPCErrorCode = -5
|
|
ErrRPCOutOfRange RPCErrorCode = -1
|
|
ErrRPCNoTxInfo RPCErrorCode = -5
|
|
ErrRPCNoAcceptanceIndex RPCErrorCode = -5
|
|
ErrRPCNoCFIndex RPCErrorCode = -5
|
|
ErrRPCNoNewestBlockInfo RPCErrorCode = -5
|
|
ErrRPCInvalidTxVout RPCErrorCode = -5
|
|
ErrRPCSubnetworkNotFound RPCErrorCode = -5
|
|
ErrRPCRawTxString RPCErrorCode = -32602
|
|
ErrRPCDecodeHexString RPCErrorCode = -22
|
|
ErrRPCOrphanBlock RPCErrorCode = -6
|
|
)
|
|
|
|
// Errors that are specific to btcd.
|
|
const (
|
|
ErrRPCUnimplemented RPCErrorCode = -1
|
|
)
|