From b44cc00b7b83a54f7c074a5155170d6343f6272c Mon Sep 17 00:00:00 2001 From: Isha Venikar <145848618+IshaVenikar@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:14:38 +0530 Subject: [PATCH] Rename `ethereum_address` to `nitro_address` in onboarding module (#10) * Rename ethereum_address to nitro_address * Use camel case for variables in query fields * Replace snake case with camel case --- proto/cerc/onboarding/v1/onboarding.proto | 4 ++-- src/onboarding.test.ts | 4 ++-- src/proto/cerc/onboarding/v1/onboarding.ts | 20 ++++++++--------- src/registry-client.ts | 26 +++++++++++----------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/proto/cerc/onboarding/v1/onboarding.proto b/proto/cerc/onboarding/v1/onboarding.proto index 876cc7e..cda954a 100644 --- a/proto/cerc/onboarding/v1/onboarding.proto +++ b/proto/cerc/onboarding/v1/onboarding.proto @@ -19,8 +19,8 @@ message Participant { (gogoproto.moretags) = "json:\"cosmos_address\" yaml:\"cosmos_address\"" ]; - string ethereum_address = 2 [ - (gogoproto.moretags) = "json:\"ethereum_address\" yaml:\"ethereum_address\"" + string nitro_address = 2 [ + (gogoproto.moretags) = "json:\"nitro_address\" yaml:\"nitro_address\"" ]; } // EthPayload defines the payload that is signed by the ethereum private key diff --git a/src/onboarding.test.ts b/src/onboarding.test.ts index 772f81b..81144e5 100644 --- a/src/onboarding.test.ts +++ b/src/onboarding.test.ts @@ -43,8 +43,8 @@ const onboardingEnabledTests = () => { const expectedParticipants = [ { - cosmos_address: cosmosWallet.address, - ethereum_address: ethWallet.address + cosmosAddress: cosmosWallet.address, + nitroAddress: ethWallet.address } ]; const participants = await registry.getParticipants(); diff --git a/src/proto/cerc/onboarding/v1/onboarding.ts b/src/proto/cerc/onboarding/v1/onboarding.ts index 9c514e6..445b4cf 100644 --- a/src/proto/cerc/onboarding/v1/onboarding.ts +++ b/src/proto/cerc/onboarding/v1/onboarding.ts @@ -12,7 +12,7 @@ export interface Params { /** Participant defines the data that will be stored for each enrolled participant */ export interface Participant { cosmosAddress: string; - ethereumAddress: string; + nitroAddress: string; } /** EthPayload defines the payload that is signed by the ethereum private key */ @@ -77,7 +77,7 @@ export const Params = { }; function createBaseParticipant(): Participant { - return { cosmosAddress: "", ethereumAddress: "" }; + return { cosmosAddress: "", nitroAddress: "" }; } export const Participant = { @@ -88,8 +88,8 @@ export const Participant = { if (message.cosmosAddress !== "") { writer.uint32(10).string(message.cosmosAddress); } - if (message.ethereumAddress !== "") { - writer.uint32(18).string(message.ethereumAddress); + if (message.nitroAddress !== "") { + writer.uint32(18).string(message.nitroAddress); } return writer; }, @@ -105,7 +105,7 @@ export const Participant = { message.cosmosAddress = reader.string(); break; case 2: - message.ethereumAddress = reader.string(); + message.nitroAddress = reader.string(); break; default: reader.skipType(tag & 7); @@ -120,8 +120,8 @@ export const Participant = { cosmosAddress: isSet(object.cosmosAddress) ? String(object.cosmosAddress) : "", - ethereumAddress: isSet(object.ethereumAddress) - ? String(object.ethereumAddress) + nitroAddress: isSet(object.nitroAddress) + ? String(object.nitroAddress) : "", }; }, @@ -130,8 +130,8 @@ export const Participant = { const obj: any = {}; message.cosmosAddress !== undefined && (obj.cosmosAddress = message.cosmosAddress); - message.ethereumAddress !== undefined && - (obj.ethereumAddress = message.ethereumAddress); + message.nitroAddress !== undefined && + (obj.nitroAddress = message.nitroAddress); return obj; }, @@ -140,7 +140,7 @@ export const Participant = { ): Participant { const message = createBaseParticipant(); message.cosmosAddress = object.cosmosAddress ?? ""; - message.ethereumAddress = object.ethereumAddress ?? ""; + message.nitroAddress = object.nitroAddress ?? ""; return message; }, }; diff --git a/src/registry-client.ts b/src/registry-client.ts index 4d2caef..bf28a75 100644 --- a/src/registry-client.ts +++ b/src/registry-client.ts @@ -151,31 +151,31 @@ export class RegistryClient { moniker } sync { - latest_block_hash - latest_block_height - latest_block_time - catching_up + latestBlockHash + latestBlockHeight + latestBlockTime + catchingUp } validator { address - voting_power + votingPower } validators { address - voting_power - proposer_priority + votingPower + proposerPriority } - num_peers + numPeers peers { node { id network moniker } - is_outbound - remote_ip + isOutbound + remoteIp } - disk_usage + diskUsage } }`; @@ -424,8 +424,8 @@ export class RegistryClient { async getParticipants () { const query = `query { getParticipants { - cosmos_address - ethereum_address + cosmosAddress + nitroAddress } }`;