Skip to content

Commit e633fd3

Browse files
committed
fix: update maxMintingFee, maxRts, and maxRevenueShare to default to 0 in IP asset requests and enhance related tests for clarity
1 parent e16aacb commit e633fd3

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

packages/core-sdk/src/types/resources/group.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export type RegisterGroupAndAttachLicenseAndAddIpsRequest = {
125125
/**
126126
* The maximum reward share percentage that can be allocated to each member IP.
127127
* Must be between 0 and 100 (where 100% represents 100_000_000).
128-
*
128+
*
129129
* @default 100
130130
*/
131131
maxAllowedRewardShare?: RevShareInput;

packages/core-sdk/src/types/resources/ipAsset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export type BatchMintAndRegisterIpAssetWithPilTermsResponse = {
265265

266266
export type BatchRegisterDerivativeRequest = {
267267
args: RegisterDerivativeRequest[];
268-
/**
268+
/**
269269
* The deadline for the signature in seconds.
270270
* @default 1000
271271
*/

packages/core-sdk/test/unit/resources/ipAsset.test.ts

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3129,7 +3129,7 @@ describe("Test IpAssetClient", () => {
31293129
"0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c",
31303130
);
31313131

3132-
stub(
3132+
const registerIpAndMakeDerivativeAndDeployRoyaltyVaultStub = stub(
31333133
ipAssetClient.royaltyTokenDistributionWorkflowsClient,
31343134
"registerIpAndMakeDerivativeAndDeployRoyaltyVault",
31353135
).resolves(txHash);
@@ -3170,9 +3170,6 @@ describe("Test IpAssetClient", () => {
31703170
derivData: {
31713171
parentIpIds: ["0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"],
31723172
licenseTermsIds: [1n],
3173-
maxMintingFee: 100,
3174-
maxRts: 100,
3175-
maxRevenueShare: 100,
31763173
},
31773174
royaltyShares: [
31783175
{ recipient: "0x73fcb515cee99e4991465ef586cfe2b072ebb512", percentage: 100 },
@@ -3187,6 +3184,15 @@ describe("Test IpAssetClient", () => {
31873184
ipRoyaltyVault: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c",
31883185
tokenId: 0n,
31893186
});
3187+
expect(
3188+
registerIpAndMakeDerivativeAndDeployRoyaltyVaultStub.args[0][0].derivData.maxMintingFee,
3189+
).to.equal(0n);
3190+
expect(
3191+
registerIpAndMakeDerivativeAndDeployRoyaltyVaultStub.args[0][0].derivData.maxRts,
3192+
).to.equal(100 * 10 ** 6);
3193+
expect(
3194+
registerIpAndMakeDerivativeAndDeployRoyaltyVaultStub.args[0][0].derivData.maxRevenueShare,
3195+
).to.equal(100 * 10 ** 6);
31903196
});
31913197

31923198
it("should return txHash when registerDerivativeAndAttachLicenseTermsAndDistributeRoyaltyTokens given correct args with waitForTransaction of true", async () => {
@@ -3241,9 +3247,9 @@ describe("Test IpAssetClient", () => {
32413247
derivData: {
32423248
parentIpIds: ["0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c"],
32433249
licenseTermsIds: [1n],
3244-
maxMintingFee: 100,
3245-
maxRts: 100,
3246-
maxRevenueShare: 100,
3250+
maxMintingFee: 0,
3251+
maxRts: 0,
3252+
maxRevenueShare: 0,
32473253
},
32483254
royaltyShares: [
32493255
{ recipient: "0x73fcb515cee99e4991465ef586cfe2b072ebb512", percentage: 100 },
@@ -3264,8 +3270,15 @@ describe("Test IpAssetClient", () => {
32643270
ipRoyaltyVault: "0x1daAE3197Bc469Cb97B917aa460a12dD95c6627c",
32653271
tokenId: 0n,
32663272
});
3267-
console.log(registerIpAndMakeDerivativeAndDeployRoyaltyVaultStub.args[0][0]);
3268-
// expect(registerIpAndMakeDerivativeAndDeployRoyaltyVaultStub.args[0][0].maxMintingFee).to.equal(0n);
3273+
expect(
3274+
registerIpAndMakeDerivativeAndDeployRoyaltyVaultStub.args[0][0].derivData.maxMintingFee,
3275+
).to.equal(0n);
3276+
expect(
3277+
registerIpAndMakeDerivativeAndDeployRoyaltyVaultStub.args[0][0].derivData.maxRts,
3278+
).to.equal(0);
3279+
expect(
3280+
registerIpAndMakeDerivativeAndDeployRoyaltyVaultStub.args[0][0].derivData.maxRevenueShare,
3281+
).to.equal(0);
32693282
});
32703283
});
32713284

0 commit comments

Comments
 (0)