Skip to content

Conversation

skywardboundd
Copy link
Contributor

Closes #3154

@skywardboundd skywardboundd linked an issue May 19, 2025 that may be closed by this pull request
@skywardboundd skywardboundd requested a review from Copilot May 19, 2025 21:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds new benchmark tests for NFT functionality by updating benchmark test scripts and configurations. Key changes include:

  • Modifying the benchmark file search pattern in update.build.ts to exclude files ending with ".test.spec.ts".
  • Updating benchmark scripts in package.json to use new Jest configurations.
  • Adding new Jest configuration files (jest-test.config.js and jest-bench.config.js) for organizing tests.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
src/benchmarks/update.build.ts Updated glob pattern to exclude certain test files.
package.json Modified benchmark scripts to reference new Jest configs.
jest-test.config.js New Jest configuration targeting *.test.spec.ts files.
jest-bench.config.js New Jest configuration for benchmark tests excluding test specs.
Comments suppressed due to low confidence (1)

package.json:49

  • The updated 'bench:ci' script now runs both 'bench' and 'bench:test' sequentially. Please confirm that this combined execution approach is intentional and that the overall execution time is acceptable in CI environments.
"bench:ci": "yarn gen:contracts:benchmarks && yarn bench && yarn bench:test"

@skywardboundd skywardboundd marked this pull request as ready for review May 28, 2025 15:37
@skywardboundd skywardboundd requested a review from a team as a code owner May 28, 2025 15:37
@skywardboundd skywardboundd requested a review from Copilot May 28, 2025 19:56
Copilot

This comment was marked as outdated.

@skywardboundd skywardboundd requested a review from xpyctumo June 4, 2025 12:29
Copy link
Contributor

@Kaladin13 Kaladin13 left a comment

Choose a reason for hiding this comment

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

Very hard pr to review since I am not really nft expert, good work nevertheless, please check my comments, most of them could be applied to a lot of places at the same time (wrappers const, wrappers build, \n and so on)

@skywardboundd
Copy link
Contributor Author

skywardboundd commented Jun 23, 2025

transfer-fee.ts is a port from original repo

Copy link
Contributor

@pyAndr3w pyAndr3w left a comment

Choose a reason for hiding this comment

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

Looks pretty good.

Future idea: Consider integrating benchmarks with tests so that performance measurements are taken during test execution.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a comprehensive NFT test suite and benchmark support for both FunC and Tact implementations, while updating the smart contract source code to leverage new function calls.

  • Added extensive tests for NFT collection/item behavior, transfer fees, batch minting, and deployment status.
  • Updated Tact contract code to replace forceBasechain with forceBasechainFunc.
  • Integrated benchmark and code size reporting via the run.ts module.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/benchmarks/nft/tests/utils.ts Added test constants and error code mappings; note potential redundant conversion.
src/benchmarks/nft/tests/transfer-fee.ts Added detailed tests for transfer fee scenarios with minor typo in test description.
src/benchmarks/nft/tests/item.ts Expanded tests for NFT item behavior and static data retrieval.
src/benchmarks/nft/tests/collection.ts Added tests for NFT collection minting, deployment, royalty, and state queries.
src/benchmarks/nft/test.spec.ts Integrated NFT tests into the main test suite.
src/benchmarks/nft/tact/item.tact Updated Tact contract implementation with a new function call.
src/benchmarks/nft/run.ts Added benchmark and code size utilities for NFT contracts.
spell/cspell-list.txt Updated cspell exclusions.
Comments suppressed due to low confidence (1)

src/benchmarks/nft/tact/item.tact:108

  • The magic number '333' in the forceBasechainFunc implementation lacks context; adding an inline comment to explain its purpose would improve maintainability.
asm fun forceBasechainFunc(address: Address) { REWRITESTDADDR DROP 333 THROWIF }

Copy link
Contributor

@Kaladin13 Kaladin13 left a comment

Choose a reason for hiding this comment

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

If we commit on this test structure, it's good

Copy link
Contributor

@pyAndr3w pyAndr3w left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Add tests for all benchmarks projects: nft
3 participants