Adapt CLI code to new method name

This commit is contained in:
Simon Warta
2020-02-19 10:23:16 +01:00
parent 67b21337ba
commit 3a351e19f7
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
const pen = await Secp256k1Pen.fromMnemonic(mnemonic);
const pubkey = encodeSecp256k1Pubkey(pen.pubkey);
const address = encodeAddress(pubkey, "cosmos");
const address = pubkeyToAddress(pubkey, "cosmos");
console.info("mnemonic:", mnemonic);
console.info("pubkey:", pubkey);
+3 -3
View File
@@ -28,7 +28,7 @@ const networkId = "testing";
// helper functions
const instantiateContract = async (initClient: RestClient, initPen: Secp256k1Pen, codeId: number, msg: object, transferAmount?: types.Coin[]): Promise<string> => {
const memo = "Create an ERC20 instance";
const sender = encodeAddress({ "type": types.pubkeyType.secp256k1, "value": toBase64(initPen.pubkey)}, "cosmos");
const sender = pubkeyToAddress({ "type": types.pubkeyType.secp256k1, "value": toBase64(initPen.pubkey)}, "cosmos");
const instantiateContractMsg = {
type: "wasm/instantiate",
value: {
@@ -59,7 +59,7 @@ const instantiateContract = async (initClient: RestClient, initPen: Secp256k1Pen
// helper functions
const executeContract = async (execClient: RestClient, execPen: Secp256k1Pen, contractAddr: string, msg: object, transferAmount?: types.Coin[]): Promise<readonly logs.Log[]> => {
const memo = "Create an ERC20 instance";
const sender = encodeAddress({ "type": types.pubkeyType.secp256k1, "value": toBase64(execPen.pubkey)}, "cosmos");
const sender = pubkeyToAddress({ "type": types.pubkeyType.secp256k1, "value": toBase64(execPen.pubkey)}, "cosmos");
const instantiateContractMsg = {
type: "wasm/execute",
value: {
@@ -97,5 +97,5 @@ const randomAddress = async (): Promise<string> => {
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
const randomPen = await Secp256k1Pen.fromMnemonic(mnemonic);
const pubkey = encodeSecp256k1Pubkey(randomPen.pubkey);
return encodeAddress(pubkey, "cosmos");
return pubkeyToAddress(pubkey, "cosmos");
}