Skip to content
This repository has been archived by the owner on Nov 14, 2019. It is now read-only.

Hash as bytes #124

Merged
merged 6 commits into from
Aug 30, 2019
Merged
Show file tree
Hide file tree
Changes from 4 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
11 changes: 9 additions & 2 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"license": "ISC",
"dependencies": {
"@grpc/proto-loader": "^0.5.1",
"base-x": "^3.0.6",
"grpc": "^1.21.1",
"js-yaml": "^3.13.1",
"pb-util": "^0.1.1",
Expand Down
4 changes: 2 additions & 2 deletions src/api/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { API } from './types'
import { Stream } from '../util/grpc';
import { encode } from '../util/encoder';

const hash = 'hash'
const hash = Buffer.from('hash')

class StreamMock<T> implements Stream<T> {
private eventEmitter = new EventEmitter()
Expand All @@ -30,7 +30,7 @@ export default (endpoint: string): API => ({
},
execution: {
create() { return Promise.resolve({ hash }) },
get() { return Promise.resolve({ parentHash: hash, eventHash: 'xxx', status: 0, instanceHash: hash, taskKey: 'xxx', inputs: encode({}) }) },
get() { return Promise.resolve({ parentHash: hash, eventHash: Buffer.from('xxx'), status: 0, instanceHash: hash, taskKey: 'xxx', inputs: encode({}) }) },
stream() { return streams.execution },
update() { return Promise.resolve({}) }
},
Expand Down
24 changes: 12 additions & 12 deletions src/api/typedef/event.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ declare namespace mesg {
interface IEvent {

/** Event hash */
hash?: (string|null);
hash?: (Uint8Array|null);
NicolasMahe marked this conversation as resolved.
Show resolved Hide resolved

/** Event instanceHash */
instanceHash?: (string|null);
instanceHash?: (Uint8Array|null);

/** Event key */
key?: (string|null);
Expand All @@ -33,10 +33,10 @@ declare namespace mesg {
constructor(properties?: types.IEvent);

/** Event hash. */
public hash: string;
public hash: Uint8Array;

/** Event instanceHash. */
public instanceHash: string;
public instanceHash: Uint8Array;

/** Event key. */
public key: string;
Expand Down Expand Up @@ -238,10 +238,10 @@ declare namespace mesg {
interface IFilter {

/** Filter hash */
hash?: (string|null);
hash?: (Uint8Array|null);

/** Filter instanceHash */
instanceHash?: (string|null);
instanceHash?: (Uint8Array|null);

/** Filter key */
key?: (string|null);
Expand All @@ -257,10 +257,10 @@ declare namespace mesg {
constructor(properties?: api.StreamEventRequest.IFilter);

/** Filter hash. */
public hash: string;
public hash: Uint8Array;

/** Filter instanceHash. */
public instanceHash: string;
public instanceHash: Uint8Array;

/** Filter key. */
public key: string;
Expand All @@ -271,7 +271,7 @@ declare namespace mesg {
interface ICreateEventRequest {

/** CreateEventRequest instanceHash */
instanceHash?: (string|null);
instanceHash?: (Uint8Array|null);

/** CreateEventRequest key */
key?: (string|null);
Expand All @@ -290,7 +290,7 @@ declare namespace mesg {
constructor(properties?: api.ICreateEventRequest);

/** CreateEventRequest instanceHash. */
public instanceHash: string;
public instanceHash: Uint8Array;

/** CreateEventRequest key. */
public key: string;
Expand All @@ -303,7 +303,7 @@ declare namespace mesg {
interface ICreateEventResponse {

/** CreateEventResponse hash */
hash?: (string|null);
hash?: (Uint8Array|null);
}

/** Represents a CreateEventResponse. */
Expand All @@ -316,7 +316,7 @@ declare namespace mesg {
constructor(properties?: api.ICreateEventResponse);

/** CreateEventResponse hash. */
public hash: string;
public hash: Uint8Array;
}
}
}
40 changes: 20 additions & 20 deletions src/api/typedef/execution.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ declare namespace mesg {
interface IExecution {

/** Execution hash */
hash?: (string|null);
hash?: (Uint8Array|null);

/** Execution parentHash */
parentHash?: (string|null);
parentHash?: (Uint8Array|null);

/** Execution eventHash */
eventHash?: (string|null);
eventHash?: (Uint8Array|null);

/** Execution status */
status?: (types.Status|null);

/** Execution instanceHash */
instanceHash?: (string|null);
instanceHash?: (Uint8Array|null);

/** Execution taskKey */
taskKey?: (string|null);
Expand All @@ -50,7 +50,7 @@ declare namespace mesg {
tags?: (string[]|null);

/** Execution workflowHash */
workflowHash?: (string|null);
workflowHash?: (Uint8Array|null);

/** Execution stepID */
stepID?: (string|null);
Expand All @@ -66,19 +66,19 @@ declare namespace mesg {
constructor(properties?: types.IExecution);

/** Execution hash. */
public hash: string;
public hash: Uint8Array;

/** Execution parentHash. */
public parentHash: string;
public parentHash: Uint8Array;

/** Execution eventHash. */
public eventHash: string;
public eventHash: Uint8Array;

/** Execution status. */
public status: types.Status;

/** Execution instanceHash. */
public instanceHash: string;
public instanceHash: Uint8Array;

/** Execution taskKey. */
public taskKey: string;
Expand All @@ -96,7 +96,7 @@ declare namespace mesg {
public tags: string[];

/** Execution workflowHash. */
public workflowHash: string;
public workflowHash: Uint8Array;

/** Execution stepID. */
public stepID: string;
Expand Down Expand Up @@ -315,7 +315,7 @@ declare namespace mesg {
interface ICreateExecutionRequest {

/** CreateExecutionRequest instanceHash */
instanceHash?: (string|null);
instanceHash?: (Uint8Array|null);

/** CreateExecutionRequest taskKey */
taskKey?: (string|null);
Expand All @@ -337,7 +337,7 @@ declare namespace mesg {
constructor(properties?: api.ICreateExecutionRequest);

/** CreateExecutionRequest instanceHash. */
public instanceHash: string;
public instanceHash: Uint8Array;

/** CreateExecutionRequest taskKey. */
public taskKey: string;
Expand All @@ -353,7 +353,7 @@ declare namespace mesg {
interface ICreateExecutionResponse {

/** CreateExecutionResponse hash */
hash?: (string|null);
hash?: (Uint8Array|null);
}

/** Represents a CreateExecutionResponse. */
Expand All @@ -366,14 +366,14 @@ declare namespace mesg {
constructor(properties?: api.ICreateExecutionResponse);

/** CreateExecutionResponse hash. */
public hash: string;
public hash: Uint8Array;
}

/** Properties of a GetExecutionRequest. */
interface IGetExecutionRequest {

/** GetExecutionRequest hash */
hash?: (string|null);
hash?: (Uint8Array|null);
}

/** Represents a GetExecutionRequest. */
Expand All @@ -386,7 +386,7 @@ declare namespace mesg {
constructor(properties?: api.IGetExecutionRequest);

/** GetExecutionRequest hash. */
public hash: string;
public hash: Uint8Array;
}

/** Properties of a StreamExecutionRequest. */
Expand Down Expand Up @@ -418,7 +418,7 @@ declare namespace mesg {
statuses?: (types.Status[]|null);

/** Filter instanceHash */
instanceHash?: (string|null);
instanceHash?: (Uint8Array|null);

/** Filter taskKey */
taskKey?: (string|null);
Expand All @@ -440,7 +440,7 @@ declare namespace mesg {
public statuses: types.Status[];

/** Filter instanceHash. */
public instanceHash: string;
public instanceHash: Uint8Array;

/** Filter taskKey. */
public taskKey: string;
Expand All @@ -454,7 +454,7 @@ declare namespace mesg {
interface IUpdateExecutionRequest {

/** UpdateExecutionRequest hash */
hash?: (string|null);
hash?: (Uint8Array|null);

/** UpdateExecutionRequest outputs */
outputs?: (google.protobuf.IStruct|null);
Expand All @@ -473,7 +473,7 @@ declare namespace mesg {
constructor(properties?: api.IUpdateExecutionRequest);

/** UpdateExecutionRequest hash. */
public hash: string;
public hash: Uint8Array;

/** UpdateExecutionRequest outputs. */
public outputs?: (google.protobuf.IStruct|null);
Expand Down
Loading