x/auth: cleanup ante handler

This commit is contained in:
Ethan Buchman
2018-03-17 18:34:06 +01:00
parent be7cb6c96c
commit 45f8ccbe90
3 changed files with 31 additions and 22 deletions
+6
View File
@@ -27,6 +27,7 @@ const (
CodeInsufficientFunds CodeType = 5
CodeUnknownRequest CodeType = 6
CodeUnrecognizedAddress CodeType = 7
CodeMissingPubKey CodeType = 8
CodeGenesisParse CodeType = 0xdead // TODO: remove ?
)
@@ -50,6 +51,8 @@ func CodeToDefaultMsg(code CodeType) string {
return "Unknown request"
case CodeUnrecognizedAddress:
return "Unrecognized address"
case CodeMissingPubKey:
return "Missing pubkey"
default:
return fmt.Sprintf("Unknown code %d", code)
}
@@ -84,6 +87,9 @@ func ErrUnknownRequest(msg string) Error {
func ErrUnrecognizedAddress(addr Address) Error {
return newError(CodeUnrecognizedAddress, addr.String())
}
func ErrMissingPubKey(addr Address) Error {
return newError(CodeMissingPubKey, addr.String())
}
//----------------------------------------
// Error & sdkError
+1 -1
View File
@@ -78,7 +78,7 @@ func FeePayer(tx Tx) Address {
}
// StdFee includes the amount of coins paid in fees and the maximum
// gas to be used by the transaction. The ratio yields an effectie "gasprice",
// gas to be used by the transaction. The ratio yields an effective "gasprice",
// which must be above some miminum to be accepted into the mempool.
type StdFee struct {
Amount Coins `json"amount"`