From f51b31b954b8a164be7b97eadc835ff56f5787eb Mon Sep 17 00:00:00 2001 From: Isha Venikar <145848618+IshaVenikar@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:25:33 +0530 Subject: [PATCH] Remove message field from onboardParticipant message and add build workflow (#7) * Remove message field from onboardParticipant message * Add a workflow to run lint and build --------- Co-authored-by: Prathamesh Musale --- .gitea/workflows/on-pr.yaml | 23 +++++++++++++++++++++++ .github/workflows/on-pr.yaml | 23 +++++++++++++++++++++++ src/index.ts | 3 +-- src/laconic-client.ts | 4 +--- src/onboarding.test.ts | 3 +-- src/types/cerc/onboarding/message.ts | 1 - 6 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 .gitea/workflows/on-pr.yaml create mode 100644 .github/workflows/on-pr.yaml diff --git a/.gitea/workflows/on-pr.yaml b/.gitea/workflows/on-pr.yaml new file mode 100644 index 0000000..d9f3736 --- /dev/null +++ b/.gitea/workflows/on-pr.yaml @@ -0,0 +1,23 @@ +name: Lint & Build + +on: + pull_request: + +jobs: + lint_and_build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://npm.pkg.github.com' + - run: yarn + - name: Run lint + run: yarn lint + - name: Run build + run: yarn build diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml new file mode 100644 index 0000000..d9f3736 --- /dev/null +++ b/.github/workflows/on-pr.yaml @@ -0,0 +1,23 @@ +name: Lint & Build + +on: + pull_request: + +jobs: + lint_and_build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://npm.pkg.github.com' + - run: yarn + - name: Run lint + run: yarn lint + - name: Run build + run: yarn build diff --git a/src/index.ts b/src/index.ts index e94de8a..b3b128e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -440,7 +440,7 @@ export class Registry { /** * Onboard participant. */ - async onboardParticipant ({ ethPayload, ethSignature, message }: MessageMsgOnboardParticipant, privateKey: string, fee: StdFee): Promise { + async onboardParticipant ({ ethPayload, ethSignature }: MessageMsgOnboardParticipant, privateKey: string, fee: StdFee): Promise { const account = new Account(Buffer.from(privateKey, 'hex')); await account.init(); const laconicClient = await this.getLaconicClient(account); @@ -449,7 +449,6 @@ export class Registry { account.address, ethPayload, ethSignature, - message, fee ); } diff --git a/src/laconic-client.ts b/src/laconic-client.ts index 3afa6d4..ec57184 100644 --- a/src/laconic-client.ts +++ b/src/laconic-client.ts @@ -394,7 +394,6 @@ export class LaconicClient extends SigningStargateClient { signer: string, ethPayload: EthPayload, ethSignature: string, - message: string, fee: StdFee | 'auto' | number, memo = '' ) { @@ -403,8 +402,7 @@ export class LaconicClient extends SigningStargateClient { value: { participant: signer, ethPayload, - ethSignature, - message + ethSignature } }; diff --git a/src/onboarding.test.ts b/src/onboarding.test.ts index ea8f1f1..4876112 100644 --- a/src/onboarding.test.ts +++ b/src/onboarding.test.ts @@ -31,8 +31,7 @@ const onboardingTests = () => { await registry.onboardParticipant({ ethPayload, - ethSignature, - message: 'Message signed by cosmos private key' + ethSignature }, privateKey, fee); }); diff --git a/src/types/cerc/onboarding/message.ts b/src/types/cerc/onboarding/message.ts index 567da37..edbeccf 100644 --- a/src/types/cerc/onboarding/message.ts +++ b/src/types/cerc/onboarding/message.ts @@ -23,5 +23,4 @@ interface ethPayload { export interface MessageMsgOnboardParticipant { ethPayload: ethPayload ethSignature: string - message: string }