/** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.21.12 * source: syscontract/cross_transaction.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace syscontract { export enum CrossTransactionFunction { EXECUTE = 0, COMMIT = 1, ROLLBACK = 2, READ_STATE = 3, SAVE_PROOF = 4, READ_PROOF = 5, ARBITRATE = 6 } export enum CrossTxState { NON_EXIST = 0, INIT = 1, EXECUTE_OK = 2, EXECUTE_FAIL = 3, COMMIT_OK = 4, COMMIT_FAIL = 5, ROLLBACK_OK = 6, ROLLBACK_FAIL = 7 } export enum CrossArbitrateCmd { AUTO_CMD = 0, EXECUTE_CMD = 1, COMMIT_CMD = 2, ROLLBACK_CMD = 3 } export enum CallType { DIRECT = 0, CROSS = 1 } export enum CrossParams { CREATOR = 0, SENDER = 1, CALL_TYPE = 2 } export class CrossState extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { state?: CrossTxState; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("state" in data && data.state != undefined) { this.state = data.state; } } } get state() { return pb_1.Message.getFieldWithDefault(this, 1, CrossTxState.NON_EXIST) as CrossTxState; } set state(value: CrossTxState) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { state?: CrossTxState; }): CrossState { const message = new CrossState({}); if (data.state != null) { message.state = data.state; } return message; } toObject() { const data: { state?: CrossTxState; } = {}; if (this.state != null) { data.state = this.state; } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); if (this.state != CrossTxState.NON_EXIST) writer.writeEnum(1, this.state); if (!w) return writer.getResultBuffer(); } static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CrossState { const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CrossState(); while (reader.nextField()) { if (reader.isEndGroup()) break; switch (reader.getFieldNumber()) { case 1: message.state = reader.readEnum(); break; default: reader.skipField(); } } return message; } serializeBinary(): Uint8Array { return this.serialize(); } static deserializeBinary(bytes: Uint8Array): CrossState { return CrossState.deserialize(bytes); } } }