Remove Lisk support
This commit is contained in:
parent
53981bfbc1
commit
102488cb06
@ -36,7 +36,6 @@
|
||||
"@iov/bcp": "^2.0.0-alpha.7",
|
||||
"@iov/crypto": "^2.0.0-alpha.7",
|
||||
"@iov/encoding": "^2.0.0-alpha.7",
|
||||
"@iov/lisk": "^2.0.0-alpha.7",
|
||||
"@iov/multichain": "^2.0.0-alpha.7",
|
||||
"@koa/cors": "^3.0.0",
|
||||
"axios": "^0.19.0",
|
||||
|
||||
@ -2,10 +2,10 @@ import { Codec, codecFromString } from "./codec";
|
||||
|
||||
describe("Codec", () => {
|
||||
it("can convert string to codec", () => {
|
||||
expect(codecFromString("lisk")).toEqual(Codec.Lisk);
|
||||
expect(codecFromString("cosmwasm")).toEqual(Codec.CosmWasm);
|
||||
|
||||
expect(() => codecFromString("")).toThrowError(/not supported/i);
|
||||
expect(() => codecFromString("lisk")).toThrowError(/not supported/i);
|
||||
expect(() => codecFromString("bns")).toThrowError(/not supported/i);
|
||||
expect(() => codecFromString("abc")).toThrowError(/not supported/i);
|
||||
expect(() => codecFromString("LISK")).toThrowError(/not supported/i);
|
||||
|
||||
@ -2,17 +2,13 @@ import { createCosmWasmConnector, TokenInfo } from "@cosmwasm/bcp";
|
||||
import { ChainConnector, TokenTicker, TxCodec } from "@iov/bcp";
|
||||
import { Slip10RawIndex } from "@iov/crypto";
|
||||
import { HdPaths } from "@iov/keycontrol";
|
||||
import { createLiskConnector } from "@iov/lisk";
|
||||
|
||||
export const enum Codec {
|
||||
Lisk,
|
||||
CosmWasm,
|
||||
}
|
||||
|
||||
export function codecFromString(input: string): Codec {
|
||||
switch (input) {
|
||||
case "lisk":
|
||||
return Codec.Lisk;
|
||||
case "cosmwasm":
|
||||
return Codec.CosmWasm;
|
||||
default:
|
||||
@ -23,8 +19,6 @@ export function codecFromString(input: string): Codec {
|
||||
export function createPathBuilderForCodec(codec: Codec): (derivation: number) => readonly Slip10RawIndex[] {
|
||||
const pathBuilder = (accountIndex: number): readonly Slip10RawIndex[] => {
|
||||
switch (codec) {
|
||||
case Codec.Lisk:
|
||||
return HdPaths.bip44Like(134, accountIndex);
|
||||
case Codec.CosmWasm:
|
||||
return HdPaths.cosmos(accountIndex);
|
||||
default:
|
||||
@ -36,8 +30,6 @@ export function createPathBuilderForCodec(codec: Codec): (derivation: number) =>
|
||||
|
||||
export function createChainConnector(codec: Codec, url: string): ChainConnector {
|
||||
switch (codec) {
|
||||
case Codec.Lisk:
|
||||
return createLiskConnector(url);
|
||||
case Codec.CosmWasm: {
|
||||
const tokens: readonly TokenInfo[] = [
|
||||
{
|
||||
@ -66,8 +58,6 @@ export function codecImplementation(codec: Codec): TxCodec {
|
||||
|
||||
export function codecDefaultFractionalDigits(codec: Codec): number {
|
||||
switch (codec) {
|
||||
case Codec.Lisk:
|
||||
return 8;
|
||||
case Codec.CosmWasm:
|
||||
return 6;
|
||||
default:
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import { Ed25519HdWallet, Secp256k1HdWallet, Wallet } from "@iov/keycontrol";
|
||||
import { Secp256k1HdWallet, Wallet } from "@iov/keycontrol";
|
||||
|
||||
import { Codec } from "./codec";
|
||||
|
||||
export function createWalletForCodec(input: Codec, mnemonic: string): Wallet {
|
||||
switch (input) {
|
||||
case Codec.Lisk:
|
||||
return Ed25519HdWallet.fromMnemonic(mnemonic);
|
||||
case Codec.CosmWasm:
|
||||
return Secp256k1HdWallet.fromMnemonic(mnemonic);
|
||||
default:
|
||||
|
||||
17
yarn.lock
17
yarn.lock
@ -159,23 +159,6 @@
|
||||
type-tagger "^1.0.0"
|
||||
xstream "^11.10.0"
|
||||
|
||||
"@iov/lisk@^2.0.0-alpha.7":
|
||||
version "2.0.0-alpha.7"
|
||||
resolved "https://registry.yarnpkg.com/@iov/lisk/-/lisk-2.0.0-alpha.7.tgz#5ff6c617ac00e6be736ada34ad68dce0efd64637"
|
||||
integrity sha512-m5mr2NDU7pxuS8d6SBXCZ1WBtCSXtV+EWqMEIuPSCJwZxnwmWotowX+WhSYn+dGyuvgTd7DpfQ5C6pliAyhcyQ==
|
||||
dependencies:
|
||||
"@iov/bcp" "^2.0.0-alpha.7"
|
||||
"@iov/crypto" "^2.0.0-alpha.7"
|
||||
"@iov/encoding" "^2.0.0-alpha.7"
|
||||
"@iov/keycontrol" "^2.0.0-alpha.7"
|
||||
"@iov/stream" "^2.0.0-alpha.7"
|
||||
"@types/long" "^4.0.0"
|
||||
axios "^0.19.0"
|
||||
fast-deep-equal "^3.1.1"
|
||||
long "^4.0.0"
|
||||
readonly-date "^1.0.0"
|
||||
xstream "^11.10.0"
|
||||
|
||||
"@iov/multichain@^2.0.0-alpha.7":
|
||||
version "2.0.0-alpha.7"
|
||||
resolved "https://registry.yarnpkg.com/@iov/multichain/-/multichain-2.0.0-alpha.7.tgz#29ec9f61ec2fa60c17d462c9be48feb7196c28ba"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user