MsgUpdateProjectMetadata

a valid message

Given the message

{
  "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6",
  "project_id": "C01-001",
  "new_metadata": "regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf"
}

When the message is validated

Then expect no error.

a valid message removing metadata

Given the message

{
  "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6",
  "project_id": "C01-001"
}

When the message is validated

Then expect no error.

an error is returned if admin is empty

Given the message

{}

When the message is validated

Then expect the error "admin: empty address string is not allowed: invalid address".

an error is returned if admin is not a bech32 address

Given the message

{
  "admin": "foo"
}

When the message is validated

Then expect the error "admin: decoding bech32 failed: invalid bech32 string length 3: invalid address".

an error is returned if project id is empty

Given the message

{
  "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6"
}

When the message is validated

Then expect the error "project id: empty string is not allowed: parse error: invalid request".

an error is returned if project id is not formatted

Given the message

{
  "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6",
  "project_id": "foo"
}

When the message is validated

Then expect the error "project id: expected format [class-id]-[project-sequence]: parse error: invalid request".

an error is returned if new metadata exceeds 256 characters

Given the message

{
  "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6",
  "project_id": "C01-001"
}

And new metadata with length "257"

When the message is validated

Then expect the error "metadata: max length is 256: limit exceeded".

a valid amino message

Given the message

{
  "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6",
  "project_id": "C01-001",
  "new_metadata": "regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf"
}

When message sign bytes queried

Then expect the sign bytes

{
  "type":"regen/MsgUpdateProjectMetadata",
  "value":{
    "admin":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6",
    "new_metadata":"regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf",
    "project_id":"C01-001"
  }
}