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

Crt release #4753

Merged
merged 111 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
e883436
chore: add unit test file for amm
ignazio-bovo Oct 26, 2022
026d075
chore: add test for unbonding & activation
ignazio-bovo Oct 27, 2022
cb96bb2
Revert "chore: add public functions"
ignazio-bovo Oct 27, 2022
61c5a93
chore: add tests on activate amm
ignazio-bovo Oct 31, 2022
12fd60b
fix: cargo fmt
ignazio-bovo Oct 31, 2022
aaf173f
Merge branch 'carthage' into carthage-amm
ignazio-bovo Oct 31, 2022
3dbdecf
fix: build errors for tests
ignazio-bovo Oct 31, 2022
61d4edb
continue on implementing amm activation
ignazio-bovo Oct 31, 2022
0548768
fix: run fomatting
ignazio-bovo Oct 31, 2022
d8a4ccd
chore: add extra activate behavior
ignazio-bovo Nov 1, 2022
c18ce80
feat: add tests for bonding curve parm validation
ignazio-bovo Nov 1, 2022
9da9454
feat: remove parameters validation for bonding curve
ignazio-bovo Nov 2, 2022
7708730
chore: setup BondFixture
ignazio-bovo Nov 2, 2022
4b6c543
feat: add bond tests
ignazio-bovo Nov 3, 2022
45b69b4
feat: add `creator_member_id` to `TokenData`
ignazio-bovo Nov 3, 2022
0fab514
fix: all test except `timestamp` fixed
ignazio-bovo Nov 4, 2022
a74dc3b
fix: remove commented code
ignazio-bovo Nov 4, 2022
2dfbd8f
fix: test formatting
ignazio-bovo Nov 4, 2022
47828d1
fix: add timestamp and slippage errors
ignazio-bovo Nov 5, 2022
01f4193
feat: finish tests for `bond` extrinsic
ignazio-bovo Nov 5, 2022
b21e572
feat: add unbonding tests
ignazio-bovo Nov 5, 2022
e293365
fix: review and correct `unbond` tests
ignazio-bovo Nov 5, 2022
294c109
fix: all tests passing
ignazio-bovo Nov 5, 2022
bd445c9
feat: add `deactivate_amm` tests
ignazio-bovo Nov 6, 2022
90e139d
fix: all tests passing
ignazio-bovo Nov 6, 2022
f793f5e
fix: pricing function computation
ignazio-bovo Nov 7, 2022
a97b01b
fix: all tests passing
ignazio-bovo Nov 9, 2022
bf16a7f
fix: quick refactor
ignazio-bovo Nov 9, 2022
4c67c05
fix: slippage calculations and clippy errors
ignazio-bovo Nov 10, 2022
19f8a5f
fix: added events
ignazio-bovo Nov 10, 2022
dfd333a
feat: add event deposit and tests
ignazio-bovo Nov 10, 2022
30c72a1
chore: add comments
ignazio-bovo Nov 14, 2022
76b71d1
fix: clippy
ignazio-bovo Nov 14, 2022
bd53c80
fix: all tests passing
ignazio-bovo Nov 14, 2022
4be0b99
fix: benchmark tests
ignazio-bovo Nov 14, 2022
af88c11
Update runtime-modules/project-token/src/errors.rs
Nov 16, 2022
945f13f
Update runtime-modules/project-token/src/errors.rs
Nov 16, 2022
2a70e90
Update runtime-modules/project-token/src/errors.rs
Nov 16, 2022
b8eac81
Update runtime-modules/project-token/src/tests/bonding_curve.rs
Nov 16, 2022
20f8048
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
51174a4
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
440f884
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
39e376c
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
8efbd13
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
8e2120f
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
7a39487
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
1ddf971
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
eb9b4f7
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
e28be40
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
b0d0221
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
a6f0c1d
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
462bb86
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
a42adeb
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
89c7472
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
3aec1a9
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
3c899e2
Update runtime-modules/project-token/src/lib.rs
Nov 16, 2022
3da3e57
Update runtime-modules/project-token/src/tests/bonding_curve.rs
Nov 16, 2022
e6ae2fa
fix: add correct value check
ignazio-bovo Nov 16, 2022
e4f8164
fix: activate / deactivate now are methods
ignazio-bovo Nov 16, 2022
7713a64
fix: new mechanism for deactivation amm
ignazio-bovo Nov 16, 2022
b871360
fix: deactivate amm + timestamp tests
ignazio-bovo Nov 17, 2022
c93dcf3
feat: add tx fees logic
ignazio-bovo Nov 17, 2022
e4d82c2
feat: add content related extrinsics for amm
ignazio-bovo Nov 17, 2022
f75f359
fix: misc + renamed events
ignazio-bovo Nov 18, 2022
751a3a3
fix: cargo checks
ignazio-bovo Nov 18, 2022
d06743f
fix: AmmControl permission
ignazio-bovo Nov 18, 2022
43d3b66
fix: update token data on benchmarks
ignazio-bovo Nov 21, 2022
23037f3
Update runtime-modules/project-token/src/lib.rs
Nov 22, 2022
ba4613e
Update runtime-modules/project-token/src/errors.rs
Nov 22, 2022
cc0c39e
Update runtime-modules/project-token/src/lib.rs
Nov 22, 2022
7cd0228
fix: misc fixes
ignazio-bovo Nov 22, 2022
e257c40
fix: renaming
ignazio-bovo Nov 23, 2022
d431739
chore: generate types and metadata
ignazio-bovo Nov 23, 2022
4ccbe86
chore: generate types and metadata
ignazio-bovo Nov 23, 2022
01bb915
Merge branch 'mainnet' into carthage-amm
ignazio-bovo Nov 23, 2022
70804b5
Update runtime-modules/project-token/src/lib.rs
Nov 24, 2022
2cbb8c5
Update runtime-modules/project-token/src/lib.rs
Nov 24, 2022
66cd46f
Update runtime-modules/project-token/src/events.rs
Nov 24, 2022
2ce5c0e
Update runtime-modules/project-token/src/lib.rs
Nov 24, 2022
50a1c71
Update runtime-modules/project-token/src/tests/amm.rs
Nov 24, 2022
14e4338
Update runtime-modules/project-token/src/lib.rs
Nov 24, 2022
038d06f
Update runtime-modules/project-token/src/lib.rs
Nov 24, 2022
a3aa6d3
Update runtime-modules/project-token/src/tests/amm.rs
Nov 24, 2022
81f7963
Update runtime-modules/project-token/src/events.rs
Nov 24, 2022
8583cdd
Update runtime-modules/project-token/src/tests/amm.rs
Nov 24, 2022
3aa7205
Update runtime-modules/project-token/src/tests/amm.rs
Nov 24, 2022
4f8fe65
Update runtime-modules/project-token/src/errors.rs
Nov 24, 2022
b211249
Update runtime-modules/project-token/src/types.rs
Nov 24, 2022
c30a7f2
fix: transfer logic fix
ignazio-bovo Nov 24, 2022
e3040e9
Merge branch 'mainnet' into carthage-amm
ignazio-bovo Nov 24, 2022
f27c7af
fix: amm curve on BM
ignazio-bovo Nov 24, 2022
a6e7118
Update runtime-modules/project-token/src/tests/fixtures.rs
Nov 25, 2022
749911c
fix: eval function logic edit
ignazio-bovo Nov 28, 2022
a43f90c
fix: remove unused error
ignazio-bovo Nov 29, 2022
70b0bdd
Merge pull request #4434 from ignazio-bovo/carthage-amm
Dec 6, 2022
12b8ff5
Merge branch 'crt_release' into nara_crt_release
May 4, 2023
5232ca0
fix: update types and metadata
May 8, 2023
a57c9f9
fix: chain metadata
May 8, 2023
77b9e35
fix: add metadata to qn from previous releases
May 8, 2023
7be5630
feat: bump spec version
May 8, 2023
920fa16
feat: generate chain metadata
May 8, 2023
bdbdc85
fix: query node failing checks
May 9, 2023
e615bb1
fix: lint
May 9, 2023
a002591
Merge branch 'nara' into nara_crt_release
May 9, 2023
d39b948
fix: re enable backward event compatibility
May 9, 2023
fe01f13
fix: bump cargo version
May 9, 2023
08ffbf8
fix: cargo lock
May 9, 2023
232e2c6
fix: post runtime cheks
May 9, 2023
8898461
fix: commented out faling scenario
May 10, 2023
d4fda63
fix: event versioning
May 10, 2023
2826d51
Merge pull request #4749 from ignazio-bovo/nara_crt_release
mnaamani May 11, 2023
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion chain-metadata.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion query-node/chain-metadata/1001.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion query-node/chain-metadata/2001.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions query-node/chain-metadata/2002.json

