Skip to content

Commit

Permalink
issues/314 - Fix TransactionAccepted test after refactor of model
Browse files Browse the repository at this point in the history
  • Loading branch information
meywood committed Jul 22, 2024
1 parent 77b5614 commit 29ae295
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
12 changes: 3 additions & 9 deletions src/main/java/com/casper/sdk/model/deploy/Deploy.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
Expand Down

0 comments on commit 29ae295

Please sign in to comment.