Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network service cleanup #560

Merged
merged 1 commit into from
Mar 1, 2024
Merged

network service cleanup #560

merged 1 commit into from
Mar 1, 2024

Conversation

adecaro
Copy link
Contributor

@adecaro adecaro commented Mar 1, 2024

This PR proposes the following:

  • remove transient-related function from the network service, they are not needed anymore
  • cleanup sql db logs

@adecaro adecaro self-assigned this Mar 1, 2024
- cleanup sql db logs

Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
@@ -20,28 +20,30 @@ import (

var logger = flogging.MustGetLogger("token-sdk.sql")

func initSchema(db *sql.DB, schemas ...string) error {
func initSchema(db *sql.DB, schemas ...string) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you always return the error, you don't have to declare the result var in the signature.

@@ -243,33 +243,35 @@ func (db *TransactionDB) AddTransaction(r *driver.TransactionRecord) error {
return err
}

func (db *TransactionDB) SetStatus(txID string, status driver.TxStatus) error {
func (db *TransactionDB) SetStatus(txID string, status driver.TxStatus) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for err.

@@ -354,7 +356,7 @@ func (db *TransactionDB) QueryValidations(params driver.QueryValidationRecordsPa
return &ValidationRecordsIterator{txs: rows, filter: params.Filter}, nil
}

func (db *TransactionDB) AddTransactionEndorsementAck(txID string, endorser view.Identity, sigma []byte) error {
func (db *TransactionDB) AddTransactionEndorsementAck(txID string, endorser view.Identity, sigma []byte) (err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

if !tm.Exists(TokenRequestMetadata) {
func (a *TransactionInfoProvider) loadTransient(trRaw []byte, txID string) (map[string][]byte, error) {
if len(trRaw) == 0 {
if logger.IsEnabledFor(zapcore.DebugLevel) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to make the check isEnabledFor unless you have any calculations to do.

Copy link
Contributor

@alexandrosfilios alexandrosfilios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo comments

@adecaro adecaro merged commit bc34121 into main Mar 1, 2024
37 checks passed
@adecaro adecaro deleted the f-transient branch March 1, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants