moonstream-to/web3

`register_contract` should accept `contract_type` as string and validate internally

Closed this issue · 1 comments

https://github.com/bugout-dev/engine/blob/e4b1bf9b7ad1c6a327144e88e40420c960356262/api/engineapi/contracts_actions.py#L75

Currently, validation is being performed by the callers, which means that validation code is duplicated.

Not a big deal with only two current entrypoints - CLI and API handlers.

But it might be better for there to be a single point of failure for validation errors.

Need to consider this a bit more, though.

Won't fix - it is too important to reflect enum status in CLI and API.