/* eslint-disable */ import { Params, State } from "./evm"; import Long from "long"; import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "ethermint.evm.v1"; /** GenesisState defines the evm module's genesis state. */ export interface GenesisState { /** accounts is an array containing the ethereum genesis accounts. */ accounts: GenesisAccount[]; /** params defines all the parameters of the module. */ params?: Params; } /** * GenesisAccount defines an account to be initialized in the genesis state. * Its main difference between with Geth's GenesisAccount is that it uses a * custom storage type and that it doesn't contain the private key field. */ export interface GenesisAccount { /** address defines an ethereum hex formated address of an account */ address: string; /** code defines the hex bytes of the account code. */ code: string; /** storage defines the set of state key values for the account. */ storage: State[]; } function createBaseGenesisState(): GenesisState { return { accounts: [], params: undefined }; } export const GenesisState = { encode( message: GenesisState, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { for (const v of message.accounts) { GenesisAccount.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.params !== undefined) { Params.encode(message.params, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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.accounts.push(GenesisAccount.decode(reader, reader.uint32())); break; case 2: message.params = Params.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GenesisState { return { accounts: Array.isArray(object?.accounts) ? object.accounts.map((e: any) => GenesisAccount.fromJSON(e)) : [], params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, }; }, toJSON(message: GenesisState): unknown { const obj: any = {}; if (message.accounts) { obj.accounts = message.accounts.map((e) => e ? GenesisAccount.toJSON(e) : undefined ); } else { obj.accounts = []; } message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, fromPartial, I>>( object: I ): GenesisState { const message = createBaseGenesisState(); message.accounts = object.accounts?.map((e) => GenesisAccount.fromPartial(e)) || []; message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, }; function createBaseGenesisAccount(): GenesisAccount { return { address: "", code: "", storage: [] }; } export const GenesisAccount = { encode( message: GenesisAccount, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.code !== "") { writer.uint32(18).string(message.code); } for (const v of message.storage) { State.encode(v!, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GenesisAccount { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.address = reader.string(); break; case 2: message.code = reader.string(); break; case 3: message.storage.push(State.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): GenesisAccount { return { address: isSet(object.address) ? String(object.address) : "", code: isSet(object.code) ? String(object.code) : "", storage: Array.isArray(object?.storage) ? object.storage.map((e: any) => State.fromJSON(e)) : [], }; }, toJSON(message: GenesisAccount): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); message.code !== undefined && (obj.code = message.code); if (message.storage) { obj.storage = message.storage.map((e) => e ? State.toJSON(e) : undefined ); } else { obj.storage = []; } return obj; }, fromPartial, I>>( object: I ): GenesisAccount { const message = createBaseGenesisAccount(); message.address = object.address ?? ""; message.code = object.code ?? ""; message.storage = object.storage?.map((e) => State.fromPartial(e)) || []; return message; }, }; type Builtin = | Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & Record< Exclude>, never >; // If you get a compile-error about 'Constructor and ... have no overlap', // add '--ts_proto_opt=esModuleInterop=true' as a flag when calling 'protoc'. if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } function isSet(value: any): boolean { return value !== null && value !== undefined; }