mirror of
https://github.com/gosticks/iota.lib.java.git
synced 2025-10-16 11:45:37 +00:00
Merge pull request #28 from jpkrohling/JPK-TransferShouldNotRequireTag
Fixes #23 - Transfer should not require a tag
This commit is contained in:
commit
d8f9c9f39a
@ -144,8 +144,12 @@ public class InputValidator {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if tag is correct trytes of {0,27} trytes
|
||||
return isTrytes(transfer.getTag(), 27);
|
||||
if (null == transfer.getTag() || transfer.getTag().isEmpty()) {
|
||||
return true;
|
||||
} else {
|
||||
// Check if tag is correct trytes of {0,27} trytes
|
||||
return isTrytes(transfer.getTag(), 27);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -52,6 +52,8 @@ public class InputValidatorTest {
|
||||
List<Transfer> transfers = new ArrayList<>();
|
||||
transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, TEST_TAG));
|
||||
transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, TEST_TAG));
|
||||
transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, null));
|
||||
transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITH_CHECKSUM, 0, TEST_MESSAGE, ""));
|
||||
assertEquals(InputValidator.isTransfersCollectionValid(transfers), true);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user