XchainModel constructor Null safety

XchainModel(
  1. RsaPublicKey publicKey,
  2. {dynamic lastBlock}
)

Builds a XchainModel from its publicKey.

The address is derived from the publicKey using the SHA3-256 hash. If the chain was not synced yet, lastBlock should be null.

Implementation

XchainModel(this.publicKey, {lastBlock})
    : address = Digest("SHA3-256").process(base64.decode(publicKey.encode())),
      lastBlock = lastBlock ?? Uint8List(1);