May org.json.JSONObject used in org.hyperledger.fabric.contract.execution.JSONTransactionSerializer lead submit payloads not matching?
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- java
- Bereich
- backend-api-design
Rechercherichtung
Beginnen Sie mit org.hyperledger.fabric.contract.execution.JSONTransactionSerializer und dem im Stacktrace gezeigten GatewayClient.endorse-Aufruf. Reproduzieren Sie die Endorsement-Abweichung anhand des generischen Rückgabetyps Response und der bereitgestellten Definitionen von Asset und der Contract-Schnittstelle. Als erledigt gilt, festzustellen, ob generische Rückgabetypen unterstützt werden, und das Verhalten zu dokumentieren oder zu korrigieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
When I call a submit method from application via gateway, I received an Exception below.
Caused by: org.hyperledger.fabric.client.EndorseException: io.grpc.StatusRuntimeException: ABORTED: failed to collect enough transaction endorsements, see attached details for more info
at org.hyperledger.fabric.client.GatewayClient.endorse(GatewayClient.java:74)
at org.hyperledger.fabric.client.ProposalImpl.endorse(ProposalImpl.java:76)
at org.hyperledger.fabric.client.Proposal.endorse(Proposal.java:64)
at pers.u8f23.fabric.app.api.AbstractAssetContractSubmit.createAsset(AbstractAssetContractSubmit.java:13)
at pers.u8f23.fabric.app.Main.chaincodeOperations(Main.java:84)
at pers.u8f23.fabric.app.Main.main(Main.java:65)
Caused by: io.grpc.StatusRuntimeException: ABORTED: failed to collect enough transaction endorsements, see attached details for more info
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:167)
at org.hyperledger.fabric.protos.gateway.GatewayGrpc$GatewayBlockingStub.endorse(GatewayGrpc.java:455)
at org.hyperledger.fabric.client.GatewayClient.endorse(GatewayClient.java:72)
... 5 more
Detail message attached to this Exception is ProposalResponsePayloads do not match.
Returned type is a generic class. Both the generic type and the type argument are defined as type in fabric demo .
public interface AbstractAssetContractSubmit {
Response<Asset> createAsset(Context context, String value);
Response<Void> deleteAsset(Context context, String assetId);
Response<Void> updateAsset(Context context, String assetId, String value);
}
@DataType
public final class Response<T> {
@Property
private final T body;
@Property
private final int code;
@Property
private final String msg;
public Response(@JsonProperty("body") T body, @JsonProperty("code") int code,
@JsonProperty("msg") String msg) {
this.body = body;
this.code = code;
this.msg = msg;
}
public T getBody() {
return this.body;
}
public int getCode() {
return this.code;
}
public String getMsg() {
return this.msg;
}
}
@DataType
public final class Asset {
@Property
private final String id;
@Property
private final String creatorId;
@Property
private final String ownerId;
@Property
private final long createTime;
@Property
private final long lastTransferTime;
@Property
private final long lastUpdateTime;
@Property
private final String assetValue;
public Asset(@JsonProperty("id") String id, @JsonProperty("creatorId") String creatorId,
@JsonProperty("ownerId") String ownerId, @JsonProperty("createTime") long createTime,
@JsonProperty("lastTransferTime") long lastTransferTime,
@JsonProperty("lastUpdateTime") long lastUpdateTime,
@JsonProperty("assetValue") String assetValue) {
this.id = id;
this.creatorId = creatorId;
this.ownerId = ownerId;
this.createTime = createTime;
this.lastTransferTime = lastTransferTime;
this.lastUpdateTime = lastUpdateTime;
this.assetValue = assetValue;
}
public String getId() {
return this.id;
}
public String getCreatorId() {
return this.creatorId;
}
public String getOwnerId() {
return this.ownerId;
}
public long getCreateTime() {
return this.createTime;
}
public long getLastTransferTime() {
return this.lastTransferTime;
}
public long getLastUpdateTime() {
return this.lastUpdateTime;
}
public String getAssetValue() {
return this.assetValue;
}
}
Does this chaincode api support java generic type as method return type?
Anyone is welcome to answer this question.
- Vorherrschende Sprache
- Java
- Sterne
- 322
- Forks
- 210
- Ø Merge
- 15 Std. 16 Min.
- Gemergte PRs (30 T.)
- 29
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus hyperledger/fabric-chaincode-java
-
enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
hyperledger/fabric-chaincode-java#628 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
hyperledger/fabric-chaincode-java#627 ·
Maintainer antworten meist innerhalb von 1 Tag
-
DataType nested classOffenbug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 75/100
hyperledger/fabric-chaincode-java#626 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
hyperledger/fabric-chaincode-java#625 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Read/write batchingEvtl. wieder frei @jadebluestar hat das vor 118 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement help wanted
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
hyperledger/fabric-chaincode-java#378 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in hyperledger/fabric-chaincode-java
Ähnliche Issues
-
status: needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
JabRef/jabref#17546 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
hiero-ledger/hiero-sdk-java#3010 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Optimize consumer version heatmap aggregation to avoid repeated scansEvtl. vergeben @praykaria31 hat das heute übernommen. Offentype/enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Apicurio/apicurio-registry#10662 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
a:false-positive
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Maintainer antworten meist innerhalb von 1 Tag
-
status: waiting-for-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
spring-projects/spring-boot#52347 ·
Maintainer antworten meist innerhalb von 2 Tagen