Msg/AddAllowedDenom

An allowed denom can be added:

  • when the authority is a governance account address
  • when the denom does not exist
  • the allowed denom is added

The authority must be governance account address

The authority is a governance account address

When alice attempts to add a denom with properties

{
  "authority":"regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68",
  "bank_denom":"uregen",
  "display_denom":"REGEN",
  "exponent":6
}

Then expect no error.

The authority is not a governance account address

When alice attempts to add a denom with properties

{
  "authority":"regen1fua8speyxgempgy06gpfs0p4z32zznkqakm57s",
  "bank_denom":"uregen",
  "display_denom":"REGEN",
  "exponent":6
}

Then expect error contains "expected gov account as only signer for proposal message".

The allowed denom does not exists

The allowed denom does not exist

When alice attempts to add a denom with properties

{
  "authority":"regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68",
  "bank_denom":"uregen",
  "display_denom":"REGEN",
  "exponent":6
}

Then expect no error.

The bank denom exists

Given an allowed denom with properties

{
  "authority":"regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68",
  "bank_denom":"uregen",
  "display_denom":"REGEN",
  "exponent":6
}

When alice attempts to add a denom with properties

{
  "authority":"regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68",
  "bank_denom":"uregen",
  "display_denom":"REGEN",
  "exponent":6
}

Then expect the error "bank denom uregen already exists: conflict".

The display denom exists

Given an allowed denom with properties

{
  "authority":"regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68",
  "bank_denom":"uregen",
  "display_denom":"REGEN",
  "exponent":6
}

When alice attempts to add a denom with properties

{
  "authority":"regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68",
  "bank_denom":"uatom",
  "display_denom":"REGEN",
  "exponent":6
}

Then expect the error "display denom REGEN already exists: conflict".

Event is emitted

EventAllowDenom is emitted

When alice attempts to add a denom with properties

{
  "authority":"regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68",
  "bank_denom":"uregen",
  "display_denom":"REGEN",
  "exponent":6
}

Then expect event with properties

{
  "denom": "uregen"
}