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

build: update most recent proto files #150

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
13 changes: 13 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,16 @@ The files of the [candid](./candid) folders are shared across packages. Their ar
- `something.certified.idl.d.ts`: the typescript definition of the above factory file

(1) auto-generated with [didc](https://github.com/dfinity/candid)

## Proto files

To update the proto files proceed as following:

1. Update the `.proto` with their up-to-date source files (see [./script/update_proto.sh](./script/update_proto.sh) for the list of repos)
2. Manually update the files to set local `import`

e.g. `import "base_types.proto";` instead of `import "ic_base_types/pb/v1/types.proto";`

3. Execute [./script/update_proto.sh](./script/update_proto.sh) to generate the related `.js` and `.d.ts` files automatically

Note: you need to use the exact version of `protoc` bin. See [./script/install-protoc](./script/install-protoc) for current version number.
37 changes: 0 additions & 37 deletions packages/nns/proto/base_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import "google/protobuf/descriptor.proto";
extend google.protobuf.MessageOptions {
bool tui_signed_message = 20000;
}

// The annotated field is displayed on the hardware wallet in the specification
// used by launch of the Internet Computer.
extend google.protobuf.FieldOptions {
Expand All @@ -22,39 +21,3 @@ message PrincipalId {
option (tui_signed_message) = true;
bytes serialized_id = 1 [(tui_signed_display_q2_2021) = true];
}

// A PB container for a CanisterId, which uniquely identifies
// a principal.
message CanisterId {
bytes serialized_id = 1;
}

// A container for a NeuronId blob, which uniquely identifies
// a Neuron.
message NeuronId {
option (ic_base_types.pb.v1.tui_signed_message) = true;
// bytes serialized_id = 1;
reserved 1;
reserved 'serialized_id';
uint64 id = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true, jstype = JS_STRING];;
}

// The id of a specific proposal.
message ProposalId {
uint64 id = 1 [jstype = JS_STRING];
}

// A descriptor of the authorization of a single method.
// Any of the principals in the list are authorized to execute
// the method.
message MethodAuthzInfo {
string method_name = 1;
repeated bytes principal_ids = 2;
}

// A descriptor of the authorization of all the update methods in a
// canister that require authorization.
// Methods that should be accessible to anyone should not appear in this list
message CanisterAuthzInfo {
repeated MethodAuthzInfo methods_authz = 1;
}
112 changes: 0 additions & 112 deletions packages/nns/proto/base_types_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,118 +26,6 @@ export namespace PrincipalId {
}
}

export class CanisterId extends jspb.Message {
getSerializedId(): Uint8Array | string;
getSerializedId_asU8(): Uint8Array;
getSerializedId_asB64(): string;
setSerializedId(value: Uint8Array | string): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CanisterId.AsObject;
static toObject(includeInstance: boolean, msg: CanisterId): CanisterId.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: CanisterId, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): CanisterId;
static deserializeBinaryFromReader(message: CanisterId, reader: jspb.BinaryReader): CanisterId;
}

export namespace CanisterId {
export type AsObject = {
serializedId: Uint8Array | string,
}
}

export class NeuronId extends jspb.Message {
getId(): string;
setId(value: string): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): NeuronId.AsObject;
static toObject(includeInstance: boolean, msg: NeuronId): NeuronId.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: NeuronId, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): NeuronId;
static deserializeBinaryFromReader(message: NeuronId, reader: jspb.BinaryReader): NeuronId;
}

export namespace NeuronId {
export type AsObject = {
id: string,
}
}

export class ProposalId extends jspb.Message {
getId(): string;
setId(value: string): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ProposalId.AsObject;
static toObject(includeInstance: boolean, msg: ProposalId): ProposalId.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: ProposalId, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): ProposalId;
static deserializeBinaryFromReader(message: ProposalId, reader: jspb.BinaryReader): ProposalId;
}

export namespace ProposalId {
export type AsObject = {
id: string,
}
}

export class MethodAuthzInfo extends jspb.Message {
getMethodName(): string;
setMethodName(value: string): void;

clearPrincipalIdsList(): void;
getPrincipalIdsList(): Array<Uint8Array | string>;
getPrincipalIdsList_asU8(): Array<Uint8Array>;
getPrincipalIdsList_asB64(): Array<string>;
setPrincipalIdsList(value: Array<Uint8Array | string>): void;
addPrincipalIds(value: Uint8Array | string, index?: number): Uint8Array | string;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): MethodAuthzInfo.AsObject;
static toObject(includeInstance: boolean, msg: MethodAuthzInfo): MethodAuthzInfo.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: MethodAuthzInfo, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): MethodAuthzInfo;
static deserializeBinaryFromReader(message: MethodAuthzInfo, reader: jspb.BinaryReader): MethodAuthzInfo;
}

export namespace MethodAuthzInfo {
export type AsObject = {
methodName: string,
principalIdsList: Array<Uint8Array | string>,
}
}

export class CanisterAuthzInfo extends jspb.Message {
clearMethodsAuthzList(): void;
getMethodsAuthzList(): Array<MethodAuthzInfo>;
setMethodsAuthzList(value: Array<MethodAuthzInfo>): void;
addMethodsAuthz(value?: MethodAuthzInfo, index?: number): MethodAuthzInfo;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CanisterAuthzInfo.AsObject;
static toObject(includeInstance: boolean, msg: CanisterAuthzInfo): CanisterAuthzInfo.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: CanisterAuthzInfo, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): CanisterAuthzInfo;
static deserializeBinaryFromReader(message: CanisterAuthzInfo, reader: jspb.BinaryReader): CanisterAuthzInfo;
}

export namespace CanisterAuthzInfo {
export type AsObject = {
methodsAuthzList: Array<MethodAuthzInfo.AsObject>,
}
}

export const tuiSignedMessage: jspb.ExtensionFieldInfo<boolean>;

export const tuiSignedDisplayQ22021: jspb.ExtensionFieldInfo<boolean>;
Expand Down
Loading