Skip to content

Commit

Permalink
rename CheckEventProcessability as IsEventProcessable
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Nov 20, 2024
1 parent 93fefe7 commit 5e4e6d7
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions zetaclient/chains/bitcoin/observer/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ func ValidateStandardMemo(memoStd memo.InboundMemo, chainID int64) error {
return nil
}

// CheckEventProcessability checks if the inbound event is processable
func (ob *Observer) CheckEventProcessability(event BTCInboundEvent) bool {
// IsEventProcessable checks if the inbound event is processable
func (ob *Observer) IsEventProcessable(event BTCInboundEvent) bool {
// check if the event is processable
switch result := event.Processability(); result {
case clienttypes.InboundProcessabilityGood:
Expand Down
4 changes: 2 additions & 2 deletions zetaclient/chains/bitcoin/observer/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func Test_ValidateStandardMemo(t *testing.T) {
}
}

func Test_CheckEventProcessability(t *testing.T) {
func Test_IsEventProcessable(t *testing.T) {
// can use any bitcoin chain for testing
chain := chains.BitcoinMainnet
params := mocks.MockChainParams(chain.ChainId, 10)
Expand Down Expand Up @@ -345,7 +345,7 @@ func Test_CheckEventProcessability(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := ob.CheckEventProcessability(tt.event)
result := ob.IsEventProcessable(tt.event)
require.Equal(t, tt.result, result)
})
}
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/chains/bitcoin/observer/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func (ob *Observer) GetInboundVoteFromBtcEvent(event *BTCInboundEvent) *crosscha
}

// check if the event is processable
if !ob.CheckEventProcessability(*event) {
if !ob.IsEventProcessable(*event) {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion zetaclient/chains/bitcoin/signer/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func (signer *Signer) TryProcessOutbound(
if err != nil {
logger.Warn().
Err(err).
Msgf("SignConnectorOnReceive error: nonce %d chain %d", outboundTssNonce, params.ReceiverChainId)
Msgf("SignWithdrawTx error: nonce %d chain %d", outboundTssNonce, params.ReceiverChainId)
return
}
logger.Info().
Expand Down
10 changes: 5 additions & 5 deletions zetaclient/chains/evm/observer/v2_inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/zeta-chain/node/zetaclient/zetacore"
)

// checkEventProcessability checks if the event is processable
func (ob *Observer) checkEventProcessability(
// IsEventProcessable checks if the event is processable
func (ob *Observer) IsEventProcessable(
sender, receiver ethcommon.Address,
txHash ethcommon.Hash,
payload []byte,
Expand Down Expand Up @@ -99,7 +99,7 @@ func (ob *Observer) ObserveGatewayDeposit(ctx context.Context, startBlock, toBlo
}

// check if the event is processable
if !ob.checkEventProcessability(event.Sender, event.Receiver, event.Raw.TxHash, event.Payload) {
if !ob.IsEventProcessable(event.Sender, event.Receiver, event.Raw.TxHash, event.Payload) {
continue
}

Expand Down Expand Up @@ -247,7 +247,7 @@ func (ob *Observer) ObserveGatewayCall(ctx context.Context, startBlock, toBlock
}

// check if the event is processable
if !ob.checkEventProcessability(event.Sender, event.Receiver, event.Raw.TxHash, event.Payload) {
if !ob.IsEventProcessable(event.Sender, event.Receiver, event.Raw.TxHash, event.Payload) {
continue
}

Expand Down Expand Up @@ -378,7 +378,7 @@ func (ob *Observer) ObserveGatewayDepositAndCall(ctx context.Context, startBlock
}

// check if the event is processable
if !ob.checkEventProcessability(event.Sender, event.Receiver, event.Raw.TxHash, event.Payload) {
if !ob.IsEventProcessable(event.Sender, event.Receiver, event.Raw.TxHash, event.Payload) {
continue
}

Expand Down
6 changes: 3 additions & 3 deletions zetaclient/chains/solana/observer/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func (ob *Observer) BuildInboundVoteMsgFromEvent(event *clienttypes.InboundEvent
}

// check if the event is processable
if !ob.CheckEventProcessability(*event) {
if !ob.IsEventProcessable(*event) {
return nil
}

Expand Down Expand Up @@ -305,8 +305,8 @@ func (ob *Observer) BuildInboundVoteMsgFromEvent(event *clienttypes.InboundEvent
return msg
}

// CheckEventProcessability checks if the inbound event is processable
func (ob *Observer) CheckEventProcessability(event clienttypes.InboundEvent) bool {
// IsEventProcessable checks if the inbound event is processable
func (ob *Observer) IsEventProcessable(event clienttypes.InboundEvent) bool {
switch result := event.Processability(); result {
case clienttypes.InboundProcessabilityGood:
return true
Expand Down
4 changes: 2 additions & 2 deletions zetaclient/chains/solana/observer/inbound_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func Test_BuildInboundVoteMsgFromEvent(t *testing.T) {
})
}

func Test_CheckEventProcessability(t *testing.T) {
func Test_IsEventProcessable(t *testing.T) {
// parepare params
chain := chains.SolanaDevnet
params := sample.ChainParams(chain.ChainId)
Expand Down Expand Up @@ -210,7 +210,7 @@ func Test_CheckEventProcessability(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := ob.CheckEventProcessability(tt.event)
result := ob.IsEventProcessable(tt.event)
require.Equal(t, tt.result, result)
})
}
Expand Down

0 comments on commit 5e4e6d7

Please sign in to comment.