Skip to content

test: add multi-transaction ERC20 integration test#1590

Open
giwaov wants to merge 1 commit intogenlayerlabs:mainfrom
giwaov:test/441-multi-tx-erc20-integration
Open

test: add multi-transaction ERC20 integration test#1590
giwaov wants to merge 1 commit intogenlayerlabs:mainfrom
giwaov:test/441-multi-tx-erc20-integration

Conversation

@giwaov
Copy link
Copy Markdown

@giwaov giwaov commented Apr 7, 2026

Summary

Adds a new integration test that deploys a single \LlmErc20\ contract and runs multiple sequential transactions against it, verifying balances and total supply preservation after each transfer.

Changes

  • New test file: \ ests/integration/icontracts/tests/test_multi_tx_erc20.py\

Test Scenario

  1. Deploy ERC20 with 1000 token supply to Account A
  2. Tx 1: A transfers 100 to B - verify balances
  3. Tx 2: A transfers 200 to C - verify balances
  4. Tx 3: B transfers 50 to C (using \connect()\ to switch sender) - verify balances
  5. Final assertion: total supply (1000) is preserved across all accounts

This catches potential race conditions or state corruption when multiple writes hit the same contract sequentially, as described in issue #441.

Labels

This issue is tagged \good first issue.

Related Issue

Closes #441

Adds a new integration test that deploys a single LlmErc20 contract and
runs multiple sequential transactions against it with three accounts:
  - A -> B transfer
  - A -> C transfer
  - B -> C transfer (using connect() to switch sender)

After each transaction, balances are verified. A final assertion checks
that total supply is preserved across all transfers.

This tests the scenario described in genlayerlabs#441: running multiple transactions
against the same contract to expose potential race conditions or state
corruption between consecutive writes.

Closes genlayerlabs#441
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

Warning

Rate limit exceeded

@giwaov has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 28 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 11 minutes and 28 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ebd3d9b2-16cc-497d-81a3-ab8f3ff0ee11

📥 Commits

Reviewing files that changed from the base of the PR and between cd554a6 and eabb1b8.

📒 Files selected for processing (1)
  • tests/integration/icontracts/tests/test_multi_tx_erc20.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

SIM-TEST-Improve integration tests by running multiple transactions agains the same contract

1 participant