Eliminate most of TcOriginatedContracts usages
Clarification and motivation
Typechecker needs TcOriginatedContracts
to typecheck a value of contract p
type. After Babylon update this value can't be PUSH
ed and can't be part of storage
. The only case when we need to typecheck a sting literal against this type is when we typecheck a parameter. However, we store tcContracts
in TypeCheckEnv
and often blindly pass mempty
or set it to error
(this field is intentionally lazy).
Acceptance criteria
TcOriginatedContracts
should be used as a function argument only if it can actually be used there. For example, typeCheckContract
does not need it because contract's code can't have a constant value of type contract p
. I guess we can have typeCheckParameter
that takes TcOriginatedContracts
, but most of typeCheck*
functions should not have it.