PoolParams.deserialize constructor
PoolParams.deserialize(
- CborListValue<
CborObject> cbor
Deserializes a PoolParams object from its CBOR representation.
Implementation
factory PoolParams.deserialize(CborListValue cbor) {
return PoolParams(
operator: Ed25519KeyHash.deserialize(cbor.elementAt<CborBytesValue>(0)),
vrfKeyHash: VRFKeyHash.deserialize(cbor.elementAt<CborBytesValue>(1)),
pledge: cbor.elementAsInteger(2),
cost: cbor.elementAsInteger(3),
margin: UnitInterval.deserialize(cbor.elementAt<CborTagValue>(4)),
rewardAccount: ADAAddress.deserialize(cbor.elementAt<CborBytesValue>(5)),
poolOwners: cbor
.elementAt<CborListValue>(6)
.valueAsListOf<CborBytesValue>()
.map((e) => Ed25519KeyHash.deserialize(e))
.toList(),
relays: cbor
.elementAt<CborListValue>(7)
.valueAsListOf<CborListValue>()
.map((e) => Relay.deserialize(e))
.toList(),
poolMetadata: cbor
.elementAt<CborListValue?>(8)
?.convertTo<PoolMetadata, CborListValue>(
(e) => PoolMetadata.deserialize(e)),
);
}