com.hedera.hashgraph.sdk.ContractStateChange Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-full Show documentation
Show all versions of sdk-full Show documentation
Hedera™ Hashgraph SDK for Java
The newest version!
/*-
*
* Hedera Java SDK
*
* Copyright (C) 2020 - 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.hashgraph.sdk;
import com.google.protobuf.InvalidProtocolBufferException;
import java.util.ArrayList;
import java.util.List;
/**
* @deprecated - User mirror nodes for contract traceability instead
*
* The storage changes to a smart contract's storage as a side effect of the function call.
* See Hedera Documentation
*/
@Deprecated
public class ContractStateChange {
/**
* The contract to which the storage changes apply to
*/
public final ContractId contractId;
/**
* The list of storage changes
*/
public final List storageChanges;
/**
* Constructor.
*
* @param contractId the contract id
* @param storageChanges the list of storage change objects
*/
ContractStateChange(ContractId contractId, List storageChanges) {
this.contractId = contractId;
this.storageChanges = storageChanges;
}
// /**
// * Create contract stage change object from protobuf.
// *
// * @param stateChangeProto the protobuf
// * @return the contract stage change object
// */
// static ContractStateChange fromProtobuf(com.hedera.hashgraph.sdk.proto.ContractStateChange stateChangeProto) {
// List storageChanges = new ArrayList<>(stateChangeProto.getStorageChangesCount());
// for (var storageChangeProto : stateChangeProto.getStorageChangesList()) {
// storageChanges.add(StorageChange.fromProtobuf(storageChangeProto));
// }
// return new ContractStateChange(ContractId.fromProtobuf(stateChangeProto.getContractID()), storageChanges);
// }
//
// /**
// * Create contract stage change object from byte array.
// *
// * @param bytes the byte array
// * @return the contract stage change object
// * @throws InvalidProtocolBufferException when there is an issue with the protobuf
// */
// public static ContractStateChange fromBytes(byte[] bytes) throws InvalidProtocolBufferException {
// return fromProtobuf(com.hedera.hashgraph.sdk.proto.ContractStateChange.parseFrom(bytes));
// }
//
// /**
// * Create the protobuf.
// *
// * @return the protobuf representation
// */
// com.hedera.hashgraph.sdk.proto.ContractStateChange toProtobuf() {
// var builder = com.hedera.hashgraph.sdk.proto.ContractStateChange.newBuilder()
// .setContractID(contractId.toProtobuf());
// for (var storageChange : storageChanges) {
// builder.addStorageChanges(storageChange.toProtobuf());
// }
// return builder.build();
// }
//
// /**
// * Create the byte array.
// *
// * @return the byte array representation
// */
// public byte[] toBytes() {
// return toProtobuf().toByteArray();
// }
}