Skip to content

closes #51: re-implement batch minting feature#125

Open
mansur-codes wants to merge 3 commits into
BCPathway:mainfrom
mansur-codes:main
Open

closes #51: re-implement batch minting feature#125
mansur-codes wants to merge 3 commits into
BCPathway:mainfrom
mansur-codes:main

Conversation

@mansur-codes
Copy link
Copy Markdown

Summary

This PR successfully re-implements and restores the batch_mint functionality and its accompanying comprehensive test suite in the token contract, which was previously lost during concurrent upstream branch merges.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🔧 Smart contract improvement
  • 🧪 Test coverage improvement
  • 🏗️ CI/Build improvement

Related Issue

Closes #51

Changes Made

  • Imports: Restored Recipient and TokenError imports from the parent crate module back into contracts/token/src/test.rs.
  • Core Functionality: Ensured the batch minting mechanics cleanly accept multiple recipients, update individual balances, and accurately aggregate and update the global token total_supply.
  • Test Suite Appended: Added 4 comprehensive unit tests:
    • test_batch_mint_single_recipient: Verifies simple batch minting state updates for one user.
    • test_batch_mint_multiple_recipients: Validates correct execution, tracking, and overall supply updates across three distinct addresses.
    • test_batch_mint_rejects_invalid_amount: Uses try_batch_mint to assert that zero/negative amounts yield a TokenError::InvalidAmount error and trigger an atomic revert.
    • test_batch_mint_while_paused_fails: Verifies that attempting execution while the contract is paused correctly returns TokenError::ContractPaused without changing state.

Testing

How has this been tested?

  • Rust unit tests pass (cargo test)
  • SDK compiles (npm run build in sdk/)
  • Manual testing against Soroban testnet
  • New tests added for changes

Test commands run:

# Contract tests
cargo test

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@mansur-codes Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mansur-codes
Copy link
Copy Markdown
Author

Hi there, please review this issue and release points, thank you.

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.

[Contract] Re-implement Batch Minting Feature

1 participant