-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cosmic-proto): codegen for agoric protos (#9645)
## Description - `swing_store_export_data_hash` added to `agoric/swingset/genesis.proto` - vlocalchain genesis state added via `agoric/vtransfer/genesis.proto`
- Loading branch information
Showing
16 changed files
with
301 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/cosmic-proto/proto/agoric/vtransfer/genesis.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
syntax = "proto3"; | ||
package agoric.vtransfer; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/vtransfer/types"; | ||
|
||
// The initial and exported module state. | ||
message GenesisState { | ||
option (gogoproto.equal) = false; | ||
|
||
// The list of account addresses that are being watched by the VM. | ||
repeated bytes watched_addresses = 1 [ | ||
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", | ||
(gogoproto.jsontag) = "watched_addresses", | ||
(gogoproto.moretags) = "yaml:\"watched_addresses\"" | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
packages/cosmic-proto/src/codegen/agoric/vtransfer/genesis.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
//@ts-nocheck | ||
import { BinaryReader, BinaryWriter } from '../../binary.js'; | ||
import { bytesFromBase64, base64FromBytes } from '../../helpers.js'; | ||
import { JsonSafe } from '../../json-safe.js'; | ||
/** The initial and exported module state. */ | ||
export interface GenesisState { | ||
/** The list of account addresses that are being watched by the VM. */ | ||
watchedAddresses: Uint8Array[]; | ||
} | ||
export interface GenesisStateProtoMsg { | ||
typeUrl: '/agoric.vtransfer.GenesisState'; | ||
value: Uint8Array; | ||
} | ||
/** The initial and exported module state. */ | ||
export interface GenesisStateSDKType { | ||
watched_addresses: Uint8Array[]; | ||
} | ||
function createBaseGenesisState(): GenesisState { | ||
return { | ||
watchedAddresses: [], | ||
}; | ||
} | ||
export const GenesisState = { | ||
typeUrl: '/agoric.vtransfer.GenesisState', | ||
encode( | ||
message: GenesisState, | ||
writer: BinaryWriter = BinaryWriter.create(), | ||
): BinaryWriter { | ||
for (const v of message.watchedAddresses) { | ||
writer.uint32(10).bytes(v!); | ||
} | ||
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.watchedAddresses.push(reader.bytes()); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromJSON(object: any): GenesisState { | ||
return { | ||
watchedAddresses: Array.isArray(object?.watchedAddresses) | ||
? object.watchedAddresses.map((e: any) => bytesFromBase64(e)) | ||
: [], | ||
}; | ||
}, | ||
toJSON(message: GenesisState): JsonSafe<GenesisState> { | ||
const obj: any = {}; | ||
if (message.watchedAddresses) { | ||
obj.watchedAddresses = message.watchedAddresses.map(e => | ||
base64FromBytes(e !== undefined ? e : new Uint8Array()), | ||
); | ||
} else { | ||
obj.watchedAddresses = []; | ||
} | ||
return obj; | ||
}, | ||
fromPartial(object: Partial<GenesisState>): GenesisState { | ||
const message = createBaseGenesisState(); | ||
message.watchedAddresses = object.watchedAddresses?.map(e => e) || []; | ||
return message; | ||
}, | ||
fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { | ||
return GenesisState.decode(message.value); | ||
}, | ||
toProto(message: GenesisState): Uint8Array { | ||
return GenesisState.encode(message).finish(); | ||
}, | ||
toProtoMsg(message: GenesisState): GenesisStateProtoMsg { | ||
return { | ||
typeUrl: '/agoric.vtransfer.GenesisState', | ||
value: GenesisState.encode(message).finish(), | ||
}; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//@ts-nocheck | ||
import * as _15 from './amino.js'; | ||
import * as _16 from './amino.js'; | ||
export const amino = { | ||
..._15, | ||
..._16, | ||
}; |
Oops, something went wrong.