Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test cosmjs extension #477

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

skylinezum
Copy link

  • Able to run staking.test.ts,
  • Modified cosmjs-extension's main-wallet.ts to bypass the window environment

@@ -0,0 +1,40 @@
# @cosmos-kit/leap-extension
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should read cosmjs-extension


async getAccount(chainId: string) {
// const key = await this.client.getKey(chainId);
const mnemonic = this.generateMnemonic();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems that it would be non-deterministic — shouldn't the client somehow have a reference to the mnemonic? and we create it in the test itself?

- clean up readme for cosmjs-extension
- allow passsing in an optional mnemonic or let it generate by default.
- .yarn.lock
- 'nock'; remove ;
- clean up readme for cosmjs-extension
- allow passsing in an optional mnemonic or let it generate by default.
- fix merge conflicts
Copy link
Author

@skylinezum skylinezum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +53 to +55
"starship:deploy": "starship deploy --config ./starship/starship.yaml",
"starship:ports": "starship start-ports --config ./starship/starship.yaml",
"starship:teardown": "starship teardown --config ./starship/starship.yaml",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these lines

Comment on lines +95 to +96
"@starship-ci/cli": "1.9.0",
"starshipjs": "^1.4.0",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upgrade to starship@latest

Comment on lines +7 to +22
yarn starship setup

# sanity check
yarn starship get-pods

# deploy starship
yarn starship deploy

# wait til STATUS=Running
yarn starship get-pods

# port forwarding
yarn starship start-ports

# check pids
yarn starship port-pids
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with yarn starship start

Comment on lines +36 to +42
```sh
# stop port forwarding (done by clean() too)
# yarn starship stop-ports

# stop ports and delete & remove helm chart
yarn starship clean
```
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with yarn starship stop

# stop ports and delete & remove helm chart
yarn starship clean
```

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Advanced Documentation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check latest docs in starship repo

signer: string,
data: string | Uint8Array,
): Promise<StdSignature> {
return await this.client.signArbitrary(chainId, signer, data);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signArbitrary may not exist

import Long from 'long';

export class CosmjsClient implements WalletClient {
readonly client: Cosmjs;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment:

warning: CosmjsClient is for testing only! Mnemonic is gettable.

prettyName: 'Cosmjs',
logo: ICON,
mode: 'extension',
mobileDisabled: () => !('cosmjs' in window || /CosmjsCosmos/i.test(navigator.userAgent)),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set to true

prettyName: 'Cosmjs',
logo: ICON,
mode: 'extension',
mobileDisabled: () => !('cosmjs' in window || /CosmjsCosmos/i.test(navigator.userAgent)),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pyramation @theothersideofgod isInstalled maybe add this method here.

Comment on lines +55 to +59
"dependencies": {
"@cosmos-kit/leap-extension": "^2.9.0",
"@cosmos-kit/leap-metamask-cosmos-snap": "^0.8.0",
"@cosmos-kit/leap-mobile": "^2.8.0"
},
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@skylinezum
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants