From 29ae2951c8d9738a691b8af9e193540e10e66149 Mon Sep 17 00:00:00 2001 From: meywood <105049338+meywood@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:58:10 +0100 Subject: [PATCH] issues/314 - Fix TransactionAccepted test after refactor of model --- .../java/com/casper/sdk/model/deploy/Deploy.java | 12 +++--------- .../model/event/transaction/TransactionAccepted.java | 6 +++--- .../sdk/service/EventServiceIntegrationTest.java | 3 +-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/casper/sdk/model/deploy/Deploy.java b/src/main/java/com/casper/sdk/model/deploy/Deploy.java index f56646f3..f277433b 100644 --- a/src/main/java/com/casper/sdk/model/deploy/Deploy.java +++ b/src/main/java/com/casper/sdk/model/deploy/Deploy.java @@ -28,19 +28,13 @@ @NoArgsConstructor public class Deploy extends AbstractTransaction implements CasperSerializableObject { - /** - * @see DeployHeader - */ + /** @see DeployHeader */ private DeployHeader header; - /** - * @see ExecutableDeployItem - */ + /** @see ExecutableDeployItem */ private ExecutableDeployItem payment; - /** - * @see ExecutableDeployItem - */ + /** @see ExecutableDeployItem */ private ExecutableDeployItem session; @Builder diff --git a/src/main/java/com/casper/sdk/model/event/transaction/TransactionAccepted.java b/src/main/java/com/casper/sdk/model/event/transaction/TransactionAccepted.java index 01e887f2..c7f16a76 100644 --- a/src/main/java/com/casper/sdk/model/event/transaction/TransactionAccepted.java +++ b/src/main/java/com/casper/sdk/model/event/transaction/TransactionAccepted.java @@ -1,7 +1,7 @@ package com.casper.sdk.model.event.transaction; import com.casper.sdk.model.event.EventData; -import com.casper.sdk.model.transaction.AbstractTransaction; +import com.casper.sdk.model.transaction.target.Transaction; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import lombok.Getter; @@ -19,10 +19,10 @@ @JsonTypeName("TransactionAccepted") public class TransactionAccepted implements EventData { - private AbstractTransaction transaction; + private Transaction transaction; @JsonCreator - public TransactionAccepted(final AbstractTransaction transaction) { + public TransactionAccepted(final Transaction transaction) { this.transaction = transaction; } } diff --git a/src/test/java/com/casper/sdk/service/EventServiceIntegrationTest.java b/src/test/java/com/casper/sdk/service/EventServiceIntegrationTest.java index f3dc644b..d981c696 100644 --- a/src/test/java/com/casper/sdk/service/EventServiceIntegrationTest.java +++ b/src/test/java/com/casper/sdk/service/EventServiceIntegrationTest.java @@ -421,8 +421,7 @@ void transactionAccepted() throws Exception { if (count[0] == 0) { assertThat(data, instanceOf(TransactionAccepted.class)); final TransactionAccepted transactionAccepted = (TransactionAccepted) data; - assertThat(transactionAccepted.getTransaction(), is(instanceOf(Deploy.class))); - final Deploy deploy = (Deploy) transactionAccepted.getTransaction(); + final Deploy deploy = transactionAccepted.getTransaction().get(); assertThat(deploy.getHash(), is(new Digest("37c80db9d769cb23ab482f44c2e8d8a73d9e24a1801e81d423953b8ba04b275d"))); try { assertThat(deploy.getHeader().getAccount(), is(PublicKey.fromTaggedHexString("01197debef24d5abef5251c35925d79b21fada5bca6b0afd212216b5c63c22be6f")));