We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7aa53a7 commit 209a22bCopy full SHA for 209a22b
x/clp/types/params.go
@@ -81,12 +81,18 @@ func (p Params) Validate() error { // TODO determine all checks
81
if err := validatePmtpEndBlock(p.PmtpEndBlock); err != nil {
82
return err
83
}
84
- if p.PmtpEndBlock < (p.PmtpStartBlock) {
+ if p.PmtpEndBlock < p.PmtpStartBlock {
85
return fmt.Errorf(
86
"end block (%d) must be after begin block (%d)",
87
p.PmtpEndBlock, p.PmtpStartBlock,
88
)
89
90
+ if p.PmtpNativeWeight.Add(p.PmtpExternalWeight).GT(sdk.NewDec(1)) {
91
+ return fmt.Errorf(
92
+ "sum of native weight (%d) and external weight (%d) cannot exceed 1",
93
+ p.PmtpEndBlock, p.PmtpStartBlock,
94
+ )
95
+ }
96
return nil
97
98
0 commit comments