diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetConstitutionQuery.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetConstitutionQuery.java new file mode 100644 index 0000000..665fd8b --- /dev/null +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetConstitutionQuery.java @@ -0,0 +1,34 @@ +package com.bloxbean.cardano.yaci.core.protocol.localstate.queries; + +import co.nstant.in.cbor.model.Array; +import co.nstant.in.cbor.model.DataItem; +import co.nstant.in.cbor.model.UnsignedInteger; +import com.bloxbean.cardano.yaci.core.protocol.handshake.messages.AcceptVersion; +import com.bloxbean.cardano.yaci.core.protocol.localstate.api.Era; +import com.bloxbean.cardano.yaci.core.protocol.localstate.api.EraQuery; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public class GetConstitutionQuery implements EraQuery { + private Era era; + + public GetConstitutionQuery() { + this(Era.Conway); + } + + @Override + public DataItem serialize(AcceptVersion protocolVersion) { + Array array = new Array(); + array.add(new UnsignedInteger(23)); + + return wrapWithOuterArray(array); + } + + @Override + public GetConstitutionResult deserializeResult(AcceptVersion protocolVersion, DataItem[] di) { + System.out.println(di[0]); + throw new UnsupportedOperationException("Not implemented yet"); + } +} diff --git a/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetConstitutionResult.java b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetConstitutionResult.java new file mode 100644 index 0000000..bf01511 --- /dev/null +++ b/core/src/main/java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetConstitutionResult.java @@ -0,0 +1,12 @@ +package com.bloxbean.cardano.yaci.core.protocol.localstate.queries; + +import com.bloxbean.cardano.yaci.core.protocol.localstate.api.QueryResult; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.ToString; + +@Getter +@AllArgsConstructor +@ToString +public class GetConstitutionResult implements QueryResult { +}