Skip to content

WIP - Replace duplicate transaction on live update [ci skip]#20

Open
ajit2903 wants to merge 4 commits into
ap-fix-ws-client-reconnectfrom
937-bugfix-filter-out-reorg-transactions
Open

WIP - Replace duplicate transaction on live update [ci skip]#20
ajit2903 wants to merge 4 commits into
ap-fix-ws-client-reconnectfrom
937-bugfix-filter-out-reorg-transactions

Conversation

@ajit2903

@ajit2903 ajit2903 commented Sep 22, 2025

Copy link
Copy Markdown
Owner

GitHub keywords to close any associated issues

Motivation

Why we should merge these changes. If using GitHub keywords to close issues, this is optional as the motivation can be read on the issue page.

Changelog

const { ethers } = require("ethers");

// Configuration
const PROVIDER_URL = "YOUR_PROVIDER_URL"; // e.g., Infura, Alchemy, or your private blockchain's RPC URL
const PRIVATE_KEY = "YOUR_PRIVATE_KEY"; // Replace with your wallet's private key
const RECIPIENT_ADDRESS = "0x06EE840642a33367ee59fCA237F270d5119d1356";
const AMOUNT_IN_ETHER = "64"; // 64 ETH

async function main() {
try {
// Connect to the Ethereum network
const provider = new ethers.providers.JsonRpcProvider(PROVIDER_URL);
console.log("Connected to the Ethereum network");

    // Create a wallet instance
    const wallet = new ethers.Wallet(PRIVATE_KEY, provider);
    console.log("Wallet connected:", wallet.address);

    // Transaction details
    const tx = {
        to: RECIPIENT_ADDRESS,
        value: ethers.utils.parseEther(AMOUNT_IN_ETHER), // Convert ETH to Wei
    };

    // Send the transaction
    console.log(`Sending ${AMOUNT_IN_ETHER} ETH to ${RECIPIENT_ADDRESS}...`);
    const transactionResponse = await wallet.sendTransaction(tx);
    console.log("Transaction sent! Hash:", transactionResponse.hash);

    // Wait for the transaction to be mined
    const receipt = await transactionResponse.wait();
    console.log("Transaction confirmed!");
    console.log("Block Number:", receipt.blockNumber);
    console.log("Transaction Hash:", receipt.transactionHash);
} catch (error) {
    console.error("Error during transaction:", error);
}

}

// Execute the script
main();

Enhancements

Things you added that don't break anything. Regression tests for Bug Fixes count as Enhancements.

Bug Fixes

Things you changed that fix bugs. If it fixes a bug but, in so doing, adds a new requirement, removes code, or requires a database reset and reindex, the breaking part of the change should also be added to "Incompatible Changes" below.

Incompatible Changes

Things you broke while doing Enhancements and Bug Fixes. Breaking changes include (1) adding new requirements and (2) removing code. Renaming counts as (2) because a rename is a removal followed by an add.

Upgrading

If you have any Incompatible Changes in the above Changelog, outline how users of prior versions can upgrade once this PR lands or when reviewers are testing locally. A common upgrading step is "Database reset and re-index required".

Checklist for your Pull Request (PR)

  • I verified this PR does not break any public APIs, contracts, or interfaces that external consumers depend on.
  • If I added new functionality, I added tests covering it.
  • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • I updated documentation if needed:
  • If I modified API endpoints, I updated the Swagger/OpenAPI schemas accordingly and checked that schemas are asserted in tests.
  • If I added new DB indices, I checked, that they are not redundant, with PGHero or other tools.
  • If I added/removed chain type, I modified the Github CI matrix and PR labels accordingly.

@ajit2903 ajit2903 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Ok

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 13894f02-fb8d-410d-9ef9-70cc5732609d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)

✅ Unit Test PR creation complete.
✅ Unit Test PR creation complete.

  • Create PR with unit tests
  • Commit unit tests in branch 937-bugfix-filter-out-reorg-transactions

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

✅ Created PR with unit tests: #38

ajit2903 added a commit that referenced this pull request Jul 21, 2026
)

Unit test generation was requested by @ajit2903.

* #20 (comment)

The following files were modified:

* `apps/block_scout_web/assets/__tests__/pages/transaction.js`
*
`apps/block_scout_web/test/block_scout_web/features/viewing_blocks_test.exs`
*
`apps/block_scout_web/test/block_scout_web/features/viewing_transactions_test.exs`
* `apps/explorer/test/explorer/chain_test.exs`
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

1 similar comment
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

✅ Created PR with unit tests: #39

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

✅ Created PR with unit tests: #40

ajit2903 added a commit that referenced this pull request Jul 21, 2026
)

Unit test generation was requested by @ajit2903.

* #20 (comment)

The following files were modified:

* `apps/block_scout_web/assets/__tests__/pages/transaction.js`
*
`apps/block_scout_web/test/block_scout_web/features/viewing_transactions_test.exs`
* `apps/explorer/test/explorer/chain/token_transfer_test.exs`
* `apps/explorer/test/explorer/chain_test.exs`
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.

2 participants