Skip to content

Commit

Permalink
feat: #55 Initial commit for GetConstitutionQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
satran004 committed Feb 26, 2024
1 parent e1852b2 commit b61cf45
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<GetConstitutionResult> {
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");
}
}
Original file line number Diff line number Diff line change
@@ -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 {
}

0 comments on commit b61cf45

Please sign in to comment.