//@ts-nocheck
import { BinaryReader, BinaryWriter } from "../../../binary";
import { isSet } from "../../../helpers";
import { JsonSafe } from "../../../json-safe";
import { GlobalDecoderRegistry } from "../../../registry";
/** GenesisState - initial state of module */
export interface GenesisState {
/** Params of this module */
params: Params;
}
export interface GenesisStateProtoMsg {
typeUrl: "/cyber.clock.v1.GenesisState";
value: Uint8Array;
}
/** GenesisState - initial state of module */
export interface GenesisStateAmino {
/** Params of this module */
params?: ParamsAmino;
}
export interface GenesisStateAminoMsg {
type: "/cyber.clock.v1.GenesisState";
value: GenesisStateAmino;
}
/** GenesisState - initial state of module */
export interface GenesisStateSDKType {
params: ParamsSDKType;
}
/** Params defines the set of module parameters. */
export interface Params {
/**
* contract_gas_limit defines the maximum amount of gas that can be used by a
* contract.
*/
contractGasLimit: bigint;
}
export interface ParamsProtoMsg {
typeUrl: "/cyber.clock.v1.Params";
value: Uint8Array;
}
/** Params defines the set of module parameters. */
export interface ParamsAmino {
/**
* contract_gas_limit defines the maximum amount of gas that can be used by a
* contract.
*/
contract_gas_limit?: string;
}
export interface ParamsAminoMsg {
type: "/cyber.clock.v1.Params";
value: ParamsAmino;
}
/** Params defines the set of module parameters. */
export interface ParamsSDKType {
contract_gas_limit: bigint;
}
function createBaseGenesisState(): GenesisState {
return {
params: Params.fromPartial({})
};
}
export const GenesisState = {
typeUrl: "/cyber.clock.v1.GenesisState",
is(o: any): o is GenesisState {
return o && (o.$typeUrl === GenesisState.typeUrl || Params.is(o.params));
},
isSDK(o: any): o is GenesisStateSDKType {
return o && (o.$typeUrl === GenesisState.typeUrl || Params.isSDK(o.params));
},
isAmino(o: any): o is GenesisStateAmino {
return o && (o.$typeUrl === GenesisState.typeUrl || Params.isAmino(o.params));
},
encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.params !== undefined) {
Params.encode(message.params, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): GenesisState {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGenesisState();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.params = Params.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): GenesisState {
return {
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined
};
},
toJSON(message: GenesisState): JsonSafe<GenesisState> {
const obj: any = {};
message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
return obj;
},
fromPartial(object: Partial<GenesisState>): GenesisState {
const message = createBaseGenesisState();
message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined;
return message;
},
fromAmino(object: GenesisStateAmino): GenesisState {
const message = createBaseGenesisState();
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromAmino(object.params);
}
return message;
},
toAmino(message: GenesisState): GenesisStateAmino {
const obj: any = {};
obj.params = message.params ? Params.toAmino(message.params) : undefined;
return obj;
},
fromAminoMsg(object: GenesisStateAminoMsg): GenesisState {
return GenesisState.fromAmino(object.value);
},
fromProtoMsg(message: GenesisStateProtoMsg): GenesisState {
return GenesisState.decode(message.value);
},
toProto(message: GenesisState): Uint8Array {
return GenesisState.encode(message).finish();
},
toProtoMsg(message: GenesisState): GenesisStateProtoMsg {
return {
typeUrl: "/cyber.clock.v1.GenesisState",
value: GenesisState.encode(message).finish()
};
}
};
GlobalDecoderRegistry.register(GenesisState.typeUrl, GenesisState);
function createBaseParams(): Params {
return {
contractGasLimit: BigInt(0)
};
}
export const Params = {
typeUrl: "/cyber.clock.v1.Params",
is(o: any): o is Params {
return o && (o.$typeUrl === Params.typeUrl || typeof o.contractGasLimit === "bigint");
},
isSDK(o: any): o is ParamsSDKType {
return o && (o.$typeUrl === Params.typeUrl || typeof o.contract_gas_limit === "bigint");
},
isAmino(o: any): o is ParamsAmino {
return o && (o.$typeUrl === Params.typeUrl || typeof o.contract_gas_limit === "bigint");
},
encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.contractGasLimit !== BigInt(0)) {
writer.uint32(8).uint64(message.contractGasLimit);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Params {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseParams();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.contractGasLimit = reader.uint64();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): Params {
return {
contractGasLimit: isSet(object.contractGasLimit) ? BigInt(object.contractGasLimit.toString()) : BigInt(0)
};
},
toJSON(message: Params): JsonSafe<Params> {
const obj: any = {};
message.contractGasLimit !== undefined && (obj.contractGasLimit = (message.contractGasLimit || BigInt(0)).toString());
return obj;
},
fromPartial(object: Partial<Params>): Params {
const message = createBaseParams();
message.contractGasLimit = object.contractGasLimit !== undefined && object.contractGasLimit !== null ? BigInt(object.contractGasLimit.toString()) : BigInt(0);
return message;
},
fromAmino(object: ParamsAmino): Params {
const message = createBaseParams();
if (object.contract_gas_limit !== undefined && object.contract_gas_limit !== null) {
message.contractGasLimit = BigInt(object.contract_gas_limit);
}
return message;
},
toAmino(message: Params): ParamsAmino {
const obj: any = {};
obj.contract_gas_limit = message.contractGasLimit !== BigInt(0) ? message.contractGasLimit.toString() : undefined;
return obj;
},
fromAminoMsg(object: ParamsAminoMsg): Params {
return Params.fromAmino(object.value);
},
fromProtoMsg(message: ParamsProtoMsg): Params {
return Params.decode(message.value);
},
toProto(message: Params): Uint8Array {
return Params.encode(message).finish();
},
toProtoMsg(message: Params): ParamsProtoMsg {
return {
typeUrl: "/cyber.clock.v1.Params",
value: Params.encode(message).finish()
};
}
};
GlobalDecoderRegistry.register(Params.typeUrl, Params);