Large diffs are not rendered by default.

30 changes: 22 additions & 8 deletions query-node/mappings/src/content/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import {
import {
convertChannelOwnerToMemberOrCuratorGroup,
convertContentActor,
mapAgentPermission,
processAppActionMetadata,
processChannelMetadata,
u8aToBytes,
Expand All @@ -71,13 +70,15 @@ import { generateAppActionCommitment } from '@joystream/js/utils'
import { DecodedMetadataObject } from '@joystream/metadata-protobuf/types'
import { BaseModel } from '@joystream/warthog'
import { AccountId32, Balance } from '@polkadot/types/interfaces'
import { PalletContentIterableEnumsChannelActionPermission } from '@polkadot/types/lookup'
import { PalletContentIterableEnumsChannelActionPermission as PalletContentIterableEnumsChannelActionPermission_V1001 } from '../../generated/types/1001/types-lookup'
import { PalletContentIterableEnumsChannelActionPermission as PalletContentIterableEnumsChannelActionPermission_V2002 } from '../../generated/types/2002/types-lookup'
import BN from 'bn.js'
import {
Content_ChannelAgentRemarkedEvent_V1001 as ChannelAgentRemarkedEvent_V1001,
Content_ChannelAssetsDeletedByModeratorEvent_V1001 as ChannelAssetsDeletedByModeratorEvent_V1001,
Content_ChannelAssetsRemovedEvent_V1001 as ChannelAssetsRemovedEvent_V1001,
Content_ChannelCreatedEvent_V1001 as ChannelCreatedEvent_V1001,
Content_ChannelCreatedEvent_V2002 as ChannelCreatedEvent_V2002,
Content_ChannelDeletedByModeratorEvent_V1001 as ChannelDeletedByModeratorEvent_V1001,
Content_ChannelDeletedEvent_V1001 as ChannelDeletedEvent_V1001,
Content_ChannelFundsWithdrawnEvent_V1001 as ChannelFundsWithdrawnEvent_V1001,
Expand All @@ -86,14 +87,17 @@ import {
Content_ChannelRewardClaimedAndWithdrawnEvent_V1001 as ChannelRewardClaimedAndWithdrawnEvent_V1001,
Content_ChannelRewardUpdatedEvent_V2001 as ChannelRewardUpdatedEvent_V2001,
Content_ChannelUpdatedEvent_V1001 as ChannelUpdatedEvent_V1001,
Content_ChannelUpdatedEvent_V2002 as ChannelUpdatedEvent_V2002,
Content_ChannelVisibilitySetByModeratorEvent_V1001 as ChannelVisibilitySetByModeratorEvent_V1001,
} from '../../generated/types'

export async function content_ChannelCreated(ctx: EventContext & StoreContext): Promise<void> {
const { store, event } = ctx
const { store, event, block } = ctx
const { specVersion } = block.runtimeVersion

// read event data
const [channelId, { owner, dataObjects, channelStateBloatBond }, channelCreationParameters, rewardAccount] =
new ChannelCreatedEvent_V1001(event).params
specVersion < 2002 ? new ChannelCreatedEvent_V1001(event).params : new ChannelCreatedEvent_V2002(event).params

// prepare channel owner (handles fields `ownerMember` and `ownerCuratorGroup`)
const channelOwner = await convertChannelOwnerToMemberOrCuratorGroup(store, owner)
Expand Down Expand Up @@ -160,9 +164,12 @@ export async function content_ChannelCreated(ctx: EventContext & StoreContext):
}

export async function content_ChannelUpdated(ctx: EventContext & StoreContext): Promise<void> {
const { store, event } = ctx
const { store, event, block } = ctx
const { specVersion } = block.runtimeVersion

// read event data
const [, channelId, channelUpdateParameters, newDataObjects] = new ChannelUpdatedEvent_V1001(event).params
const [, channelId, channelUpdateParameters, newDataObjects] =
specVersion < 2002 ? new ChannelUpdatedEvent_V1001(event).params : new ChannelUpdatedEvent_V2002(event).params

// load channel
const channel = await store.get(Channel, {
Expand Down Expand Up @@ -385,7 +392,12 @@ export async function content_ChannelAgentRemarked(ctx: EventContext & StoreCont
async function updateChannelAgentsPermissions(
store: DatabaseManager,
channel: Channel,
collaboratorsPermissions: BTreeMap<u64, BTreeSet<PalletContentIterableEnumsChannelActionPermission>>
collaboratorsPermissions: BTreeMap<
u64,
BTreeSet<
PalletContentIterableEnumsChannelActionPermission_V1001 | PalletContentIterableEnumsChannelActionPermission_V2002
>
>
) {
// safest way to update permission is to delete existing and creating new ones

Expand All @@ -402,7 +414,9 @@ async function updateChannelAgentsPermissions(
const collaborator = new Collaborator({
channel: new Channel({ id: channel.id.toString() }),
member: new Membership({ id: memberId.toString() }),
permissions: Array.from(permissions).map(mapAgentPermission),
permissions: Array.from(permissions).map((permissions) => {
return permissions.toString()
}),
})

await store.save(collaborator)
Expand Down
20 changes: 14 additions & 6 deletions query-node/mappings/src/content/curatorGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ eslint-disable @typescript-eslint/naming-convention
import { DatabaseManager, EventContext, StoreContext } from '@joystream/hydra-common'
import { Curator, CuratorGroup, CuratorAgentPermissions } from 'query-node/dist/model'
import { inconsistentState, logger } from '../common'
import { mapAgentPermission } from './utils'
import { BTreeSet } from '@polkadot/types'
// Joystream types
import { PalletContentIterableEnumsChannelActionPermission } from '@polkadot/types/lookup'
import { PalletContentIterableEnumsChannelActionPermission as PalletContentIterableEnumsChannelActionPermission_V1001 } from '../../generated/types/1001/types-lookup'
import { PalletContentIterableEnumsChannelActionPermission as PalletContentIterableEnumsChannelActionPermission_V2002 } from '../../generated/types/2002/types-lookup'
import {
Content_CuratorAddedEvent_V2002 as CuratorAddedEvent_V2002,
Content_CuratorAddedEvent_V1001 as CuratorAddedEvent_V1001,
Content_CuratorGroupCreatedEvent_V1001 as CuratorGroupCreatedEvent_V1001,
Content_CuratorGroupStatusSetEvent_V1001 as CuratorGroupStatusSetEvent_V1001,
Expand Down Expand Up @@ -82,9 +83,12 @@ export async function content_CuratorGroupStatusSet({ store, event }: EventConte
logger.info('Curator group status has been set', { id: curatorGroupId, isActive })
}

export async function content_CuratorAdded({ store, event }: EventContext & StoreContext): Promise<void> {
export async function content_CuratorAdded({ store, event, block }: EventContext & StoreContext): Promise<void> {
// read event data
const [curatorGroupId, curatorId, permissions] = new CuratorAddedEvent_V1001(event).params
const { specVersion } = block.runtimeVersion

const [curatorGroupId, curatorId, permissions] =
specVersion < 2002 ? new CuratorAddedEvent_V1001(event).params : new CuratorAddedEvent_V2002(event).params

// load curator group
const curatorGroup = await store.get(CuratorGroup, {
Expand Down Expand Up @@ -139,7 +143,9 @@ async function updateCuratorAgentPermissions(
store: DatabaseManager,
curatorGroup: CuratorGroup,
curator: Curator,
permissions?: BTreeSet<PalletContentIterableEnumsChannelActionPermission>
permissions?: BTreeSet<
PalletContentIterableEnumsChannelActionPermission_V1001 | PalletContentIterableEnumsChannelActionPermission_V2002
>
) {
// safest way to update permission is to delete existing and creating new ones

Expand All @@ -160,7 +166,9 @@ async function updateCuratorAgentPermissions(
const curatorAgentPermissions = new CuratorAgentPermissions({
curatorGroup: new CuratorGroup({ id: curatorGroup.id.toString() }),
curator: new Curator({ id: curator.id.toString() }),
permissions: permissionsArray.map(mapAgentPermission),
permissions: permissionsArray.map((permissions) => {
return permissions.toString()
}),
})

await store.save(curatorAgentPermissions)
Expand Down
2 changes: 1 addition & 1 deletion query-node/mappings/src/membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ export async function members_MemberRemarked(ctx: EventContext & StoreContext):
const { event, store, block } = ctx
const { specVersion } = block.runtimeVersion
const [memberId, metadataBytes, payment] =
specVersion === 2001 ? new MemberRemarkedEvent_V2001(event).params : new MemberRemarkedEvent_V1001(event).params
specVersion >= 2001 ? new MemberRemarkedEvent_V2001(event).params : new MemberRemarkedEvent_V1001(event).params

try {
const metadata = deserializeMetadata(MemberRemarked, metadataBytes)
Expand Down
2 changes: 1 addition & 1 deletion query-node/schemas/content.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type Channel @entity {

"List of all claimed rewards"
claimedRewards: [ChannelRewardClaimedEvent!] @derivedFrom(field: "channel")

"Number of videos ever created in this channel"
totalVideosCreated: Int!
}
Expand Down
3 changes: 2 additions & 1 deletion runtime-modules/content/src/benchmarks/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,8 @@ benchmarks! {
accounts_number: a as u64,
revenue_split_rate: params.revenue_split_rate,
revenue_split: RevenueSplitStateOf::<T>::Inactive,
next_revenue_split_id: 0
next_revenue_split_id: 0,
amm_curve: None,
});
assert_last_event::<T>(
<T as Config>::Event::from(
Expand Down
3 changes: 3 additions & 0 deletions runtime-modules/content/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,5 +409,8 @@ decl_error! {

/// Channel Transfers are blocked during token sales
ChannelTransfersBlockedDuringTokenSales,

/// Channel Transfers are blocked during active AMM
ChannelTransfersBlockedDuringActiveAmm
}
}
72 changes: 71 additions & 1 deletion runtime-modules/content/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub mod weights;
use core::marker::PhantomData;
use project_token::traits::PalletToken;
use project_token::types::{
JoyBalanceOf, TokenIssuanceParametersOf, TokenSaleParamsOf, TransfersWithVestingOf,
AmmParams, JoyBalanceOf, TokenIssuanceParametersOf, TokenSaleParamsOf, TransfersWithVestingOf,
UploadContextOf, YearlyRate,
};
use sp_std::vec;
Expand Down Expand Up @@ -185,6 +185,7 @@ pub trait Config:
TokenSaleParamsOf<Self>,
UploadContextOf<Self>,
TransfersWithVestingOf<Self>,
AmmParams,
>;

/// Minimum cashout allowed limit
Expand Down Expand Up @@ -3076,6 +3077,11 @@ decl_module! {
T::ProjectToken::is_sale_unscheduled(token_id),
Error::<T>::ChannelTransfersBlockedDuringTokenSales,
);

ensure!(
!T::ProjectToken::is_amm_active(token_id),
Error::<T>::ChannelTransfersBlockedDuringActiveAmm
);
}

//
Expand Down Expand Up @@ -3757,6 +3763,70 @@ decl_module! {
channel.creator_token_id = None;
});
}

/// Activate Amm functionality for token
#[weight = 100_000_000] // TODO: Adjust weight
pub fn activate_amm(
origin,
actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
channel_id: T::ChannelId,
params: AmmParams,
) {
let channel = Self::ensure_channel_exists(&channel_id)?;

channel.ensure_has_no_active_transfer::<T>()?;

// Ensure token was issued
let token_id = channel.ensure_creator_token_issued::<T>()?;

// Permissions check
ensure_actor_authorized_to_activate_amm::<T>(
origin,
&actor,
&channel
)?;

// Retrieve member_id based on actor
let member_id = get_member_id_of_actor::<T>(&actor)?;

// Call to ProjectToken
T::ProjectToken::activate_amm(
token_id,
member_id,
params,
)?;

}

/// Deactivate Amm functionality for token
#[weight = 100_000_000] // TODO: Adjust weight
pub fn deactivate_amm(
origin,
actor: ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
channel_id: T::ChannelId,
) {
let channel = Self::ensure_channel_exists(&channel_id)?;

// Ensure token was issued
let token_id = channel.ensure_creator_token_issued::<T>()?;

// Permissions check
ensure_actor_authorized_to_deactivate_amm::<T>(
origin,
&actor,
&channel
)?;

// Retrieve member_id based on actor
let member_id = get_member_id_of_actor::<T>(&actor)?;

// Call to ProjectToken
T::ProjectToken::deactivate_amm(
token_id,
member_id,
)?;

}
}
}

Expand Down
22 changes: 22 additions & 0 deletions runtime-modules/content/src/permissions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,3 +713,25 @@ pub fn ensure_actor_authorized_to_deissue_creator_token<T: Config>(
ensure_actor_has_channel_permissions::<T>(&sender, actor, channel, &required_permissions)?;
Ok(sender)
}

pub fn ensure_actor_authorized_to_activate_amm<T: Config>(
origin: T::Origin,
actor: &ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
channel: &Channel<T>,
) -> Result<T::AccountId, DispatchError> {
let sender = ensure_signed(origin)?;
let required_permissions = vec![ChannelActionPermission::AmmControl];
ensure_actor_has_channel_permissions::<T>(&sender, actor, channel, &required_permissions)?;
Ok(sender)
}

pub fn ensure_actor_authorized_to_deactivate_amm<T: Config>(
origin: T::Origin,
actor: &ContentActor<T::CuratorGroupId, T::CuratorId, T::MemberId>,
channel: &Channel<T>,
) -> Result<T::AccountId, DispatchError> {
let sender = ensure_signed(origin)?;
let required_permissions = vec![ChannelActionPermission::AmmControl];
ensure_actor_has_channel_permissions::<T>(&sender, actor, channel, &required_permissions)?;
Ok(sender)
}
2 changes: 2 additions & 0 deletions runtime-modules/content/src/tests/creator_tokens.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
mod activate_amm;
mod claim_patronage_credit;
mod deactivate_amm;
mod deissue;
mod finalize_creator_token_sale;
mod finalize_revenue_split;
Expand Down
Loading