-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor to CMocka #62
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
Draft
eito-fis
wants to merge
21
commits into
main
Choose a base branch
from
fixtures
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d8041a0
ADD: Unlinked tx structure
eito-fis d0eff2a
ADD: Refactor ser_tx for cmocka
eito-fis 89391a0
FIX: Don't copy transaction padding bytes
eito-fis 074fd36
Merge branch 'main' into fixtures
eito-fis 80455f2
ADD: Tx teardown functions
eito-fis f4af3e9
ADD: Finish ser_wallet fixtures
eito-fis 4c7036e
ADD: Finish ser_key refactor
eito-fis 7313b3b
ADD: Cleanup and standardize cmocka tests so far
eito-fis 271cabf
ADD: Move blockheader ser size to define
eito-fis 2cee082
ADD: Finish ser_block refactor
eito-fis 0ca59d9
ADD: Finish test_crypto refactor
eito-fis d81393e
ADD: Finish test_list refactor
eito-fis 21bb360
ADD: Finish test_base_tx refactor
eito-fis 9f5fbcc
ADD: Finish test_utxo_pool refactor
eito-fis a1c9323
ADD: Finish test_wallet_pool refactor
eito-fis 3e826c0
ADD: Finish test_blockchain refactor
eito-fis 5422c6f
ADD: free block func
eito-fis 47f0e5c
ADD: free wallet entry func
eito-fis 2474cad
ADD: Cleanup already done global tests
eito-fis 997c5c5
ADD: Finish test_mempool refactor
eito-fis c8f57ca
ADD: Finish test_utxo_to_tx refactor
eito-fis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,20 @@ void hash_blockheader(unsigned char *dest, BlockHeader *header) { | |
| free(header_buf); | ||
| } | ||
|
|
||
| void free_block(Block *block) { | ||
| if (block == NULL) | ||
| return; | ||
|
|
||
| if (block->txs != NULL) { | ||
| for (unsigned int i = 0; i < block->num_txs; i++) | ||
| if (block->txs[i] != NULL) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check isn't actually needed, it is done in free_tx |
||
| free_tx(block->txs[i]); | ||
| free(block->txs); | ||
| } | ||
|
|
||
| free(block); | ||
| } | ||
|
|
||
| void print_block_header(BlockHeader *header, char *prefix){ | ||
| char *sub_prefix = malloc(strlen(prefix)+strlen(PRINT_TAB)+1); | ||
| strcpy(sub_prefix, prefix); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ add_subdirectory(blocks) | |
| add_subdirectory(global) | ||
| add_subdirectory(txs) | ||
| add_subdirectory(utils) | ||
| add_subdirectory(fixtures) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you handled the cmake stuff very cleanly here |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Change back before final PR