Skip to content

Commit

Permalink
[GHA] add new types (#83)
Browse files Browse the repository at this point in the history
* [GHA] update encointer node binary

* [node-api] fix test community spec

* add `MeetupResult` type and extend `CommunityMetadata` with `AnnouncementSigner` and `CommunityRules`
  • Loading branch information
clangenb authored Sep 21, 2023
1 parent 139db87 commit b5be931
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build-and-test.yml
name: encointer-node-notee-791926026dae7da9e10680f3109ff04f0cc3a908
name: encointer-node-notee-3e805e3283a7348ff70f22224478db5b5366395b
# in fact this action should download the latest artifact, but sometimes fails. Then we need to
# set the `run_id` to force a download of an updated binary.
run_id: 5338501364
run_id: 6253043495
path: node
repo: encointer/encointer-node

Expand Down
4 changes: 3 additions & 1 deletion packages/node-api/src/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,9 @@ const testCommunityParams = {
meta: {
"name": "Mediterranea",
"symbol": "MTA",
"assets": "QmP2fzfikh7VqTu8pvzd2G2vAd4eK7EaazXTEgqGN6AWoD"
"assets": "QmP2fzfikh7VqTu8pvzd2G2vAd4eK7EaazXTEgqGN6AWoD",
"announcementSigner": null,
"rules": "LoCo"
},
cid: "sqm1v79dF6b",
bootstrappers: [
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

0 comments on commit b5be931

Please sign in to comment.