WIP: refactor
Refactor * No more decorators, but rather types.AntiHandler * No more handlers, but rather types.MsgHandler * Ability to pass "stores" in NewXYZHandler() * Coins live in types, and Accounts have coins * Coinstore -> bank
This commit is contained in:
+13
-6
@@ -7,12 +7,13 @@ import (
|
||||
const (
|
||||
// ABCI Response Codes
|
||||
// Base SDK reserves 0 ~ 99.
|
||||
CodeInternalError uint32 = 1
|
||||
CodeTxParseError = 2
|
||||
CodeBadNonce = 3
|
||||
CodeUnauthorized = 4
|
||||
CodeInsufficientFunds = 5
|
||||
CodeUnknownRequest = 6
|
||||
CodeInternalError uint32 = 1
|
||||
CodeTxParseError = 2
|
||||
CodeBadNonce = 3
|
||||
CodeUnauthorized = 4
|
||||
CodeInsufficientFunds = 5
|
||||
CodeUnknownRequest = 6
|
||||
CodeUnrecognizedAddress = 7
|
||||
)
|
||||
|
||||
// NOTE: Don't stringer this, we'll put better messages in later.
|
||||
@@ -30,6 +31,8 @@ func CodeToDefaultLog(code uint32) string {
|
||||
return "Insufficent funds"
|
||||
case CodeUnknownRequest:
|
||||
return "Unknown request"
|
||||
case CodeUnrecognizeAddress:
|
||||
return "Unrecognized address"
|
||||
default:
|
||||
return fmt.Sprintf("Unknown code %d", code)
|
||||
}
|
||||
@@ -63,6 +66,10 @@ func UnknownRequest(log string) *sdkError {
|
||||
return newSDKError(CodeUnknownRequest, log)
|
||||
}
|
||||
|
||||
func UnrecognizedAddress(log string) *sdkError {
|
||||
return newSDKError(CodeUnrecognizedAddress, log)
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// ABCIError & sdkError
|
||||
|
||||
|
||||
Reference in New Issue
Block a user