Use @cosmjs/crypto in this project

This commit is contained in:
Simon Warta 2020-06-09 17:39:36 +02:00
parent 3bf3f45677
commit 92417373cd
26 changed files with 41 additions and 41 deletions

View File

@ -39,9 +39,9 @@
"pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js"
},
"dependencies": {
"@cosmjs/crypto": "^0.8.0",
"@cosmjs/sdk38": "^0.8.0",
"@iov/bcp": "^2.3.2",
"@iov/crypto": "^2.3.2",
"@iov/encoding": "^2.3.2",
"@iov/stream": "^2.3.2",
"@iov/utils": "^2.3.2",

View File

@ -1,6 +1,6 @@
import { Secp256k1 } from "@cosmjs/crypto";
import { PubKey, pubkeyToAddress as sdkPubkeyToAddress, pubkeyType } from "@cosmjs/sdk38";
import { Address, Algorithm, PubkeyBundle } from "@iov/bcp";
import { Secp256k1 } from "@iov/crypto";
import { toBase64 } from "@iov/encoding";
// See https://github.com/tendermint/tendermint/blob/f2ada0a604b4c0763bda2f64fac53d506d3beca7/docs/spec/blockchain/encoding.md#public-key-cryptography

View File

@ -1,5 +1,5 @@
import { Sha256 } from "@cosmjs/crypto";
import { ChainId } from "@iov/bcp";
import { Sha256 } from "@iov/crypto";
import { toHex, toUtf8 } from "@iov/encoding";
const hashedPrefix = "hashed-";

View File

@ -1,3 +1,4 @@
import { Random, Secp256k1, Secp256k1Signature, Sha256 } from "@cosmjs/crypto";
import { decodeSignature } from "@cosmjs/sdk38";
import {
Account,
@ -17,7 +18,6 @@ import {
TransactionState,
UnsignedTransaction,
} from "@iov/bcp";
import { Random, Secp256k1, Secp256k1Signature, Sha256 } from "@iov/crypto";
import { Bech32, fromBase64 } from "@iov/encoding";
import { HdPaths, Secp256k1HdWallet, UserProfile } from "@iov/keycontrol";
import { assert } from "@iov/utils";

View File

@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/camelcase */
import { Secp256k1 } from "@cosmjs/crypto";
import {
Coin,
CosmosSdkTx,
@ -19,7 +20,6 @@ import {
SignedTransaction,
UnsignedTransaction,
} from "@iov/bcp";
import { Secp256k1 } from "@iov/crypto";
import { toBase64 } from "@iov/encoding";
import { BankToken } from "./types";

View File

@ -39,8 +39,8 @@
],
"dependencies": {
"@cosmjs/cosmwasm": "^0.8.0",
"@cosmjs/crypto": "^0.8.0",
"@cosmjs/sdk38": "^0.8.0",
"@iov/crypto": "^2.3.2",
"@iov/encoding": "^2.3.2",
"@iov/utils": "^2.3.2",
"axios": "^0.19.2",

View File

@ -59,6 +59,22 @@ export function main(originalArgs: readonly string[]): void {
"UploadResult",
],
],
[
"@cosmjs/crypto",
[
"Bip39",
"Ed25519",
"Ed25519Keypair",
"EnglishMnemonic",
"Random",
"Secp256k1",
"Sha256",
"Sha512",
"Slip10",
"Slip10Curve",
"Slip10RawIndex",
],
],
[
"@cosmjs/sdk38",
[
@ -82,22 +98,6 @@ export function main(originalArgs: readonly string[]): void {
"StdTx",
],
],
[
"@iov/crypto",
[
"Bip39",
"Ed25519",
"Ed25519Keypair",
"EnglishMnemonic",
"Random",
"Secp256k1",
"Sha256",
"Sha512",
"Slip10",
"Slip10Curve",
"Slip10RawIndex",
],
],
[
"@iov/encoding",
[

View File

@ -36,8 +36,8 @@
"pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js"
},
"dependencies": {
"@cosmjs/crypto": "^0.8.0",
"@cosmjs/sdk38": "^0.8.0",
"@iov/crypto": "^2.3.2",
"@iov/encoding": "^2.3.2",
"@iov/utils": "^2.3.2",
"axios": "^0.19.0",

View File

@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/camelcase */
import { Sha256 } from "@cosmjs/crypto";
import { makeSignBytes, MsgSend, Secp256k1Pen, StdFee } from "@cosmjs/sdk38";
import { Sha256 } from "@iov/crypto";
import { Bech32, fromHex, fromUtf8, toAscii, toBase64 } from "@iov/encoding";
import { assert, sleep } from "@iov/utils";
import { ReadonlyDate } from "readonly-date";

View File

@ -1,3 +1,4 @@
import { Sha256 } from "@cosmjs/crypto";
import {
BroadcastMode,
Coin,
@ -7,7 +8,6 @@ import {
PubKey,
StdTx,
} from "@cosmjs/sdk38";
import { Sha256 } from "@iov/crypto";
import { fromBase64, fromHex, toHex } from "@iov/encoding";
import { Log, parseLogs } from "./logs";

View File

@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/camelcase */
import { Sha256 } from "@cosmjs/crypto";
import {
Coin,
encodeBech32Pubkey,
@ -14,7 +15,6 @@ import {
StdSignature,
StdTx,
} from "@cosmjs/sdk38";
import { Sha256 } from "@iov/crypto";
import { Bech32, fromAscii, fromBase64, fromHex, toAscii, toBase64, toHex } from "@iov/encoding";
import { assert, sleep } from "@iov/utils";
import { ReadonlyDate } from "readonly-date";

View File

@ -1,5 +1,5 @@
import { Sha256 } from "@cosmjs/crypto";
import { Coin, Secp256k1Pen } from "@cosmjs/sdk38";
import { Sha256 } from "@iov/crypto";
import { toHex } from "@iov/encoding";
import { assert } from "@iov/utils";

View File

@ -1,5 +1,5 @@
import { Sha256 } from "@cosmjs/crypto";
import { BroadcastMode, Coin, coins, makeSignBytes, MsgSend, StdFee, StdSignature } from "@cosmjs/sdk38";
import { Sha256 } from "@iov/crypto";
import { toBase64, toHex } from "@iov/encoding";
import pako from "pako";

View File

@ -1,4 +1,4 @@
import { Random } from "@iov/crypto";
import { Random } from "@cosmjs/crypto";
import { Bech32, fromBase64 } from "@iov/encoding";
import hackatom from "./testdata/contract.json";

View File

@ -35,8 +35,8 @@
"test": "yarn build-or-skip && yarn test-node"
},
"dependencies": {
"@cosmjs/crypto": "^0.8.0",
"@cosmjs/sdk38": "^0.8.0",
"@iov/crypto": "^2.3.2",
"@iov/encoding": "^2.3.2",
"@iov/utils": "^2.3.2",
"@koa/cors": "^3.0.0",

View File

@ -1,4 +1,4 @@
import { Bip39, Random } from "@iov/crypto";
import { Bip39, Random } from "@cosmjs/crypto";
import * as constants from "../constants";
import { createPens } from "../profile";

View File

@ -1,5 +1,5 @@
import { Random } from "@cosmjs/crypto";
import { CosmosClient } from "@cosmjs/sdk38";
import { Random } from "@iov/crypto";
import { Bech32 } from "@iov/encoding";
import { assert } from "@iov/utils";

View File

@ -1,5 +1,5 @@
import { pathToString } from "@cosmjs/crypto";
import { makeCosmoshubPath, Pen, Secp256k1Pen } from "@cosmjs/sdk38";
import { pathToString } from "@iov/crypto";
export async function createPens(
mnemonic: string,

View File

@ -36,7 +36,7 @@
"pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js"
},
"dependencies": {
"@iov/crypto": "^2.3.2",
"@cosmjs/crypto": "^0.8.0",
"@iov/encoding": "^2.3.2",
"@iov/utils": "^2.3.2",
"axios": "^0.19.0",

View File

@ -1,4 +1,4 @@
import { Ripemd160, Sha256 } from "@iov/crypto";
import { Ripemd160, Sha256 } from "@cosmjs/crypto";
import { Bech32, fromBase64 } from "@iov/encoding";
import { PubKey, pubkeyType } from "./types";

View File

@ -1,4 +1,4 @@
import { Sha256 } from "@iov/crypto";
import { Sha256 } from "@cosmjs/crypto";
import { fromBase64, toHex } from "@iov/encoding";
import { Coin } from "./coins";

View File

@ -1,4 +1,4 @@
import { Secp256k1, Secp256k1Signature, Sha256 } from "@iov/crypto";
import { Secp256k1, Secp256k1Signature, Sha256 } from "@cosmjs/crypto";
import { fromHex, toAscii } from "@iov/encoding";
import { Secp256k1Pen } from "./pen";

View File

@ -7,7 +7,7 @@ import {
Slip10,
Slip10Curve,
Slip10RawIndex,
} from "@iov/crypto";
} from "@cosmjs/crypto";
import { rawSecp256k1PubkeyToAddress } from "./address";
import { encodeSecp256k1Signature } from "./signature";

View File

@ -1,4 +1,4 @@
import { Secp256k1, Secp256k1Signature, Sha256 } from "@iov/crypto";
import { Secp256k1, Secp256k1Signature, Sha256 } from "@cosmjs/crypto";
import { makeSignBytes } from "./encoding";
import { decodeSignature } from "./signature";

View File

@ -1,4 +1,4 @@
import { Random } from "@iov/crypto";
import { Random } from "@cosmjs/crypto";
import { Bech32 } from "@iov/encoding";
export function makeRandomAddress(): string {

View File

@ -1,4 +1,4 @@
import { Slip10RawIndex } from "@iov/crypto";
import { Slip10RawIndex } from "@cosmjs/crypto";
import { StdSignature } from "./types";
export declare type PrehashType = "sha256" | "sha512" | null;
/**