Add Pen to CLI imports

This commit is contained in:
Simon Warta 2020-02-07 09:25:43 +01:00
parent 999f0f3830
commit d7cf91eb4c

View File

@ -38,7 +38,18 @@ export function main(originalArgs: readonly string[]): void {
} }
const imports = new Map<string, readonly string[]>([ const imports = new Map<string, readonly string[]>([
["@cosmwasm/sdk", ["encodeSecp256k1Signature", "makeSignBytes", "marshalTx", "types", "RestClient"]], [
"@cosmwasm/sdk",
[
"encodeSecp256k1Signature",
"makeSignBytes",
"marshalTx",
"Pen",
"RestClient",
"Secp256k1Pen",
"types",
],
],
[ [
"@iov/bcp", "@iov/bcp",
[ [
@ -151,6 +162,12 @@ export function main(originalArgs: readonly string[]): void {
const hexHash = toHex(hash); const hexHash = toHex(hash);
export class NewDummyClass {}; export class NewDummyClass {};
const pen = await Secp256k1Pen.fromMnemonic(
"zebra slush diet army arrest purpose hawk source west glimpse custom record",
);
const data = Encoding.toAscii("foo bar");
const signature = await pen.createSignature(data);
const profile = new UserProfile(); const profile = new UserProfile();
const wallet = profile.addWallet(Ed25519HdWallet.fromMnemonic("degree tackle suggest window test behind mesh extra cover prepare oak script")); const wallet = profile.addWallet(Ed25519HdWallet.fromMnemonic("degree tackle suggest window test behind mesh extra cover prepare oak script"));
const db = levelup(leveldown('./selftest_userprofile_db')); const db = levelup(leveldown('./selftest_userprofile_db'));