Adapt CLI code to new method name
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user