mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-06 23:50:35 +00:00
interop: fix ActiveFrom comparison when building HF-specific MD
These conditions are about filtering methods out. A method is excluded if its ActiveFrom is strictly higher than the current HF, since if it's the same then it should be present. Otherwise contract is broken at the height of this particular HF. Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
parent
ff15e39363
commit
d6c983bf6f
1 changed files with 2 additions and 2 deletions
|
@ -294,7 +294,7 @@ func (c *ContractMD) buildHFSpecificMD(hf config.Hardfork) {
|
|||
w := io.NewBufBinWriter()
|
||||
for i := range c.methods {
|
||||
m := c.methods[i]
|
||||
if !(m.ActiveFrom == nil || (hf != config.HFDefault && (*m.ActiveFrom).Cmp(hf) >= 0)) ||
|
||||
if (m.ActiveFrom != nil && (*m.ActiveFrom).Cmp(hf) > 0) ||
|
||||
(m.ActiveTill != nil && (*m.ActiveTill).Cmp(hf) <= 0) {
|
||||
continue
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ func (c *ContractMD) buildHFSpecificMD(hf config.Hardfork) {
|
|||
}
|
||||
for i := range c.events {
|
||||
e := c.events[i]
|
||||
if !(e.ActiveFrom == nil || (hf != config.HFDefault && (*e.ActiveFrom).Cmp(hf) >= 0)) ||
|
||||
if (e.ActiveFrom != nil && (*e.ActiveFrom).Cmp(hf) > 0) ||
|
||||
(e.ActiveTill != nil && (*e.ActiveTill).Cmp(hf) <= 0) {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue