ExPlasma.Configuration.Validator (ExPlasma v0.2.0)
Provides validation to application variables
Link to this section Summary
Functions
Validates the eip 712 domain format. The expected format is: %{
Link to this section Types
Link to this type
eip_712_domain_t()
Specs
Link to this section Functions
Link to this function
validate_eip_712_domain(domain)
Specs
validate_eip_712_domain(any()) :: eip_712_domain_t() | no_return()
Validates the eip 712 domain format. The expected format is: %{
name: "OMG Network",
salt: "0xfad5c7f626d80f9256ef01929f3beb96e058b8b4b0e3fe52d84f054c0e2a7a83",
verifying_contract: "0xd17e1233a03affb9092d5109179b43d6a8828607",
version: "1"
}
Returns the domain if valid, or raise an exception otherwise.
Example
iex> ExPlasma.Configuration.Validator.validate_eip_712_domain(%{
...> name: "OMG Network",
...> salt: "0xfad5c7f626d80f9256ef01929f3beb96e058b8b4b0e3fe52d84f054c0e2a7a83",
...> verifying_contract: "0xd17e1233a03affb9092d5109179b43d6a8828607",
...> version: "1"
...>})
%{
name: "OMG Network",
salt: "0xfad5c7f626d80f9256ef01929f3beb96e058b8b4b0e3fe52d84f054c0e2a7a83",
verifying_contract: "0xd17e1233a03affb9092d5109179b43d6a8828607",
version: "1"
}