如何在 polkadot.js 中配置枚举

how to configure enum in polkadot.js

以下是我的底物代码:

pub type ItemId = u8;
#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug)]
pub enum PoolId {
    TX(ItemId),
}

如何在json文件中配置枚举类型? https://polkadot.js.org/apps

这不起作用:

{
  "PoolId": {
    "_enum": [
      "TX"
    ]
  },
}
{
  "PoolId": {
    "_enum": [
      "TX"
    ]
  },
  "TX": "u8"
// or
// "TX": { "_": "u8" }
// or
// "TX": "ItemId",
// "ItemId": "u8"
// or
// "TX": { "_": "ItemId" },
// "ItemId": "u8"
}

还有一个真实世界的例子:

https://github.com/darwinia-network/darwinia-common/blob/master/bin/node/runtime/pangolin/types.json#L9-L14

https://github.com/darwinia-network/darwinia-common/blob/master/bin/node/runtime/pangolin/types.json#L18-L21