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

Revise generic wallet tests #225

Merged

Conversation

matthiasgeihs
Copy link
Contributor

@matthiasgeihs matthiasgeihs commented Sep 23, 2021

Closes #224

@matthiasgeihs
Copy link
Contributor Author

After some discussion, we decided that revising the generic tests needs more work. We decided to resume work on it at a later point in time.

Because the file is already in directory test, it does not need to include "test" in its name.

Signed-off-by: Matthias Geihs <[email protected]>
…zer test

There are several problems with `func TestSetBackend` and `func SetRandomizerTest`:
- They look like a test function but they are contained within a non-test package.
- They do not give any valuable information: We use them in the sim backend tests. However, the backend tests would fail anyways if not initialized correctly.

Signed-off-by: Matthias Geihs <[email protected]>
@matthiasgeihs matthiasgeihs marked this pull request as ready for review October 5, 2021 10:10
@matthiasgeihs matthiasgeihs force-pushed the 224-revise-generic-wallet-tests branch from 28754c9 to 0dbb06a Compare October 5, 2021 10:10
@matthiasgeihs
Copy link
Contributor Author

Update: Some changes from this PR (in particular the introduction of ZeroAddress on wallet test Setup) are needed for the upcoming backend implementations.

Copy link
Contributor

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

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

LGTM

wallet/test/wallet.go Show resolved Hide resolved
wallet/test/wallet.go Outdated Show resolved Hide resolved
We can use one test file per interface.

Signed-off-by: Matthias Geihs <[email protected]>
- Wallet should be provided with setup
- UnlockedAccount was not provided an unlocked account, but calling Wallet.Unlock, which made it cumbersome to use.
- Provide account address of wallet account instead of unlocked account

Signed-off-by: Matthias Geihs <[email protected]>
…tAccountWithWalletAndBackend

Naming schema: Include in name which interface types are tested.

Signed-off-by: Matthias Geihs <[email protected]>
…ddress

Naming schema: Include in name which interface type is tested.

Signed-off-by: Matthias Geihs <[email protected]>
@matthiasgeihs matthiasgeihs force-pushed the 224-revise-generic-wallet-tests branch from 0dbb06a to 767a1e3 Compare October 5, 2021 14:13
Before, the wallet address test was generating a zero address assuming a specific address encoding.
The assumption was that address encodings always have the same length and that decoding a zero bytes array of that length gives the zero address.
However, while this was true for the existing backends, it may not be true for all future backends.
Hence, we now provide the zero address specifically with the test setup.

Signed-off-by: Matthias Geihs <[email protected]>
@matthiasgeihs matthiasgeihs force-pushed the 224-revise-generic-wallet-tests branch from 767a1e3 to 2d44fd3 Compare October 5, 2021 14:29
@matthiasgeihs
Copy link
Contributor Author

Github Actions seems to be not working correctly. The CI was not triggered after force push. Even a second force push (without changes) did not help.

@matthiasgeihs
Copy link
Contributor Author

Close and reopen also did not trigger the CI.

@matthiasgeihs matthiasgeihs marked this pull request as draft October 5, 2021 14:39
@matthiasgeihs matthiasgeihs marked this pull request as ready for review October 5, 2021 14:39
@matthiasgeihs
Copy link
Contributor Author

The GitHub Actions service is currently degraded: https://www.githubstatus.com

I'll wait for the service to be up and running and will check back later.

@matthiasgeihs matthiasgeihs marked this pull request as draft October 5, 2021 15:34
@matthiasgeihs matthiasgeihs marked this pull request as ready for review October 5, 2021 15:35
@matthiasgeihs matthiasgeihs reopened this Oct 5, 2021
@matthiasgeihs matthiasgeihs requested a review from ggwpez October 5, 2021 16:41
Copy link
Contributor

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

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

CI finally worked 😆

@ggwpez ggwpez merged commit efbdee2 into hyperledger-labs:dev Oct 5, 2021
@ggwpez ggwpez deleted the 224-revise-generic-wallet-tests branch October 5, 2021 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restructure and extend generic wallet tests
2 participants