Skip to content

Commit

Permalink
feat(go/escrow): add error for invalid depositor (#155)
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian authored Apr 20, 2024
1 parent 29a9f9b commit c1e33eb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
5 changes: 5 additions & 0 deletions go/node/escrow/v1beta3/account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package v1beta3

func (m *Account) HasDepositor() bool {
return m.Owner != m.Depositor
}
28 changes: 15 additions & 13 deletions go/node/escrow/v1beta3/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,22 @@ const (
errInvalidSettlement
errInvalidAccountID
errInvalidAccount
errInvalidAcountDepositor
)

var (
ErrAccountExists = sdkerrors.Register(ModuleName, errAccountExists, "account exists")
ErrAccountClosed = sdkerrors.Register(ModuleName, errAccountClosed, "account closed")
ErrAccountNotFound = sdkerrors.Register(ModuleName, errAccountNotFound, "account not found")
ErrAccountOverdrawn = sdkerrors.Register(ModuleName, errAccountOverdrawn, "account overdrawn")
ErrInvalidDenomination = sdkerrors.Register(ModuleName, errInvalidDenomination, "invalid denomination")
ErrPaymentExists = sdkerrors.Register(ModuleName, errPaymentExists, "payment exists")
ErrPaymentClosed = sdkerrors.Register(ModuleName, errPaymentClosed, "payment closed")
ErrPaymentNotFound = sdkerrors.Register(ModuleName, errPaymentNotFound, "payment not found")
ErrPaymentRateZero = sdkerrors.Register(ModuleName, errPaymentRateZero, "payment rate zero")
ErrInvalidPayment = sdkerrors.Register(ModuleName, errInvalidPayment, "invalid payment")
ErrInvalidSettlement = sdkerrors.Register(ModuleName, errInvalidSettlement, "invalid settlement")
ErrInvalidAccountID = sdkerrors.Register(ModuleName, errInvalidAccountID, "invalid account ID")
ErrInvalidAccount = sdkerrors.Register(ModuleName, errInvalidAccount, "invalid account")
ErrAccountExists = sdkerrors.Register(ModuleName, errAccountExists, "account exists")
ErrAccountClosed = sdkerrors.Register(ModuleName, errAccountClosed, "account closed")
ErrAccountNotFound = sdkerrors.Register(ModuleName, errAccountNotFound, "account not found")
ErrAccountOverdrawn = sdkerrors.Register(ModuleName, errAccountOverdrawn, "account overdrawn")
ErrInvalidDenomination = sdkerrors.Register(ModuleName, errInvalidDenomination, "invalid denomination")
ErrPaymentExists = sdkerrors.Register(ModuleName, errPaymentExists, "payment exists")
ErrPaymentClosed = sdkerrors.Register(ModuleName, errPaymentClosed, "payment closed")
ErrPaymentNotFound = sdkerrors.Register(ModuleName, errPaymentNotFound, "payment not found")
ErrPaymentRateZero = sdkerrors.Register(ModuleName, errPaymentRateZero, "payment rate zero")
ErrInvalidPayment = sdkerrors.Register(ModuleName, errInvalidPayment, "invalid payment")
ErrInvalidSettlement = sdkerrors.Register(ModuleName, errInvalidSettlement, "invalid settlement")
ErrInvalidAccountID = sdkerrors.Register(ModuleName, errInvalidAccountID, "invalid account ID")
ErrInvalidAccount = sdkerrors.Register(ModuleName, errInvalidAccount, "invalid account")
ErrInvalidAccountDepositor = sdkerrors.Register(ModuleName, errInvalidAcountDepositor, "invalid account depositor")
)

0 comments on commit c1e33eb

Please sign in to comment.