GT-0 fixing junit tests

This commit is contained in:
ghidravore
2019-11-29 18:40:49 -05:00
parent cb36be2296
commit ac66dab16b
2 changed files with 9 additions and 2 deletions
@@ -37,8 +37,9 @@ public class AddressBasedIndexMapper implements IndexMapper {
public BigInteger map(BigInteger value) {
Address address = from.getAddress(value);
if (address == null) {
return null;
return BigInteger.ZERO;
}
return to.getIndex(address);
BigInteger mapped = to.getIndex(address);
return mapped != null ? mapped : BigInteger.ZERO;
}
}
@@ -33,5 +33,11 @@ public interface IndexMapper {
}
};
/**
* Maps an index from one address mapping to another. This method will return
* {@link BigInteger#ZERO} if there no mapping.
* @param value the index value to map from an old index map to a new index map
* @return the mapped index
*/
public BigInteger map(BigInteger value);
}