Skip to main content

signatureTypesEqual

For the complete documentation index, see llms.txt

@midnight-ntwrk/compact-runtime v0.20.0


@midnight-ntwrk/compact-runtime / signatureTypesEqual

Function: signatureTypesEqual()

function signatureTypesEqual(a, b): boolean;

Whether two encoded Compact types are the same type.

Nominal for structs, enums and new type aliases, matching the compiler; structural for contract types, per contractCircuitsEqual.

The name is all the nominal cases have. Nothing in the encoding records which module declared it, so two compilation units that each write new type Meters = Uint<64> are one type here. The underlying type is still compared, so an alias collision cannot smuggle a different representation past — but a struct agreeing in name and fields is accepted whatever it meant.

Parameters​

a​

SignatureType

b​

SignatureType

Returns​

boolean