Skip to content

Commit

Permalink
Update for koinos-proto commit 1a98c82
Browse files Browse the repository at this point in the history
  • Loading branch information
koinos-ci committed Mar 21, 2024
1 parent 46a1fc6 commit b0e6605
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions assembly/koinos/chain/error.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import { Writer, Reader } from "as-proto";

export namespace error {
@unmanaged
export class error_details {
static encode(message: error_details, writer: Writer): void {
if (message.code != 0) {
writer.uint32(8);
writer.int32(message.code);
}

const unique_name_logs = message.logs;
if (unique_name_logs.length !== 0) {
for (let i = 0; i < unique_name_logs.length; ++i) {
writer.uint32(18);
writer.string(unique_name_logs[i]);
}
}
}

static decode(reader: Reader, length: i32): error_details {
Expand All @@ -21,6 +28,10 @@ export namespace error {
message.code = reader.int32();
break;

case 2:
message.logs.push(reader.string());
break;

default:
reader.skipType(tag & 7);
break;
Expand All @@ -31,9 +42,11 @@ export namespace error {
}

code: i32;
logs: Array<string>;

constructor(code: i32 = 0) {
constructor(code: i32 = 0, logs: Array<string> = []) {
this.code = code;
this.logs = logs;
}
}

Expand Down

0 comments on commit b0e6605

Please sign in to comment.