Skip to content
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

UserOps IT test fix: Re-use existing method for creating entitlement struct for role updates #111

Merged
merged 3 commits into from
Jun 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions core/web3/src/v3/SpaceDapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -915,26 +915,7 @@ export class SpaceDapp implements ISpaceDapp {
space: Space,
params: UpdateRoleParams,
): Promise<IRolesBase.CreateEntitlementStruct[]> {
const updatedEntitlements: IRolesBase.CreateEntitlementStruct[] = []
const [userEntitlement, ruleEntitlement] = await Promise.all([
space.findEntitlementByType(EntitlementModuleType.UserEntitlement),
space.findEntitlementByType(EntitlementModuleType.RuleEntitlement),
])
if (params.users.length > 0 && userEntitlement?.address) {
const entitlementData = createUserEntitlementStruct(
userEntitlement.address,
params.users,
)
updatedEntitlements.push(entitlementData)
}
if (params.ruleData && ruleEntitlement?.address) {
const entitlementData = createRuleEntitlementStruct(
ruleEntitlement.address as `0x${string}`,
params.ruleData,
)
updatedEntitlements.push(entitlementData)
}
return updatedEntitlements
return createEntitlementStruct(space, params.users, params.ruleData);
}

public getSpaceAddress(receipt: ContractReceipt): string | undefined {
Expand Down
Loading