Skip to content

Commit

Permalink
removed StreamType from AccountBalanceType
Browse files Browse the repository at this point in the history
Signed-off-by: Iris Simon <iris.simon@swirldslabs.com>
  • Loading branch information
iwsimon committed Apr 28, 2023
1 parent ed3ac49 commit 4073d24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Expand Up @@ -44,6 +44,6 @@ public boolean generateSignatureFile(
*/
@Override
public boolean isFileSupported(@NonNull final Path path) {
return AccountBalanceType.getInstance().isStreamFile(path.toFile());
return AccountBalanceType.getInstance().isCorrectFile(path.toFile().getName());
}
}
Expand Up @@ -16,13 +16,11 @@

package com.hedera.services.cli.sign;

import com.swirlds.common.stream.StreamType;

/**
* Contains properties related to Account Balance file type;
* Its constructor is private. Users need to use the singleton to denote this type
*/
public final class AccountBalanceType implements StreamType {
public final class AccountBalanceType {
/**
* description of the streamType, used for logging
*/
Expand All @@ -46,30 +44,19 @@ public static AccountBalanceType getInstance() {
return INSTANCE;
}

@Override
public String getDescription() {
return ACCOUNT_BALANCE_DESCRIPTION;
}

@Override
public String getExtension() {
return ACCOUNT_BALANCE_EXTENSION;
}

@Override
public String getSigExtension() {
return ACCOUNT_BALANCE_SIG_EXTENSION;
}

@Override
// not used in BalanceFile
public int[] getFileHeader() {
throw new UnsupportedOperationException("Not supported in BalanceFile");
}

@Override
// not used in BalanceFile
public byte[] getSigFileHeader() {
throw new UnsupportedOperationException("Not supported in BalanceFile");
public boolean isCorrectFile(final String fileName) {
return fileName.endsWith(ACCOUNT_BALANCE_EXTENSION);
}
}

0 comments on commit 4073d24

Please sign in to comment.