-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
583dfac
commit 59f62a3
Showing
13 changed files
with
131 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export * from './rest'; | ||
export * from './websocket'; | ||
export * from './proto'; | ||
export * as proto from './proto'; | ||
export * as cosmosclient from './module'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
import * as crypto from 'crypto'; | ||
import { cosmosclient } from '../..'; | ||
import { cosmosclient, proto } from '../..'; | ||
import { setBech32Prefix } from './config'; | ||
|
||
describe('address', () => { | ||
it('prefix', async () => { | ||
expect.hasAssertions(); | ||
|
||
setBech32Prefix({ | ||
accAddr: "jpyx", | ||
accPub: "jpyxpub", | ||
valAddr: "jpyxvaloper", | ||
valPub: "jpyxvaloperpub", | ||
consAddr: "jpyxvalcons", | ||
consPub: "jpyxvalconspub", | ||
accAddr: 'jpyx', | ||
accPub: 'jpyxpub', | ||
valAddr: 'jpyxvaloper', | ||
valPub: 'jpyxvaloperpub', | ||
consAddr: 'jpyxvalcons', | ||
consPub: 'jpyxvalconspub', | ||
}); | ||
const privKey = new cosmosclient.secp256k1.PrivKey({ | ||
const privKey = new proto.cosmos.crypto.secp256k1.PrivKey({ | ||
key: await cosmosclient.generatePrivKeyFromMnemonic('joke door law post fragile cruel torch silver siren mechanic flush surround'), | ||
}); | ||
const pubKey = privKey.pubKey(); | ||
const address = cosmosclient.AccAddress.fromPublicKey(pubKey); | ||
|
||
expect(address.toString().startsWith("jpyx")).toBeTruthy(); | ||
expect(address.toString().startsWith('jpyx')).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import { codec } from '../codec'; | ||
import * as ed25519 from './ed25519'; | ||
import * as secp256k1 from './secp256k1'; | ||
import { cosmos } from '../../proto'; | ||
import './ed25519'; | ||
import './secp256k1'; | ||
|
||
export * from './key'; | ||
export * as ed25519 from './ed25519'; | ||
export * as secp256k1 from './secp256k1'; | ||
|
||
codec.register('/cosmos.crypto.ed25519.PrivKey', ed25519.PrivKey); | ||
codec.register('/cosmos.crypto.ed25519.PubKey', ed25519.PubKey); | ||
codec.register('/cosmos.crypto.secp256k1.PrivKey', secp256k1.PrivKey); | ||
codec.register('/cosmos.crypto.secp256k1.PubKey', secp256k1.PubKey); | ||
codec.register('/cosmos.crypto.ed25519.PrivKey', cosmos.crypto.ed25519.PrivKey); | ||
codec.register('/cosmos.crypto.ed25519.PubKey', cosmos.crypto.ed25519.PubKey); | ||
codec.register('/cosmos.crypto.secp256k1.PrivKey', cosmos.crypto.secp256k1.PrivKey); | ||
codec.register('/cosmos.crypto.secp256k1.PubKey', cosmos.crypto.secp256k1.PubKey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.