use of tech.pegasys.signers.secp256k1.multikey.MetadataFileFixture.PREFIX_ADDRESS in project signers by ConsenSys.
the class SigningMetadataTomlConfigLoaderTest method loadAvailableConfigsReturnsAllValidMetadataFilesInDirectory.
@Test
void loadAvailableConfigsReturnsAllValidMetadataFilesInDirectory() {
final Filter<Path> filter = entry -> true;
final FileBasedSigningMetadataFile metadataFile1 = copyMetadataFileToDirectory(configsDirectory, LOWERCASE_ADDRESS + CONFIG_FILE_EXTENSION, KEY_FILE, PASSWORD_FILE);
final FileBasedSigningMetadataFile metadataFile2 = copyMetadataFileToDirectory(configsDirectory, "bar_" + PREFIX_ADDRESS + CONFIG_FILE_EXTENSION, KEY_FILE_2, PASSWORD_FILE_2);
final FileBasedSigningMetadataFile metadataFile3 = copyMetadataFileToDirectory(configsDirectory, PREFIX_LOWERCASE_DUPLICATE_FILENAME_2, KEY_FILE_2, PASSWORD_FILE_2);
final FileBasedSigningMetadataFile metadataFile4 = copyMetadataFileToDirectory(configsDirectory, PREFIX_LOWERCASE_DUPLICATE_FILENAME_1, KEY_FILE, PASSWORD_FILE);
// duplicate files are loaded at this stage since addresses aren't checked until signers are
// created
final Collection<SigningMetadataFile> metadataFiles = loader.loadAvailableSigningMetadataTomlConfigs(filter);
assertThat(metadataFiles).hasSize(4);
assertThat(metadataFiles).containsOnly(metadataFile1, metadataFile2, metadataFile3, metadataFile4);
}
use of tech.pegasys.signers.secp256k1.multikey.MetadataFileFixture.PREFIX_ADDRESS in project signers by ConsenSys.
the class FileBasedSigningMetadataFileTest method matchingMetadataFileWithPrefixShouldHaveExpectedName.
@Test
void matchingMetadataFileWithPrefixShouldHaveExpectedName() {
final String prefix = "bar_";
final FileBasedSigningMetadataFile fileBasedSigningMetadataFile = load(prefix + PREFIX_ADDRESS + CONFIG_FILE_EXTENSION, KEY_FILE, PASSWORD_FILE);
assertThat(fileBasedSigningMetadataFile.getFilename()).matches(prefix + PREFIX_ADDRESS + CONFIG_FILE_EXTENSION);
assertThat(fileBasedSigningMetadataFile.getConfig().getKeystoreFile().toFile().toString()).matches(KEY_FILE);
assertThat(fileBasedSigningMetadataFile.getConfig().getKeystorePasswordFile().toFile().toString()).matches(PASSWORD_FILE);
}
Aggregations