-
Notifications
You must be signed in to change notification settings - Fork 3
🎨 Fee log cleanup #112
🎨 Fee log cleanup #112
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -142,14 +142,6 @@ func (fp FeePlugin) GetRecipeSpecification() rtypes.RecipeSchema { | |||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| // This wraps the logger with the plugin name and context "i.e the worker execution". | ||||||||
| func (fp *FeePlugin) Log(level logrus.Level, args ...interface{}) { | ||||||||
| fp.logger.WithFields(logrus.Fields{ | ||||||||
| "plugin": "fees", | ||||||||
| "context": "execution", | ||||||||
| }).Log(level, args...) | ||||||||
| } | ||||||||
|
|
||||||||
| func (fp *FeePlugin) GetPolicyFees(cfg BaseConfig) error { | ||||||||
| return nil | ||||||||
| } | ||||||||
|
|
@@ -167,33 +159,31 @@ func (fp *FeePlugin) SigningComplete(ctx context.Context, signature tss.KeysignR | |||||||
| // HANDLER FUNCTIONS | ||||||||
|
|
||||||||
| func (fp *FeePlugin) HandleCollections(ctx context.Context, task *asynq.Task) error { | ||||||||
| fp.Log(logrus.InfoLevel, "Starting Fee Collection Job") | ||||||||
| fp.logger.Info("Starting Fee Collection Job") | ||||||||
|
|
||||||||
| // Figure out if we're collecting fees by public key, policy, or plugin id | ||||||||
| feeCollectionFormat := FeeCollectionFormat{ | ||||||||
| FeeCollectionType: FeeCollectionTypeAll, | ||||||||
| } | ||||||||
| if len(task.Payload()) != 0 { | ||||||||
| if err := json.Unmarshal(task.Payload(), &feeCollectionFormat); err != nil { | ||||||||
| fp.Log(logrus.ErrorLevel, "Failed to unmarshal fee collection config") | ||||||||
| return err | ||||||||
| return fmt.Errorf("fp.HandleCollections, failed to unmarshall asynq task payload, %w", err) | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| switch feeCollectionFormat.FeeCollectionType { | ||||||||
| case FeeCollectionTypeByPublicKey: | ||||||||
| fp.Log(logrus.InfoLevel, "Collecting fees by public key") | ||||||||
| fp.logger.Info("Collecting fees by public key") | ||||||||
| return fp.collectFeesByPublicKey(feeCollectionFormat.Value) | ||||||||
| case FeeCollectionTypeByPolicy: | ||||||||
| fp.Log(logrus.InfoLevel, "Collecting fees by policy") | ||||||||
| fp.logger.Info("Collecting fees by policy") | ||||||||
| return fp.collectFeesByPolicy(feeCollectionFormat.Value) | ||||||||
| case FeeCollectionTypeByPluginID: | ||||||||
| fp.Log(logrus.InfoLevel, "Collecting fees by plugin id") | ||||||||
| fp.logger.Info("Collecting fees by plugin id") | ||||||||
|
||||||||
| fp.logger.Info("Collecting fees by plugin id") | |
| fp.logger.Info("Collecting fees by plugin id") | |
| return fp.collectFeesByPluginID(feeCollectionFormat.Value) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -121,7 +121,7 @@ func (fp *FeePlugin) ProposeTransactions(policy vtypes.PluginPolicy) ([]vtypes.P | |||||
|
|
||||||
| nonce, err := fp.nonceManager.GetNextNonce(ethAddress) | ||||||
| if err != nil { | ||||||
| return []vtypes.PluginKeysignRequest{}, fmt.Errorf("p.nonceManager.GetNextNonce: %w", err) | ||||||
| return []vtypes.PluginKeysignRequest{}, fmt.Errorf("plugincommon.nonceManager.GetNextNonce: %w", err) | ||||||
|
||||||
| return []vtypes.PluginKeysignRequest{}, fmt.Errorf("plugincommon.nonceManager.GetNextNonce: %w", err) | |
| return []vtypes.PluginKeysignRequest{}, fmt.Errorf("fp.nonceManager.GetNextNonce: %w", err) |
Copilot
AI
Jul 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference to fp.tx_indexer appears incorrect; the field is named fp.txIndexerService. Update the error prefix and field usage to the correct identifier to ensure accurate context and compilation.
| return []vtypes.PluginKeysignRequest{}, fmt.Errorf("fp.tx_indexer.CreateTx: %w", e) | |
| return []vtypes.PluginKeysignRequest{}, fmt.Errorf("fp.txIndexerService.CreateTx: %w", e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in error message: 'unmarshall' should be 'unmarshal'. Also consider rephrasing for consistency (e.g., 'failed to unmarshal asynq task payload: %w').