fuels-ts icon indicating copy to clipboard operation
fuels-ts copied to clipboard

feat(account): Add TestCoin helper class for testing purposes

Open crStiv opened this issue 11 months ago • 8 comments

Overview

This PR introduces the TestCoin helper class to simplify coin creation during testing. The class provides utility methods for generating test coins with random or specified parameters, making it easier to write and maintain tests that require coin instances.

Features

  • TestCoin.create(): Creates a single test coin with customizable parameters
  • TestCoin.many(): Generates multiple test coins with shared base parameters
  • Uses crypto-secure random generation via @fuel-ts/crypto
  • Properly handles big numbers using @fuel-ts/math

Related Issues

Closes #3445

Related PR's

Fixed #3460

crStiv avatar Jan 30 '25 16:01 crStiv

@crStiv is attempting to deploy a commit to the Fuel Labs Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jan 30 '25 16:01 vercel[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ts-docs-api ❌ Failed (Inspect) Feb 26, 2025 0:31am

vercel[bot] avatar Jan 30 '25 16:01 vercel[bot]

@petertonysmith94 Added tests for TestCoin class as requested. The tests cover default values, custom parameters, multiple coin creation and parameter inheritance

crStiv avatar Feb 01 '25 11:02 crStiv

@danielbate I've included a test case you wanted me to do inside fuel gauge, does it seem alright?

crStiv avatar Feb 04 '25 21:02 crStiv

Hey @crStiv, how are you? I noticed it's been a while since your last interaction on this, and I just wanted to check if you're still interested in working on it.

Torres-ssf avatar Feb 17 '25 13:02 Torres-ssf

Hey @crStiv, how are you? I noticed it's been a while since your last interaction on this, and I just wanted to check if you're still interested in working on it.

Hey Sergio! Yeah, I remember about it, but have a lot of work today, still thanks for reminding me about this PR, I'll try to provide changes to it to the end of the week

crStiv avatar Feb 17 '25 14:02 crStiv

Hey @crStiv, how are you? I noticed it's been a while since your last interaction on this, and I just wanted to check if you're still interested in working on it.

Sorry if it takes much longer time than you expected

crStiv avatar Feb 17 '25 14:02 crStiv

@crStiv No worries. Take your time. I was just checking if you were still interested in working on this.

Let us know if you have any questions, we are happy to help.

Torres-ssf avatar Feb 18 '25 10:02 Torres-ssf

Closing this issue due to inactivity.

Torres-ssf avatar Apr 16 '25 14:04 Torres-ssf