Skip to content

IPAsset - Batch Integration Tests #509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bpolania
Copy link
Collaborator

Description

This PR adds integration tests for batch register IP functionality

const expect = chai.expect;

const pool = evenSplitGroupPoolAddress[aeneid];
const walletAddress = process.env.TEST_WALLET_ADDRESS! as Address;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor thing. In the integration/util/util file, there is a variable called TEST_WALLET_ADDRESS. You can directly import it.

isPublicMinting: true,
mintOpen: true,
contractURI: "test-uri",
mintFeeRecipient: walletAddress,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we add a mintFee property? I think we need to consider the complex situation regarding the fee. There are many logical tests we can test if we add the mint fee.

walletClient,
erc20Address[aeneid]
);
await mockERC20.mint(walletAddress, 100000n);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's the same. We need to consider the WIP token instead of ERC20, which is the common case.

const batchRequest = {
requests: requests.map(req => ({
...req,
})),
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't need to map it. You can write it as follows:

 const batchRequest = {
        requests,
      };

const batchResult = await client.ipAsset.batchRegisterIpAssetsWithOptimizedWorkflows(batchRequest);
expect(batchResult.registrationResults).to.be.an("array");
expect(batchResult.registrationResults.length).to.be.lessThan(requests.length);

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to provide an exact number instead of a rough estimate. It will provide exact feedback.

}));

const totalPercentage = maxRecipientsDistribution.reduce((sum, item) => sum + item.percentage, 0);
expect(totalPercentage).to.equal(100);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's your own logic, we don't need to assert.

}
});
});
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

How to verify royalty token ownership? I don't see the related assertion.


describe("Batch IP Registration with Royalty Distribution", () => {
let client: StoryClient;
let nftContract: Hex;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you rename the spgNftContract? Because in the IPAsset module, there are two kinds of NFT contracts, namely SPG NFT contract and NFT contract.

@bpolania bpolania changed the title Bp/batched register ip integration IPAsset - Batch Integration Tests Apr 29, 2025
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.

2 participants