Add types and methods for participants onboarding module #12

Merged
ashwin merged 9 commits from testnet-onboarding into main 2024-07-16 08:33:42 +00:00
4 changed files with 27 additions and 27 deletions
Showing only changes of commit b44cc00b7b - Show all commits
proto/cerc/onboarding/v1
src

View File

@ -19,8 +19,8 @@ message Participant {
(gogoproto.moretags) = "json:\"cosmos_address\" yaml:\"cosmos_address\"" (gogoproto.moretags) = "json:\"cosmos_address\" yaml:\"cosmos_address\""
]; ];
string ethereum_address = 2 [ string nitro_address = 2 [
(gogoproto.moretags) = "json:\"ethereum_address\" yaml:\"ethereum_address\"" (gogoproto.moretags) = "json:\"nitro_address\" yaml:\"nitro_address\""
]; ];
} }
// EthPayload defines the payload that is signed by the ethereum private key // EthPayload defines the payload that is signed by the ethereum private key

View File

@ -43,8 +43,8 @@ const onboardingEnabledTests = () => {
const expectedParticipants = [ const expectedParticipants = [
{ {
cosmos_address: cosmosWallet.address, cosmosAddress: cosmosWallet.address,
ethereum_address: ethWallet.address nitroAddress: ethWallet.address
} }
]; ];
const participants = await registry.getParticipants(); const participants = await registry.getParticipants();

View File

@ -12,7 +12,7 @@ export interface Params {
/** Participant defines the data that will be stored for each enrolled participant */ /** Participant defines the data that will be stored for each enrolled participant */
export interface Participant { export interface Participant {
cosmosAddress: string; cosmosAddress: string;
ethereumAddress: string; nitroAddress: string;
} }
/** EthPayload defines the payload that is signed by the ethereum private key */ /** EthPayload defines the payload that is signed by the ethereum private key */
@ -77,7 +77,7 @@ export const Params = {
}; };
function createBaseParticipant(): Participant { function createBaseParticipant(): Participant {
return { cosmosAddress: "", ethereumAddress: "" }; return { cosmosAddress: "", nitroAddress: "" };
} }
export const Participant = { export const Participant = {
@ -88,8 +88,8 @@ export const Participant = {
if (message.cosmosAddress !== "") { if (message.cosmosAddress !== "") {
writer.uint32(10).string(message.cosmosAddress); writer.uint32(10).string(message.cosmosAddress);
} }
if (message.ethereumAddress !== "") { if (message.nitroAddress !== "") {
writer.uint32(18).string(message.ethereumAddress); writer.uint32(18).string(message.nitroAddress);
} }
return writer; return writer;
}, },
@ -105,7 +105,7 @@ export const Participant = {
message.cosmosAddress = reader.string(); message.cosmosAddress = reader.string();
break; break;
case 2: case 2:
message.ethereumAddress = reader.string(); message.nitroAddress = reader.string();
break; break;
default: default:
reader.skipType(tag & 7); reader.skipType(tag & 7);
@ -120,8 +120,8 @@ export const Participant = {
cosmosAddress: isSet(object.cosmosAddress) cosmosAddress: isSet(object.cosmosAddress)
? String(object.cosmosAddress) ? String(object.cosmosAddress)
: "", : "",
ethereumAddress: isSet(object.ethereumAddress) nitroAddress: isSet(object.nitroAddress)
? String(object.ethereumAddress) ? String(object.nitroAddress)
: "", : "",
}; };
}, },
@ -130,8 +130,8 @@ export const Participant = {
const obj: any = {}; const obj: any = {};
message.cosmosAddress !== undefined && message.cosmosAddress !== undefined &&
(obj.cosmosAddress = message.cosmosAddress); (obj.cosmosAddress = message.cosmosAddress);
message.ethereumAddress !== undefined && message.nitroAddress !== undefined &&
(obj.ethereumAddress = message.ethereumAddress); (obj.nitroAddress = message.nitroAddress);
return obj; return obj;
}, },
@ -140,7 +140,7 @@ export const Participant = {
): Participant { ): Participant {
const message = createBaseParticipant(); const message = createBaseParticipant();
message.cosmosAddress = object.cosmosAddress ?? ""; message.cosmosAddress = object.cosmosAddress ?? "";
message.ethereumAddress = object.ethereumAddress ?? ""; message.nitroAddress = object.nitroAddress ?? "";
return message; return message;
}, },
}; };

View File

@ -151,31 +151,31 @@ export class RegistryClient {
moniker moniker
} }
sync { sync {
latest_block_hash latestBlockHash
latest_block_height latestBlockHeight
latest_block_time latestBlockTime
catching_up catchingUp
} }
validator { validator {
address address
voting_power votingPower
} }
validators { validators {
address address
voting_power votingPower
proposer_priority proposerPriority
} }
num_peers numPeers
peers { peers {
node { node {
id id
network network
moniker moniker
} }
is_outbound isOutbound
remote_ip remoteIp
} }
disk_usage diskUsage
} }
}`; }`;
@ -424,8 +424,8 @@ export class RegistryClient {
async getParticipants () { async getParticipants () {
const query = `query { const query = `query {
getParticipants { getParticipants {
cosmos_address cosmosAddress
ethereum_address nitroAddress
} }
}`; }`;