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
6 changed files with 49 additions and 8 deletions
Showing only changes of commit f51b31b954 - Show all commits

View File

@ -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

23
.github/workflows/on-pr.yaml vendored Normal file
View File

@ -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

View File

@ -440,7 +440,7 @@ export class Registry {
/**
* Onboard participant.
*/
async onboardParticipant ({ ethPayload, ethSignature, message }: MessageMsgOnboardParticipant, privateKey: string, fee: StdFee): Promise<MsgOnboardParticipantResponse> {
async onboardParticipant ({ ethPayload, ethSignature }: MessageMsgOnboardParticipant, privateKey: string, fee: StdFee): Promise<MsgOnboardParticipantResponse> {
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
);
}

View File

@ -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
}
};

View File

@ -31,8 +31,7 @@ const onboardingTests = () => {
await registry.onboardParticipant({
ethPayload,
ethSignature,
message: 'Message signed by cosmos private key'
ethSignature
}, privateKey, fee);
});

View File

@ -23,5 +23,4 @@ interface ethPayload {
export interface MessageMsgOnboardParticipant {
ethPayload: ethPayload
ethSignature: string
message: string
}