Skip to content

Commit

Permalink
feat(sdk): support force exact block time option (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
zfy0701 authored Mar 27, 2024
1 parent 4b682ab commit 1f68a3a
Show file tree
Hide file tree
Showing 9 changed files with 1,810 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/protos/processor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ message ProjectConfig {

message ExecutionConfig {
bool sequential = 1;
bool forceExactBlockTime = 2;
}

message ProcessConfigRequest {
Expand Down
16 changes: 14 additions & 2 deletions packages/protos/src/processor/protos/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export interface ProjectConfig {

export interface ExecutionConfig {
sequential: boolean;
forceExactBlockTime: boolean;
}

export interface ProcessConfigRequest {
Expand Down Expand Up @@ -911,14 +912,17 @@ export const ProjectConfig = {
};

function createBaseExecutionConfig(): ExecutionConfig {
return { sequential: false };
return { sequential: false, forceExactBlockTime: false };
}

export const ExecutionConfig = {
encode(message: ExecutionConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.sequential === true) {
writer.uint32(8).bool(message.sequential);
}
if (message.forceExactBlockTime === true) {
writer.uint32(16).bool(message.forceExactBlockTime);
}
return writer;
},

Expand All @@ -932,6 +936,9 @@ export const ExecutionConfig = {
case 1:
message.sequential = reader.bool();
break;
case 2:
message.forceExactBlockTime = reader.bool();
break;
default:
reader.skipType(tag & 7);
break;
Expand All @@ -941,12 +948,16 @@ export const ExecutionConfig = {
},

fromJSON(object: any): ExecutionConfig {
return { sequential: isSet(object.sequential) ? Boolean(object.sequential) : false };
return {
sequential: isSet(object.sequential) ? Boolean(object.sequential) : false,
forceExactBlockTime: isSet(object.forceExactBlockTime) ? Boolean(object.forceExactBlockTime) : false,
};
},

toJSON(message: ExecutionConfig): unknown {
const obj: any = {};
message.sequential !== undefined && (obj.sequential = message.sequential);
message.forceExactBlockTime !== undefined && (obj.forceExactBlockTime = message.forceExactBlockTime);
return obj;
},

Expand All @@ -957,6 +968,7 @@ export const ExecutionConfig = {
fromPartial(object: DeepPartial<ExecutionConfig>): ExecutionConfig {
const message = createBaseExecutionConfig();
message.sequential = object.sequential ?? false;
message.forceExactBlockTime = object.forceExactBlockTime ?? false;
return message;
},
};
Expand Down
Loading

0 comments on commit 1f68a3a

Please sign in to comment.