Skip to content

Test WalletStore queries #1108

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Test WalletStore queries #1108

wants to merge 12 commits into from

Conversation

aaadir
Copy link
Contributor

@aaadir aaadir commented Jun 9, 2025

No description provided.

@aaadir aaadir requested a review from alexandrosfilios June 9, 2025 12:08
@aaadir aaadir self-assigned this Jun 9, 2025
@aaadir aaadir added the testing label Jun 9, 2025
@aaadir aaadir linked an issue Jun 9, 2025 that may be closed by this pull request

Expect(mockDB.ExpectationsWereMet()).To(Succeed())
Expect(err).ToNot(HaveOccurred())
Expect(actualWalletIDs[0]).To(Equal(output))
Copy link
Contributor

Choose a reason for hiding this comment

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

consistof

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


Expect(mockDB.ExpectationsWereMet()).To(Succeed())
Expect(err).ToNot(HaveOccurred())
Expect(exists).To(Equal(true))
Copy link
Contributor

Choose a reason for hiding this comment

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

to(betrue())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

func mockWalletStore(db *sql.DB) *common.WalletStore {
store, _ := common.NewWalletStore(db, db, common.TableNames{
Wallets: "WALLETS",
}, sqlite.NewConditionInterpreter())
Copy link
Contributor

Choose a reason for hiding this comment

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

postgres

Copy link
Contributor Author

@aaadir aaadir Jun 17, 2025

Choose a reason for hiding this comment

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

done.
actually changed this to
func mockWalletStore(db *sql.DB) *WalletStore {
which directs to postgres.WalletStore.

Also moved the tests to sqlite and postgres dirs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't understand the comment before. Now fixed.
done.

@aaadir aaadir force-pushed the test_wallet_store_queries branch from bb3fbdb to 87ff6f9 Compare June 17, 2025 10:37
"github.com/onsi/gomega"
)

type storeConstructor func(*sql.DB) *WalletStore
Copy link
Contributor

Choose a reason for hiding this comment

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

that's going to create conflicts when you push your other PR's. you will have clashing type names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WalletStore query testing
2 participants