fromSubstrate static method
Picks the verifier implementation matching substrate's coin config.
Implementation
static BaseSubstrateVerifier fromSubstrate(Substrate substrate) {
final publicKey = substrate.publicKey.toBytes();
switch (substrate.coinConf.type) {
case CryptoKeyType.ed25519:
return SubstrateED25519Verifier.fromKeyBytes(publicKey);
case CryptoKeyType.secp256k1:
return SubstrateEcdsaVerifier.fromKeyBytes(publicKey);
default:
return SubstrateSr25519Verifier.fromKeyBytes(publicKey);
}
}