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

add MeetupResult type and extend CommunityMetadata with AnnouncementSigner and CommunityRules #80

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions packages/node-api/src/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ const testCommunityParams = {
"assets": "QmP2fzfikh7VqTu8pvzd2G2vAd4eK7EaazXTEgqGN6AWoD"
},
cid: "sqm1v79dF6b",
rules: "loCo",
bootstrappers: [
"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
Expand Down
8 changes: 6 additions & 2 deletions packages/types/src/interfaces/augment-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import '@polkadot/types/types/registry';

import type { BalanceEntry, BalanceType, Demurrage } from '@encointer/types/interfaces/balances';
import type { BusinessData, BusinessIdentifier, OfferingData, OfferingIdentifier } from '@encointer/types/interfaces/bazaar';
import type { Assignment, AssignmentCount, AssignmentParams, Attestation, AttestationIndexType, CeremonyIndexType, CeremonyPhaseType, ClaimOfAttendance, ClaimOfAttendanceSigningPayload, CommunityCeremonyStats, CommunityReputation, Meetup, MeetupAssignment, MeetupIndexType, MeetupTimeOffsetType, ParticipantIndexType, ParticipantRegistration, ProofOfAttendance, RegistrationType, Reputation } from '@encointer/types/interfaces/ceremony';
import type { Assignment, AssignmentCount, AssignmentParams, Attestation, AttestationIndexType, CeremonyIndexType, CeremonyPhaseType, ClaimOfAttendance, ClaimOfAttendanceSigningPayload, CommunityCeremonyStats, CommunityReputation, Meetup, MeetupAssignment, MeetupIndexType, MeetupResult, MeetupTimeOffsetType, ParticipantIndexType, ParticipantRegistration, ProofOfAttendance, RegistrationType, Reputation } from '@encointer/types/interfaces/ceremony';
import type { FixedI64F64, IpfsCid, PalletString } from '@encointer/types/interfaces/common';
import type { CidDigest, CidName, CommunityCeremony, CommunityIdentifier, CommunityMetadataType, DegreeFixed, DegreeRpc, GeoHash, Location, LocationRpc, NominalIncomeType } from '@encointer/types/interfaces/community';
import type { AnnouncementSigner, Bip340, CidDigest, CidName, CommunityCeremony, CommunityIdentifier, CommunityMetadataType, CommunityRules, DegreeFixed, DegreeRpc, GeoHash, Location, LocationRpc, NominalIncomeType } from '@encointer/types/interfaces/community';
import type { SchedulerState, SystemNumber } from '@encointer/types/interfaces/scheduler';
import type { BalanceTransferArgs, ClientRequest, Enclave, Getter, GetterArgs, GrantReputationArgs, PublicGetter, RegisterAttestationsArgs, RegisterParticipantArgs, Request, ShardIdentifier, TrustedCall, TrustedCallSigned, TrustedGetter, TrustedGetterSigned, WorkerEncoded } from '@encointer/types/interfaces/worker';
import type { Data, StorageKey } from '@polkadot/types';
Expand Down Expand Up @@ -106,6 +106,7 @@ declare module '@polkadot/types/types/registry' {
Address: Address;
AliveContractInfo: AliveContractInfo;
AllowedSlots: AllowedSlots;
AnnouncementSigner: AnnouncementSigner;
AnySignature: AnySignature;
ApiId: ApiId;
ApplyExtrinsicResult: ApplyExtrinsicResult;
Expand Down Expand Up @@ -178,6 +179,7 @@ declare module '@polkadot/types/types/registry' {
Bid: Bid;
Bidder: Bidder;
BidKind: BidKind;
Bip340: Bip340;
BitVec: BitVec;
Block: Block;
BlockAttestations: BlockAttestations;
Expand Down Expand Up @@ -258,6 +260,7 @@ declare module '@polkadot/types/types/registry' {
CommunityIdentifier: CommunityIdentifier;
CommunityMetadataType: CommunityMetadataType;
CommunityReputation: CommunityReputation;
CommunityRules: CommunityRules;
CompactAssignments: CompactAssignments;
CompactAssignmentsTo257: CompactAssignmentsTo257;
CompactAssignmentsTo265: CompactAssignmentsTo265;
Expand Down Expand Up @@ -670,6 +673,7 @@ declare module '@polkadot/types/types/registry' {
Meetup: Meetup;
MeetupAssignment: MeetupAssignment;
MeetupIndexType: MeetupIndexType;
MeetupResult: MeetupResult;
MeetupTimeOffsetType: MeetupTimeOffsetType;
MemberCount: MemberCount;
MembershipProof: MembershipProof;
Expand Down
7 changes: 7 additions & 0 deletions packages/types/src/interfaces/ceremony/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ export default {
AttestationIndexType: 'u64',
MeetupAssignment: '(MeetupIndexType, Option<Location>)',
MeetupTimeOffsetType: 'i32',
MeetupResult: {
_enum: [
'Ok',
'VotesNotDependable',
'MeetupValidationIndexOutOfBounds',
]
},
Reputation: {
_enum: ['Unverified', 'UnverifiedReputable', 'VerifiedUnlinked', 'VerifiedLinked']
},
Expand Down
8 changes: 8 additions & 0 deletions packages/types/src/interfaces/ceremony/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ export interface MeetupAssignment extends ITuple<[MeetupIndexType, Option<Locati
/** @name MeetupIndexType */
export interface MeetupIndexType extends u64 {}

/** @name MeetupResult */
export interface MeetupResult extends Enum {
readonly isOk: boolean;
readonly isVotesNotDependable: boolean;
readonly isMeetupValidationIndexOutOfBounds: boolean;
readonly type: 'Ok' | 'VotesNotDependable' | 'MeetupValidationIndexOutOfBounds';
}

/** @name MeetupTimeOffsetType */
export interface MeetupTimeOffsetType extends i32 {}

Expand Down
13 changes: 12 additions & 1 deletion packages/types/src/interfaces/community/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@ export default {
symbol: 'Text',
assets: 'Text',
theme: 'Option<Text>',
url: 'Option<Text>'
url: 'Option<Text>',
announcementSigner: 'Option<AnnouncementSigner>',
rules: 'CommunityRules',
},
CommunityRules: {
_enum: ['LoCo', 'LoCoFlex', 'BeeDance']
},
AnnouncementSigner: {
_enum: {
bip340: 'Bip340',
}
},
Bip340: 'AccountId',
}
};
23 changes: 22 additions & 1 deletion packages/types/src/interfaces/community/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@

import type { BalanceType } from '@encointer/types/interfaces/balances';
import type { CeremonyIndexType } from '@encointer/types/interfaces/ceremony';
import type { Option, Struct, Text, U8aFixed, i128 } from '@polkadot/types-codec';
import type { Enum, Option, Struct, Text, U8aFixed, i128 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId } from '@polkadot/types/interfaces/runtime';

/** @name AnnouncementSigner */
export interface AnnouncementSigner extends Enum {
readonly isBip340: boolean;
readonly asBip340: Bip340;
readonly type: 'Bip340';
}

/** @name Bip340 */
export interface Bip340 extends AccountId {}

/** @name CidDigest */
export interface CidDigest extends U8aFixed {}
Expand All @@ -31,6 +42,16 @@ export interface CommunityMetadataType extends Struct {
readonly assets: Text;
readonly theme: Option<Text>;
readonly url: Option<Text>;
readonly announcementSigner: Option<AnnouncementSigner>;
readonly rules: CommunityRules;
}

/** @name CommunityRules */
export interface CommunityRules extends Enum {
readonly isLoCo: boolean;
readonly isLoCoFlex: boolean;
readonly isBeeDance: boolean;
readonly type: 'LoCo' | 'LoCoFlex' | 'BeeDance';
}

/** @name DegreeFixed */
Expand Down
Loading