-
Notifications
You must be signed in to change notification settings - Fork 169
/
query.go
34 lines (26 loc) · 984 Bytes
/
query.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
package types
import (
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// ValidateBasic runs stateless checks on the query requests
func (q QueryFeeShareRequest) ValidateBasic() error {
if _, err := sdk.AccAddressFromBech32(q.ContractAddress); err != nil {
return errorsmod.Wrapf(err, "invalid contract address %s", q.ContractAddress)
}
return nil
}
// ValidateBasic runs stateless checks on the query requests
func (q QueryDeployerFeeSharesRequest) ValidateBasic() error {
if _, err := sdk.AccAddressFromBech32(q.DeployerAddress); err != nil {
return errorsmod.Wrapf(err, "invalid deployer address %s", q.DeployerAddress)
}
return nil
}
// ValidateBasic runs stateless checks on the query requests
func (q QueryWithdrawerFeeSharesRequest) ValidateBasic() error {
if _, err := sdk.AccAddressFromBech32(q.WithdrawerAddress); err != nil {
return errorsmod.Wrapf(err, "invalid withdraw address %s", q.WithdrawerAddress)
}
return nil
}