CosmWasm / wasmd

Basic cosmos-sdk app with web assembly smart contracts
Other
364 stars 386 forks source link

[Reg 0.4x -> 0.50] MsgStoreCode with instantiate_permission set not working with Amino JSON since Cosmos SDK 0.50 (wasmd 0.50) #1863

Open webmaster128 opened 3 months ago

webmaster128 commented 3 months ago

After a series of changes, we got Amino JSON bach to pre-Cosmos SDK 0.50 behavior for the majority of CosmWasm message types. However, there is one case left we currently know about.

MsgStoreCode works when instantiate_permission is unset. When it is set to the following value, it fails:

      const instantiatePermission: AccessConfig = {
        permission: AccessType.ACCESS_TYPE_EVERYBODY,
        address: "",
        addresses: [],
      };
      const { codeId, checksum, originalSize, compressedSize } = await client.upload(
        alice.address0,
        wasm,
        defaultUploadFee,
        "test memo",
        instantiatePermission,
      );

The reason might be the JSON serialization of the empty list. But this is just an unevaluated guess.

webmaster128 commented 3 months ago

The same test with

      const instantiatePermission = AccessConfig.fromPartial({
        permission: AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES,
        addresses: [makeRandomAddress()],
      });

is failing as well. So it might be a problem with the enum or anything else.