diff --git a/ethereum/datastructures/src/main/java/tech/pegasys/artemis/datastructures/util/BeaconStateUtil.java b/ethereum/datastructures/src/main/java/tech/pegasys/artemis/datastructures/util/BeaconStateUtil.java index cd1f2cdbd5c..e2a95aa1a9b 100644 --- a/ethereum/datastructures/src/main/java/tech/pegasys/artemis/datastructures/util/BeaconStateUtil.java +++ b/ethereum/datastructures/src/main/java/tech/pegasys/artemis/datastructures/util/BeaconStateUtil.java @@ -1061,12 +1061,8 @@ public static UnsignedLong max(UnsignedLong value1, UnsignedLong value2) { * - Spec v0.4 */ public static UnsignedLong get_domain(Fork fork, UnsignedLong epoch, int domain_type) { - // TODO Investigate this further: - // We deviate from the spec, adding domain_type first then concatting fork version on to it. - // The spec does this in the opposite order. It smells a lot like an endianness problem. - // The question is, it is Java/us, or is it a spec bug. return UnsignedLong.valueOf( - bytes_to_int(Bytes.wrap(int_to_bytes(domain_type, 4), get_fork_version(fork, epoch)))); + bytes_to_int(Bytes.wrap(get_fork_version(fork, epoch), int_to_bytes(domain_type, 4)))); } /**