-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: #55 Initial commit for GetConstitutionQuery
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...java/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetConstitutionQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ava/com/bloxbean/cardano/yaci/core/protocol/localstate/queries/GetConstitutionResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
} |