diff --git a/src/main/java/com/esaulpaugh/headlong/abi/Tuple.java b/src/main/java/com/esaulpaugh/headlong/abi/Tuple.java index 3a6e4994..55fa1bdf 100644 --- a/src/main/java/com/esaulpaugh/headlong/abi/Tuple.java +++ b/src/main/java/com/esaulpaugh/headlong/abi/Tuple.java @@ -38,18 +38,18 @@ public class Tuple implements Iterable { this.elements = elements; } - /** - * @see Single#of(Object) - * @return the pair - */ public static Tuple of() { return Tuple.EMPTY; } /** * @see Single#of(Object) - * @return the pair + * @return a tuple with one element */ + public static Single singleton(T element) { + return Single.of(element); + } + public static Pair of(A a, B b) { return new Pair<>(requireNoNulls(new Object[] { a, b })); } diff --git a/src/test/java/com/esaulpaugh/headlong/abi/PackedEncoderTest.java b/src/test/java/com/esaulpaugh/headlong/abi/PackedEncoderTest.java index a456a69b..1db426ac 100644 --- a/src/test/java/com/esaulpaugh/headlong/abi/PackedEncoderTest.java +++ b/src/test/java/com/esaulpaugh/headlong/abi/PackedEncoderTest.java @@ -89,7 +89,7 @@ public void testTupleArray() { new Single[] { Single.of(true), Single.of(false), - Single.of(true) + Tuple.singleton(true) } );