feat: transfer hoodi test tokens between in-network wallets#1398
Conversation
Time Submission Status
Submit or update total time with: Add time on top of previous submission with: See available commands to help comply with our Guidelines. |
📝 WalkthroughWalkthroughTwo new public SQL actions, ChangesHoodi TT/TT2 Transfer Actions
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/extensions/erc20/erc20_bridge_transfer_actions_test.go (1)
390-435: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd end-to-end coverage for
hoodi_tt2_transferas well.Line 390 introduces integration coverage only for
hoodi_tt_transfer, while this PR also addshoodi_tt2_transfer. A mirrored TT2 test path would catch bridge wiring or action-name regressions before release.Suggested follow-up (test shape)
+func TestHoodiTT2TransferActions(t *testing.T) { + seedAndRun(t, "hoodi_tt2_transfer_actions", func(ctx context.Context, platform *kwilTesting.Platform) error { + require.NoError(t, erc20shim.ForTestingInitializeExtension(ctx, platform)) + // Inject TT2 balance, perform hoodi_tt2_transfer, assert sender/recipient balances, + // and validate insufficient-funds + invalid-address errors (mirroring TT coverage). + return nil + }) +}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/extensions/erc20/erc20_bridge_transfer_actions_test.go` around lines 390 - 435, Add a complementary test function that mirrors TestHoodiTransferActions to provide end-to-end coverage for hoodi_tt2_transfer. Create a new test function (similar to TestHoodiTransferActions) that uses hoodi_tt2 chain, escrow, and ERC20 contract variables instead of their hoodi_tt counterparts, and calls the hoodi_tt2_transfer action instead of hoodi_tt_transfer, while maintaining the same test structure and assertions for transfer validation, fee handling, and error cases. This ensures bridge wiring and action-name regressions are caught for both transfer action variants before release.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/extensions/erc20/erc20_bridge_transfer_actions_test.go`:
- Around line 390-435: Add a complementary test function that mirrors
TestHoodiTransferActions to provide end-to-end coverage for hoodi_tt2_transfer.
Create a new test function (similar to TestHoodiTransferActions) that uses
hoodi_tt2 chain, escrow, and ERC20 contract variables instead of their hoodi_tt
counterparts, and calls the hoodi_tt2_transfer action instead of
hoodi_tt_transfer, while maintaining the same test structure and assertions for
transfer validation, fee handling, and error cases. This ensures bridge wiring
and action-name regressions are caught for both transfer action variants before
release.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d0373868-1e82-43cf-9499-9df3c2c47ae2
📒 Files selected for processing (2)
internal/migrations/erc20-bridge/002-public-transfer-actions.sqltests/extensions/erc20/erc20_bridge_transfer_actions_test.go
|
@holdex pr submit-time 3h |
resolves: https://github.com/truflation/website/issues/4070
What
Adds public
hoodi_tt_transferandhoodi_tt2_transferactions so a wallet can send the hoodi test-token bridges' tokens to another in-network wallet, matching the existingsepolia_transfer/eth_truf_transferwrappers. The hoodi bridges already expose balance/info/bridge actions; this adds the matching transfer action.Details
sepolia_transfer: recipient address + positive-amount validation, a per-bridge 1-token fee (18 decimals) paid to the block leader, andrecord_transaction_event.TestHoodiTransferActionsexercises a funded transfer (recipient balance + sender fee deduction), an insufficient-balance attempt, and an invalid recipient address. The existingsepolia_transfersuite continues to pass.Deploy note
The embedded
erc20-bridge/*.sqlmigrations are applied to a running node by the namespace owner viakwil-cli exec-sql --file internal/migrations/erc20-bridge/002-public-transfer-actions.sql --sync(idempotentCREATE OR REPLACE ACTION). They are not covered byscripts/migrate.sh, which globs only top-levelinternal/migrations/*.sql.Summary by CodeRabbit
New Features
Tests