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. * 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')); const account = new Account(Buffer.from(privateKey, 'hex'));
await account.init(); await account.init();
const laconicClient = await this.getLaconicClient(account); const laconicClient = await this.getLaconicClient(account);
@ -449,7 +449,6 @@ export class Registry {
account.address, account.address,
ethPayload, ethPayload,
ethSignature, ethSignature,
message,
fee fee
); );
} }

View File

@ -394,7 +394,6 @@ export class LaconicClient extends SigningStargateClient {
signer: string, signer: string,
ethPayload: EthPayload, ethPayload: EthPayload,
ethSignature: string, ethSignature: string,
message: string,
fee: StdFee | 'auto' | number, fee: StdFee | 'auto' | number,
memo = '' memo = ''
) { ) {
@ -403,8 +402,7 @@ export class LaconicClient extends SigningStargateClient {
value: { value: {
participant: signer, participant: signer,
ethPayload, ethPayload,
ethSignature, ethSignature
message
} }
}; };

View File

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

View File

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