Skip to content

Commit

Permalink
Merge pull request #352 from Once-Upon/feature/ou-2315-deployed-contr…
Browse files Browse the repository at this point in the history
…act-is-not-in-participants

feat: add deployed contract address in parties
  • Loading branch information
pcowgill committed Apr 29, 2024
2 parents 8288aee + 57cd56d commit 22cd3c3
Show file tree
Hide file tree
Showing 3 changed files with 1,887 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/transformers/_common/parties.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,21 @@ describe('transactionParties', () => {
const result2 = transform(block2);

expect(result2).toBeDefined();

const block3 = loadBlockFixture('base_sepolia', '9312985_decoded');
const result3 = transform(block3);

const txResult5 = result3.transactions.find(
(tx) =>
tx.hash ===
'0x4eac93e327071ba5313ef7c0d8f243ff0653d63ed3403954db41c2b14c2b50b3',
);
expect(txResult5).toBeDefined();
if (txResult5) {
expect(txResult5.parties).toStrictEqual([
'0x0e204e46a52f1c701e54efd525062a4da96f2b59',
'0xe4347cb90e809a9d8526458eaa6e4a1bfff4cc2f',
]);
}
});
});
3 changes: 3 additions & 0 deletions src/transformers/_common/parties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export const transform: TxnTransformer = (_block, tx) => {
if (trace.action?.to) {
result = [...result, trace.action.to.toLowerCase()];
}
if (trace.result?.address) {
result = [...result, trace.result.address.toLowerCase()];
}
if (trace.type === 'suicide') {
result = [...result, trace.action.address.toLowerCase()];
if (trace.action.refundAddress) {
Expand Down
Loading

0 comments on commit 22cd3c3

Please sign in to comment.