-
Notifications
You must be signed in to change notification settings - Fork 575
/
errors.go
36 lines (28 loc) · 996 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package types
import (
"errors"
"fmt"
)
var (
ErrEmptyPoolIds = errors.New("pool id list cannot be empty")
ErrNoneOfCodeIdAndContractCodeSpecified = errors.New("both code id and byte code are unset. Only one must be specified.")
ErrBothOfCodeIdAndContractCodeSpecified = errors.New("both code id and byte code are set. Only one must be specified.")
)
type InvalidPoolTypeError struct {
ActualPool interface{}
}
func (e InvalidPoolTypeError) Error() string {
return fmt.Sprintf("given pool does not implement cosmwasm pool extension, implements %T", e.ActualPool)
}
type PoolNotFoundError struct {
PoolId uint64
}
func (e PoolNotFoundError) Error() string {
return fmt.Sprintf("pool not found. pool id (%d)", e.PoolId)
}
type CodeIdNotWhitelistedError struct {
CodeId uint64
}
func (e CodeIdNotWhitelistedError) Error() string {
return fmt.Sprintf("cannot create coswasm pool with the given code id (%d). Please whitelist it via governance", e.CodeId)
}