osmosis icon indicating copy to clipboard operation
osmosis copied to clipboard

amino encoding not enabled for tokenfactory

Open pyramation opened this issue 2 years ago • 2 comments

System information

testnet: osmo-test-4

Expected behaviour

should have amino encoding for /osmosis.tokenfactory.v1beta1.MsgCreateDenom for osmosis/tokenfactory/create-denom

example of initialization: https://github.com/osmosis-labs/osmosis/blob/main/x/lockup/types/codec.go#L26-L34

Actual behaviour

actual codec file (seems to not be initialized): https://github.com/osmosis-labs/osmosis/blob/main/x/tokenfactory/types/codec.go

Steps to reproduce the behaviour

broadcast a message from client with amino encoding.


import * as util from "util";
import { osmosis, getSigningOsmosisClient } from 'osmojs';
import {
    getWalletFromMnemonic,
    signAndBroadcast
} from '@cosmology/core';

const alohaMnemonic = 'siren garbage suggest drama note tenant desk mad siege business mistake brown limit latin raise dune snack hedgehog maze pear grief soap obscure problem'
const honuaMnemonic = 'secret forest reason select sketch satisfy foil member injury omit hub north tired polar draft cushion check lens sail west beef slush seat insect'

const start = async () => {
    const alohaWallet = await getWalletFromMnemonic({
        mnemonic: alohaMnemonic,
        token: 'OSMO'
    });
    const alohaAccounts = await alohaWallet.getAccounts();
    const alohaAddress = alohaAccounts[0].address

    const client = await getSigningOsmosisClient({
        rpcEndpoint: 'https://testnet-rpc.osmosis.zone',
        signer: alohaWallet
    });

    const {
        createDenom
    } = osmosis.tokenfactory.v1beta1.MessageComposer.withTypeUrl;

    const result = await signAndBroadcast({
        client,
        chainId: 'osmo-test-4',
        address: alohaAddress,
        msg: createDenom({
            subdenom: 'aloha',
            sender: alohaAddress
        }),
        fee: {
            amount: [
                {
                    amount: '0',
                    denom: 'uosmo'
                }
            ],
            gas: "250000",
        },
        memo: 'aloha'
    });

    console.log(util.inspect(result, false, null, true))
}

pyramation avatar Jul 30 '22 10:07 pyramation

I think this PR #2206 fixed it.

vuong177 avatar Jul 30 '22 17:07 vuong177

@pyramation do we have a setup so you can easily test if this now works with a local network?

ValarDragon avatar Aug 11 '22 02:08 ValarDragon

pardon the delayed reply! I have only been able to test pools in production 😅 I did remember that we may be getting some tooling soon for localosmosis and seeded pools — if that's what you mean, that would be amazing. cc @daniel-farina

pyramation avatar Aug 23 '22 06:08 pyramation

Fixed in v12

ValarDragon avatar Sep 28 '22 10:09 ValarDragon