Skip to content

Conversation

@desfero
Copy link
Contributor

@desfero desfero commented Aug 29, 2025

No description provided.

@desfero desfero self-assigned this Aug 29, 2025
@linear
Copy link

linear bot commented Aug 29, 2025

…the-sdk

# Conflicts:
#	packages/graphql/src/graphql-env.d.ts
#	packages/spec/vaults/vault.helpers.ts
#	packages/spec/vaults/vaults.spec.ts
Comment on lines 98 to 111
const result = await vaults(client, {
criteria: {
ownedBy: [evmAddress(organization.account!.address)],
},
});

assertOk(result);

expect(result.value.items).toEqual([
expect.objectContaining({
owner: organization.account!.address,
address: initialVault.value!.address,
}),
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

This part of the test is not needed, we have already tests fetching vault by ownedBy so I would remove this part

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a difference on how vault behaves when it has single vs multiple recipients thats why have added the tests and clearly separate them

Given the Aave Vaults
When an organization deploys a new vault
And is single recipient of the vault's fees
Then it should be available in the organization vaults

vs

Given the Aave Vaults
When an organization deploys a new vault
And has multiple recipient of the vault's fees
Then it should be available in the organization vaults

but happy to consider other options, main point is that we need to test this as it has 2 different code paths

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the actual assertion here? Simply it does not fail? Can we make this more business oriented and see the revenue flowing to the addresses?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you are already checking the owner in line 87 (creating vault and fetching vault by txHash and later assertion in the owner, that should be enough) so no need to fetch byOwner again.

Also it would be good to check when withdrawing fees that new accounts received the tokens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cesarenaldi the assertion here is that a vault deployed with multi recipients is in the org vaults
@juangm that's already there, it's a separate test (line 588)

Copy link
Contributor

Choose a reason for hiding this comment

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

what the owner has to do with the multi-recipient aspect of this feature?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree we should minimize duplication, but if the assertion indeed should be changed to something else (like I am suspecting) then effectively 1 of these 2 tests is not longer redundant with the existing one @juangm is referring to.

Comment on lines 183 to 195
const result = await vaults(client, {
criteria: {
ownedBy: [evmAddress(organization.account!.address)],
},
});

assertOk(result);
expect(result.value.items).toEqual([
expect.objectContaining({
owner: organization.account!.address,
address: initialVault.value!.address,
}),
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed to add this check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same

Comment on lines 461 to 468
.andThen(client.waitForTransaction);
assertOk(updateResult);

const newVaultInfo = await vault(client, {
by: { address: initialVault.value.address },
chainId: initialVault.value.chainId,
});
assertOk(newVaultInfo);
Copy link
Contributor

Choose a reason for hiding this comment

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

We could still use the .andThen(...

Suggested change
.andThen(client.waitForTransaction);
assertOk(updateResult);
const newVaultInfo = await vault(client, {
by: { address: initialVault.value.address },
chainId: initialVault.value.chainId,
});
assertOk(newVaultInfo);
.andThen(client.waitForTransaction)
.andThen(() => vault(client, {
by: { address: initialVault.value.address },
chainId: initialVault.value.chainId,
});
assertOk(updateResult);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i feel like andThen should be used to join all related operation into a single final result, this feels like 2 different operations, especially given we use the newVaultInfo inside an assertion

Copy link
Contributor

Choose a reason for hiding this comment

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

In other examples we do like operation + fetch updated data. In this case, it would be like: update fees in vault + fetch vault with updated fee

Comment on lines 510 to 517
.andThen(client.waitForTransaction);
assertOk(updateResult);

const newVaultInfo = await vault(client, {
by: { address: initialVault.value.address },
chainId: initialVault.value.chainId,
});
assertOk(newVaultInfo);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.andThen(client.waitForTransaction);
assertOk(updateResult);
const newVaultInfo = await vault(client, {
by: { address: initialVault.value.address },
chainId: initialVault.value.chainId,
});
assertOk(newVaultInfo);
.andThen(client.waitForTransaction)
.andThen(() => vault(client, {
by: { address: initialVault.value.address },
chainId: initialVault.value.chainId,
});
assertOk(updateResult);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i feel like andThen should be used to join all related operation into a single final result, this feels like 2 different operations, especially given we use the newVaultInfo inside an assertion

vaultApr: PercentValue!

"""The recipients of the vault revenue"""
feeRecipients: [RecipientPercent!]!
Copy link
Contributor

Choose a reason for hiding this comment

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

Is 'fee' here used with the same meaning as 'fee' when used in feesBalance for example?

* @param request - The vault set revenue splitter request parameters.
* @returns The transaction data for setting a revenue splitter.
*/
export function vaultSetRevenueSplitter(
Copy link
Contributor

Choose a reason for hiding this comment

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

@internal

@juangm juangm merged commit 65cb5b6 into main Oct 8, 2025
7 checks passed
@juangm juangm deleted the pawel/aave-995-integrate-split-revenue-into-the-sdk branch October 8, 2025 08:21
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.

4 participants