Add types and methods for participants onboarding module #12
23
.gitea/workflows/on-pr.yaml
Normal file
23
.gitea/workflows/on-pr.yaml
Normal 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
23
.github/workflows/on-pr.yaml
vendored
Normal 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
|
@ -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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -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
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -23,5 +23,4 @@ interface ethPayload {
|
|||||||
export interface MessageMsgOnboardParticipant {
|
export interface MessageMsgOnboardParticipant {
|
||||||
ethPayload: ethPayload
|
ethPayload: ethPayload
|
||||||
ethSignature: string
|
ethSignature: string
|
||||||
message: string
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user