Remove bns support from faucet
This commit is contained in:
parent
f692efc910
commit
8921b5c20a
@ -34,7 +34,6 @@
|
||||
"dependencies": {
|
||||
"@cosmwasm/bcp": "^0.0.1",
|
||||
"@iov/bcp": "^2.0.0-alpha.7",
|
||||
"@iov/bns": "^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",
|
||||
|
||||
@ -2,11 +2,11 @@ import { Codec, codecFromString } from "./codec";
|
||||
|
||||
describe("Codec", () => {
|
||||
it("can convert string to codec", () => {
|
||||
expect(codecFromString("bns")).toEqual(Codec.Bns);
|
||||
expect(codecFromString("lisk")).toEqual(Codec.Lisk);
|
||||
expect(codecFromString("cosmwasm")).toEqual(Codec.CosmWasm);
|
||||
|
||||
expect(() => codecFromString("")).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);
|
||||
expect(() => codecFromString("CosmWasm")).toThrowError(/not supported/i);
|
||||
|
||||
@ -1,20 +1,16 @@
|
||||
import { createCosmWasmConnector, TokenInfo } from "@cosmwasm/bcp";
|
||||
import { ChainConnector, TokenTicker, TxCodec } from "@iov/bcp";
|
||||
import { createBnsConnector } from "@iov/bns";
|
||||
import { Slip10RawIndex } from "@iov/crypto";
|
||||
import { HdPaths } from "@iov/keycontrol";
|
||||
import { createLiskConnector } from "@iov/lisk";
|
||||
|
||||
export const enum Codec {
|
||||
Bns,
|
||||
Lisk,
|
||||
CosmWasm,
|
||||
}
|
||||
|
||||
export function codecFromString(input: string): Codec {
|
||||
switch (input) {
|
||||
case "bns":
|
||||
return Codec.Bns;
|
||||
case "lisk":
|
||||
return Codec.Lisk;
|
||||
case "cosmwasm":
|
||||
@ -27,8 +23,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.Bns:
|
||||
return HdPaths.iov(accountIndex);
|
||||
case Codec.Lisk:
|
||||
return HdPaths.bip44Like(134, accountIndex);
|
||||
case Codec.CosmWasm:
|
||||
@ -42,8 +36,6 @@ export function createPathBuilderForCodec(codec: Codec): (derivation: number) =>
|
||||
|
||||
export function createChainConnector(codec: Codec, url: string): ChainConnector {
|
||||
switch (codec) {
|
||||
case Codec.Bns:
|
||||
return createBnsConnector(url);
|
||||
case Codec.Lisk:
|
||||
return createLiskConnector(url);
|
||||
case Codec.CosmWasm: {
|
||||
@ -74,8 +66,6 @@ export function codecImplementation(codec: Codec): TxCodec {
|
||||
|
||||
export function codecDefaultFractionalDigits(codec: Codec): number {
|
||||
switch (codec) {
|
||||
case Codec.Bns:
|
||||
return 9; // fixed for all weave tokens
|
||||
case Codec.Lisk:
|
||||
return 8;
|
||||
case Codec.CosmWasm:
|
||||
|
||||
@ -4,7 +4,6 @@ import { Codec } from "./codec";
|
||||
|
||||
export function createWalletForCodec(input: Codec, mnemonic: string): Wallet {
|
||||
switch (input) {
|
||||
case Codec.Bns:
|
||||
case Codec.Lisk:
|
||||
return Ed25519HdWallet.fromMnemonic(mnemonic);
|
||||
case Codec.CosmWasm:
|
||||
|
||||
132
yarn.lock
132
yarn.lock
@ -103,25 +103,6 @@
|
||||
type-tagger "^1.0.0"
|
||||
xstream "^11.10.0"
|
||||
|
||||
"@iov/bns@^2.0.0-alpha.7":
|
||||
version "2.0.0-alpha.7"
|
||||
resolved "https://registry.yarnpkg.com/@iov/bns/-/bns-2.0.0-alpha.7.tgz#83a9ab0fa97631c7d42f32038b8fb1b86d318405"
|
||||
integrity sha512-xX/o65HC78SfxJLLZE6pSUcfszwDezXovYBuhoelR0vIHqGbZjetksWwXrBz7zgkyBXQnXcfUDFgyaefFfmJjw==
|
||||
dependencies:
|
||||
"@iov/bcp" "^2.0.0-alpha.7"
|
||||
"@iov/crypto" "^2.0.0-alpha.7"
|
||||
"@iov/encoding" "^2.0.0-alpha.7"
|
||||
"@iov/stream" "^2.0.0-alpha.7"
|
||||
"@iov/tendermint-rpc" "^2.0.0-alpha.7"
|
||||
"@types/long" "^4.0.0"
|
||||
"@types/node" "^10.12.18"
|
||||
bn.js "^4.11.8"
|
||||
fast-deep-equal "^3.1.1"
|
||||
long "^4.0.0"
|
||||
protobufjs "^6.8.6"
|
||||
type-tagger "^1.0.0"
|
||||
xstream "^11.10.0"
|
||||
|
||||
"@iov/crypto@^2.0.0-alpha.7":
|
||||
version "2.0.0-alpha.7"
|
||||
resolved "https://registry.yarnpkg.com/@iov/crypto/-/crypto-2.0.0-alpha.7.tgz#5cb24dbc3cdd344bf782039f1fe6d55975d171f6"
|
||||
@ -207,16 +188,6 @@
|
||||
"@types/long" "^4.0.0"
|
||||
long "^4.0.0"
|
||||
|
||||
"@iov/socket@^2.0.0-alpha.7":
|
||||
version "2.0.0-alpha.7"
|
||||
resolved "https://registry.yarnpkg.com/@iov/socket/-/socket-2.0.0-alpha.7.tgz#d88baf91617a91d87b5f5d51a11b2bc0800cf532"
|
||||
integrity sha512-4c96cvwRJTEuG2vrUM36v3sFq5tkxZ3afn21zqUXIfaAo9VC3wFSpEUXjyx7/j1iwC7SOPOT2ExckiyMWBTa9A==
|
||||
dependencies:
|
||||
"@iov/stream" "^2.0.0-alpha.7"
|
||||
isomorphic-ws "^4.0.1"
|
||||
ws "^6.2.0"
|
||||
xstream "^11.10.0"
|
||||
|
||||
"@iov/stream@^2.0.0-alpha.7":
|
||||
version "2.0.0-alpha.7"
|
||||
resolved "https://registry.yarnpkg.com/@iov/stream/-/stream-2.0.0-alpha.7.tgz#212c3f684f592ec04ac43e166183d946a49b895c"
|
||||
@ -224,20 +195,6 @@
|
||||
dependencies:
|
||||
xstream "^11.10.0"
|
||||
|
||||
"@iov/tendermint-rpc@^2.0.0-alpha.7":
|
||||
version "2.0.0-alpha.7"
|
||||
resolved "https://registry.yarnpkg.com/@iov/tendermint-rpc/-/tendermint-rpc-2.0.0-alpha.7.tgz#5c70bdcb0c2850be4012812116cbe1188bc9bdd6"
|
||||
integrity sha512-UaMu7wCGiiT5baIDdeTwQ3gCWFd4J1fJDDico/RuAqxbGhtvZSUpzevv+r/xeysydviNLue1J1w2ZdqTS9mJRg==
|
||||
dependencies:
|
||||
"@iov/crypto" "^2.0.0-alpha.7"
|
||||
"@iov/encoding" "^2.0.0-alpha.7"
|
||||
"@iov/jsonrpc" "^2.0.0-alpha.7"
|
||||
"@iov/socket" "^2.0.0-alpha.7"
|
||||
axios "^0.19.0"
|
||||
readonly-date "^1.0.0"
|
||||
type-tagger "^1.0.0"
|
||||
xstream "^11.10.0"
|
||||
|
||||
"@koa/cors@^3.0.0":
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@koa/cors/-/cors-3.0.0.tgz#df021b4df2dadf1e2b04d7c8ddf93ba2d42519cb"
|
||||
@ -1013,59 +970,6 @@
|
||||
dependencies:
|
||||
"@types/node" ">= 8"
|
||||
|
||||
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"
|
||||
integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78=
|
||||
|
||||
"@protobufjs/base64@^1.1.2":
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735"
|
||||
integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==
|
||||
|
||||
"@protobufjs/codegen@^2.0.4":
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb"
|
||||
integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==
|
||||
|
||||
"@protobufjs/eventemitter@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70"
|
||||
integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A=
|
||||
|
||||
"@protobufjs/fetch@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45"
|
||||
integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=
|
||||
dependencies:
|
||||
"@protobufjs/aspromise" "^1.1.1"
|
||||
"@protobufjs/inquire" "^1.1.0"
|
||||
|
||||
"@protobufjs/float@^1.0.2":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1"
|
||||
integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=
|
||||
|
||||
"@protobufjs/inquire@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089"
|
||||
integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=
|
||||
|
||||
"@protobufjs/path@^1.1.2":
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d"
|
||||
integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=
|
||||
|
||||
"@protobufjs/pool@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54"
|
||||
integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=
|
||||
|
||||
"@protobufjs/utf8@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
|
||||
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=
|
||||
|
||||
"@tendermint/amino-js@^0.7.0-alpha.1":
|
||||
version "0.7.0-alpha.1"
|
||||
resolved "https://registry.yarnpkg.com/@tendermint/amino-js/-/amino-js-0.7.0-alpha.1.tgz#5d9f689fb601a0c0a6bb245a16d0b9a197f616e5"
|
||||
@ -1259,11 +1163,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a"
|
||||
integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==
|
||||
|
||||
"@types/node@^10.1.0":
|
||||
version "10.17.14"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.14.tgz#b6c60ebf2fb5e4229fdd751ff9ddfae0f5f31541"
|
||||
integrity sha512-G0UmX5uKEmW+ZAhmZ6PLTQ5eu/VPaT+d/tdLd5IFsKRPcbe6lPxocBtcYBFSaLaCW8O60AX90e91Nsp8lVHCNw==
|
||||
|
||||
"@types/node@^10.12.18":
|
||||
version "10.17.13"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c"
|
||||
@ -4711,11 +4610,6 @@ isobject@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0"
|
||||
integrity sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==
|
||||
|
||||
isomorphic-ws@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc"
|
||||
integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==
|
||||
|
||||
isstream@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
@ -6385,25 +6279,6 @@ proto-list@~1.2.1:
|
||||
resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
|
||||
integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=
|
||||
|
||||
protobufjs@^6.8.6:
|
||||
version "6.8.8"
|
||||
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.8.8.tgz#c8b4f1282fd7a90e6f5b109ed11c84af82908e7c"
|
||||
integrity sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==
|
||||
dependencies:
|
||||
"@protobufjs/aspromise" "^1.1.2"
|
||||
"@protobufjs/base64" "^1.1.2"
|
||||
"@protobufjs/codegen" "^2.0.4"
|
||||
"@protobufjs/eventemitter" "^1.1.0"
|
||||
"@protobufjs/fetch" "^1.1.0"
|
||||
"@protobufjs/float" "^1.0.2"
|
||||
"@protobufjs/inquire" "^1.1.0"
|
||||
"@protobufjs/path" "^1.1.2"
|
||||
"@protobufjs/pool" "^1.1.0"
|
||||
"@protobufjs/utf8" "^1.1.0"
|
||||
"@types/long" "^4.0.0"
|
||||
"@types/node" "^10.1.0"
|
||||
long "^4.0.0"
|
||||
|
||||
protocols@^1.1.0, protocols@^1.4.0:
|
||||
version "1.4.7"
|
||||
resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.7.tgz#95f788a4f0e979b291ffefcf5636ad113d037d32"
|
||||
@ -8195,13 +8070,6 @@ write@1.0.3:
|
||||
dependencies:
|
||||
mkdirp "^0.5.1"
|
||||
|
||||
ws@^6.2.0:
|
||||
version "6.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb"
|
||||
integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==
|
||||
dependencies:
|
||||
async-limiter "~1.0.0"
|
||||
|
||||
ws@~3.3.1:
|
||||
version "3.3.3"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user