-
Notifications
You must be signed in to change notification settings - Fork 0
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
Partial restructuring of repo #80
Open
harisang
wants to merge
15
commits into
main
Choose a base branch
from
restructure_code
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.
Open
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2cac0df
partial restructuring
harisang c49bbf4
add renamed filed
harisang 855579f
black fix
harisang cc5aff1
fix auxiliary script
harisang 563f83a
fix discrepancies in various tests
harisang 2971079
fix more discrepancies
harisang e578a2b
renaming, moving around and slightly editing test
harisang c77e790
fix issue with native eth imbalances
harisang 9110d3d
remove empty line
harisang d255c4d
black fix
harisang 08cfefd
fix test
harisang 2d36ef9
Add more env variables
harisang 6d41ab6
fix string to boolean issue
harisang 41c80c1
restructure TransactionProcessor class
harisang 64d8b67
simplify logging
harisang 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from os import getenv | ||
|
||
from web3 import Web3 | ||
|
||
from src.raw_imbalances import RawTokenImbalances | ||
|
||
|
||
def tests_process_single_transaction(): | ||
web3 = Web3(Web3.HTTPProvider(getenv("NODE_URL"))) | ||
raw_imbalances = RawTokenImbalances(web3, "mainnet") | ||
imbalances = raw_imbalances.compute_token_imbalances( | ||
"0xb75e03b63d4f06c56549effd503e1e37f3ccfc3c00e6985a5aacc9b0534d7c5c" | ||
) | ||
|
||
assert imbalances == { | ||
"0x72e4f9F808C49A2a61dE9C5896298920Dc4EEEa9": 3116463005, | ||
"0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9": 31552225710415395, | ||
"0x812Ba41e071C7b7fA4EBcFB62dF5F45f6fA853Ee": 0, | ||
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": 0, | ||
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": 0, | ||
"0xEE2a03Aa6Dacf51C18679C516ad5283d8E7C2637": 275548164523, | ||
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE": 0, | ||
} | ||
|
||
def test_get_transaction_tokens(): | ||
web3 = Web3(Web3.HTTPProvider(getenv("NODE_URL"))) | ||
imbalances = RawTokenImbalances(web3, "mainnet") | ||
tx_hash = "0xb75e03b63d4f06c56549effd503e1e37f3ccfc3c00e6985a5aacc9b0534d7c5c" | ||
|
||
transaction_tokens = imbalances.get_transaction_tokens(tx_hash) | ||
|
||
assert all(h == tx_hash for h, _ in transaction_tokens) | ||
assert set(token_address for _, token_address in transaction_tokens) == { | ||
"0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9", | ||
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", | ||
"0x812Ba41e071C7b7fA4EBcFB62dF5F45f6fA853Ee", | ||
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", | ||
"0xEE2a03Aa6Dacf51C18679C516ad5283d8E7C2637", | ||
"0x72e4f9F808C49A2a61dE9C5896298920Dc4EEEa9", | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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.
Note that USDT is removed from the list (it used to be there), as it never touches the settlement contract, so there is definitely no need to include it here.
Maybe we can rename the function itself if you think it is now misleading, but basically it now computes the tokens that are transferred in or out of the settlement contract
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.
The new behavior should be fine.