Skip to content

Commit

Permalink
test: Add in-equivalence tests for internal calls
Browse files Browse the repository at this point in the history
Signed-off-by: Bilyana Gospodinova <bilyana.gospodinova14@gmail.com>
  • Loading branch information
bilyana-gospodinova committed Mar 14, 2024
1 parent d414292 commit 82ab512
Show file tree
Hide file tree
Showing 6 changed files with 376 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (C) 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.mirror.test.e2e.acceptance.response;

import com.hedera.mirror.test.e2e.acceptance.util.ContractCallResponseWrapper;
Expand All @@ -7,12 +23,25 @@
* networkResponse, errorMessage) or from the mirror node (with initialized contractCallResponse).
* This is needed for the NetworkAdapter logic.
*/
public record GeneralContractExecutionResponse(String transactionId, NetworkTransactionResponse networkResponse, String errorMessage, ContractCallResponseWrapper contractCallResponse) {
public record GeneralContractExecutionResponse(
String transactionId,
NetworkTransactionResponse networkResponse,
String errorMessage,
ContractCallResponseWrapper contractCallResponse) {
public GeneralContractExecutionResponse(ContractCallResponseWrapper contractCallResponse) {
this(null, null, null, contractCallResponse);
}

public GeneralContractExecutionResponse(String transactionId, NetworkTransactionResponse networkResponse, String errorMessage) {
public GeneralContractExecutionResponse(
String transactionId, NetworkTransactionResponse networkResponse, String errorMessage) {
this(transactionId, networkResponse, errorMessage, null);
}
}

public String getMirrorNodeResponseAsString() {
return contractCallResponse.getResult().substring(2);
}

public byte[] getMirrorNodeResponseAsBytes() {
return contractCallResponse.getResultAsBytes().toArray();
}
}

0 comments on commit 82ab512

Please sign in to comment.