Skip to content

Commit

Permalink
fix: Spotless on test
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan <[email protected]>
  • Loading branch information
ryan-s-roberts committed Jul 25, 2022
1 parent fc91130 commit ab555a9
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Blockchain Technology Partners
* Copyright 2021-2022 Blockchain Technology Partners
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -41,8 +41,7 @@ void store_coercion() throws StoreWriteException, StoreReadException {
var stub = new StubStore<ByteString, ByteString>();

var coerced = CoercingStore.from(
Bijection.of((DamlStateKey k) -> k.toByteString(),
API.unchecked((ByteString k) -> DamlStateKey.parseFrom(k))),
Bijection.of((DamlStateKey k) -> k.toByteString(), API.unchecked((ByteString k) -> DamlStateKey.parseFrom(k))),
Bijection.of((DamlStateValue v) -> v.toByteString(),
API.unchecked((ByteString v) -> DamlStateValue.parseFrom(v))),
stub);
Expand Down Expand Up @@ -72,16 +71,13 @@ private static byte[] asBytes(final UUID uuid) {
@Test
void txlog_coercion() throws StoreWriteException, StoreReadException {
var stub = new StubTransactionLog();
var coerced = CoercingTxLog
.from(
Bijection.of((DamlLogEntryId k) -> asUuid(k.getEntryId().toByteArray()),
(UUID k) -> DamlLogEntryId.newBuilder().setEntryId(ByteString.copyFrom(asBytes(k)))
.build()),
Bijection.of((DamlLogEntry v) -> v.toByteString(),
API.unchecked((ByteString v) -> DamlLogEntry.parseFrom(v))),
Bijection.of((Offset i) -> Longs.fromByteArray(i.toByteArray()),
(Long i) -> Offset$.MODULE$.fromByteArray(Longs.toByteArray(i))),
stub);
var coerced = CoercingTxLog.from(
Bijection.of((DamlLogEntryId k) -> asUuid(k.getEntryId().toByteArray()),
(UUID k) -> DamlLogEntryId.newBuilder().setEntryId(ByteString.copyFrom(asBytes(k))).build()),
Bijection.of((DamlLogEntry v) -> v.toByteString(), API.unchecked((ByteString v) -> DamlLogEntry.parseFrom(v))),
Bijection.of((Offset i) -> Longs.fromByteArray(i.toByteArray()),
(Long i) -> Offset$.MODULE$.fromByteArray(Longs.toByteArray(i))),
stub);

var id = coerced.begin(Optional.empty());
var data = DamlLogEntry.newBuilder().build();
Expand Down

0 comments on commit ab555a9

Please sign in to comment.