Skip to content

Commit

Permalink
comments added
Browse files Browse the repository at this point in the history
  • Loading branch information
GrePod committed Nov 28, 2024
1 parent 5e8e5eb commit 8c7766c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/finalizer/finalization_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func NewSignatureCollection(message shared.Message, signingPolicy *policy.Signin
}
}

// addSignature adds signature to the signatures collection.
func (sc *signaturesCollection) addSignature(p *submitSignaturesPayload) (bool, error) {
if p.voterIndex < 0 {
return false, fmt.Errorf("voter not recognized")
Expand Down
3 changes: 3 additions & 0 deletions client/finalizer/finalizer_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type finalizerDBImpl struct {
client *gorm.DB
}

// FetchLogsByAddressAndTopic0 fetches all transactions with selector sent to address in time range (from to].
func (db finalizerDBImpl) FetchTransactionsByAddressAndSelector(
address common.Address, selector []byte, from, to int64,
) ([]database.Transaction, error) {
Expand All @@ -34,6 +35,7 @@ func (db finalizerDBImpl) FetchTransactionsByAddressAndSelector(
})
}

// FetchLogsByAddressAndTopic0 fetches all transactions with selector sent to address in block range higher than from.
func (db finalizerDBImpl) FetchTransactionsByAddressAndSelectorFromBlockNumber(
address common.Address, selector []byte, from int64,
) ([]database.Transaction, error) {
Expand All @@ -44,6 +46,7 @@ func (db finalizerDBImpl) FetchTransactionsByAddressAndSelectorFromBlockNumber(
})
}

// FetchLogsByAddressAndTopic0 fetches all logs with topic0 emitted by address in time range (from to].
func (db finalizerDBImpl) FetchLogsByAddressAndTopic0(
address common.Address, topic0 common.Hash, from, to int64,
) ([]database.Log, error) {
Expand Down
1 change: 1 addition & 0 deletions client/finalizer/finalizer_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func (p *finalizerQueueProcessor) isVoterForCurrentEpoch(item *queueItem) bool {
return voters[p.relayClient.senderAddress]
}

// processItem prepares and sends finalization transaction for item.
func (p *finalizerQueueProcessor) processItem(ctx context.Context, item *queueItem, isDelayed bool) {
if item == nil {
return
Expand Down
2 changes: 1 addition & 1 deletion utils/chain/tx_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func baseFee(ctx context.Context, client *ethclient.Client) (*big.Int, error) {
return (*big.Int)(&result), err
}

// SendRawTypeTx prepares and sends EIP-1559 transaction. The value sent is 0.
// SendRawType2Tx prepares and sends EIP-1559 transaction. The value sent is 0.
func SendRawType2Tx(client *ethclient.Client, privateKey *ecdsa.PrivateKey, toAddress common.Address, data []byte, dryRun bool, gasConfig *config.Gas, timeout time.Duration) error {
publicKey := privateKey.Public()
publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
Expand Down

0 comments on commit 8c7766c

Please sign in to comment.