-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(whale-api): skip null txid used by evmtx (#2148)
<!-- Thanks for sending a pull request! --> #### What this PR does / why we need it: - [x] If an EVM tx is found (2 exact vin - both null), skip it - [x] Check how it will impact data representation in DeFiScan (can be done in another PR), vin will be empty as expected #### Which issue(s) does this PR fixes?: <!-- (Optional) Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> Fixes # #### Additional comments?: - Add tests on another PR, test all these change in Changi network concurrently
- Loading branch information
Pierre Gee
authored
Sep 19, 2023
1 parent
0cc8c84
commit db38bfa
Showing
5 changed files
with
35 additions
and
8 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { blockchain } from '@defichain/jellyfish-api-core' | ||
|
||
function checkIfEvmTx (txn: blockchain.Transaction): boolean { | ||
// To identify that the transaction is evmtx, it has to have exactly 2 null transaction ids | ||
return txn.vin.length === 2 && txn.vin.every(vin => vin.txid === '0000000000000000000000000000000000000000000000000000000000000000') | ||
} | ||
|
||
export { | ||
checkIfEvmTx | ||
} |
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