-
Notifications
You must be signed in to change notification settings - Fork 1
/
pre-tx-execute-input.ts
68 lines (56 loc) · 1.78 KB
/
pre-tx-execute-input.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Code generated by protoc-gen-as. DO NOT EDIT.
// Versions:
// protoc-gen-as v1.3.0
// protoc v4.25.1
import { Protobuf, Reader, Writer } from 'as-proto/assembly';
import { BlockInput } from './block-input';
import { WithFromTxInput } from './with-from-tx-input';
export class PreTxExecuteInput {
static encode(message: PreTxExecuteInput, writer: Writer): void {
const tx = message.tx;
if (tx !== null) {
writer.uint32(10);
writer.fork();
WithFromTxInput.encode(tx, writer);
writer.ldelim();
}
const block = message.block;
if (block !== null) {
writer.uint32(18);
writer.fork();
BlockInput.encode(block, writer);
writer.ldelim();
}
}
static decode(reader: Reader, length: i32): PreTxExecuteInput {
const end: usize = length < 0 ? reader.end : reader.ptr + length;
const message = new PreTxExecuteInput();
while (reader.ptr < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.tx = WithFromTxInput.decode(reader, reader.uint32());
break;
case 2:
message.block = BlockInput.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
}
tx: WithFromTxInput | null;
block: BlockInput | null;
constructor(tx: WithFromTxInput | null = null, block: BlockInput | null = null) {
this.tx = tx;
this.block = block;
}
}
export function encodePreTxExecuteInput(message: PreTxExecuteInput): Uint8Array {
return Protobuf.encode(message, PreTxExecuteInput.encode);
}
export function decodePreTxExecuteInput(buffer: Uint8Array): PreTxExecuteInput {
return Protobuf.decode<PreTxExecuteInput>(buffer, PreTxExecuteInput.decode);
}