Skip to content

Commit

Permalink
System_CodeUpdated event will be skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Navoichyk committed Mar 16, 2022
1 parent e8915a4 commit 6cd79ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
# Release Notes

## vNext
- ...

## v2.3.1
- Block with `System_CodeUpdated` event will be skipped

## v2.3.0
- Added condition to prevent excess execution of executeProposal method
Expand Down
5 changes: 5 additions & 0 deletions chains/substrate/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"math/big"
"time"
"strings"

"github.com/Cerebellum-Network/ChainBridge/chains"
utils "github.com/Cerebellum-Network/ChainBridge/shared/substrate"
Expand Down Expand Up @@ -198,6 +199,10 @@ func (l *listener) processEvents(hash types.Hash) error {
e := utils.Events{}
err = records.DecodeEventRecords(&meta, &e)
if err != nil {
if strings.Contains(fmt.Sprint(err), "System_CodeUpdated") {
l.log.Warn("Can not decode System_CodeUpdated. Skipping...", "block", hash.Hex())
return nil
}
return err
}

Expand Down

0 comments on commit 6cd79ae

Please sign in to comment.