diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/components/cathash/BucketConfig.java b/apps/desktop/desktop/src/main/java/bisq/desktop/components/cathash/BucketConfig.java index f6dc5f14b9..f02bd24602 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/components/cathash/BucketConfig.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/components/cathash/BucketConfig.java @@ -24,7 +24,7 @@ @Slf4j public abstract class BucketConfig { - static final String CURRENT_VERSION = "v1"; + static final int CURRENT_VERSION = 0; static final String DIGIT = "#"; static final String SHAPE_NUMBER = "#SHAPE_NUMBER#"; diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/components/cathash/CatHash.java b/apps/desktop/desktop/src/main/java/bisq/desktop/components/cathash/CatHash.java index f3d8a76475..0eada4e31a 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/components/cathash/CatHash.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/components/cathash/CatHash.java @@ -38,11 +38,11 @@ public static Image getImage(UserProfile userProfile) { userProfile.getAvatarVersion(), true); } - public static Image getImage(byte[] pubKeyHash, byte[] powSolution, String avatarVersion) { + public static Image getImage(byte[] pubKeyHash, byte[] powSolution, int avatarVersion) { return getImage(pubKeyHash, powSolution, avatarVersion, true); } - public static Image getImage(byte[] pubKeyHash, byte[] powSolution, String avatarVersion, boolean useCache) { + public static Image getImage(byte[] pubKeyHash, byte[] powSolution, int avatarVersion, boolean useCache) { byte[] combined = ByteArrayUtils.concat(powSolution, pubKeyHash); BigInteger input = new BigInteger(combined); if (useCache && CACHE.containsKey(input)) { @@ -61,14 +61,14 @@ public static Image getImage(byte[] pubKeyHash, byte[] powSolution, String avata return image; } - public static String currentAvatarsVersion() { + public static int currentAvatarsVersion() { return BucketConfig.CURRENT_VERSION; } - private static BucketConfig getBucketConfig(String avatarVersion) { + private static BucketConfig getBucketConfig(int avatarVersion) { BucketConfig bucketConfig; switch (avatarVersion) { - case "v1": { + case 0: { bucketConfig = new BucketConfigV1(); log.info("Creating v1 BucketConfig: {}", bucketConfig.getClass().getName()); } diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/user/user_profile/create/step2/CreateNewProfileStep2Controller.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/user/user_profile/create/step2/CreateNewProfileStep2Controller.java index 3a86bf3869..9ab66ae5c0 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/user/user_profile/create/step2/CreateNewProfileStep2Controller.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/user/user_profile/create/step2/CreateNewProfileStep2Controller.java @@ -38,7 +38,7 @@ @Slf4j public class CreateNewProfileStep2Controller implements InitWithDataController { - private static final String CURRENT_AVATARS_VERSION = CatHash.currentAvatarsVersion(); + private static final int CURRENT_AVATARS_VERSION = CatHash.currentAvatarsVersion(); @Getter @ToString diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/overlay/onboarding/create_profile/CreateProfileController.java b/apps/desktop/desktop/src/main/java/bisq/desktop/overlay/onboarding/create_profile/CreateProfileController.java index cc64ca0560..5bfe7df0ea 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/overlay/onboarding/create_profile/CreateProfileController.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/overlay/onboarding/create_profile/CreateProfileController.java @@ -46,7 +46,7 @@ @Slf4j public class CreateProfileController implements Controller { - private static final String CURRENT_AVATARS_VERSION = CatHash.currentAvatarsVersion(); + private static final int CURRENT_AVATARS_VERSION = CatHash.currentAvatarsVersion(); protected final CreateProfileModel model; @Getter diff --git a/user/src/main/java/bisq/user/identity/UserIdentityService.java b/user/src/main/java/bisq/user/identity/UserIdentityService.java index fd1ca20acc..f7b3cf85e2 100644 --- a/user/src/main/java/bisq/user/identity/UserIdentityService.java +++ b/user/src/main/java/bisq/user/identity/UserIdentityService.java @@ -173,7 +173,7 @@ public CompletableFuture createAndPublishNewUserProfile(String nic KeyPair keyPair, byte[] pubKeyHash, ProofOfWork proofOfWork, - String avatarVersion, + int avatarVersion, String terms, String statement) { String identityTag = nickName + "-" + Hex.encode(pubKeyHash); @@ -315,7 +315,7 @@ private CompletableFuture publishPublicUserProfile(UserProfile private UserIdentity createUserIdentity(String nickName, ProofOfWork proofOfWork, - String avatarVersion, + int avatarVersion, String terms, String statement, Identity identity) { diff --git a/user/src/main/java/bisq/user/profile/UserProfile.java b/user/src/main/java/bisq/user/profile/UserProfile.java index 9f33bf4384..aa7d321bb6 100644 --- a/user/src/main/java/bisq/user/profile/UserProfile.java +++ b/user/src/main/java/bisq/user/profile/UserProfile.java @@ -64,7 +64,7 @@ public static UserProfile from(UserProfile userProfile, String terms, String sta private final String nickName; // We need the proofOfWork for verification of the nym and cathash icon private final ProofOfWork proofOfWork; - private final String avatarVersion; + private final int avatarVersion; private final NetworkId networkId; private final String terms; private final String statement; @@ -75,7 +75,7 @@ public static UserProfile from(UserProfile userProfile, String terms, String sta public UserProfile(String nickName, ProofOfWork proofOfWork, - String avatarVersion, + int avatarVersion, NetworkId networkId, String terms, String statement) { diff --git a/user/src/main/proto/user.proto b/user/src/main/proto/user.proto index 9196a7e852..bb42540a3b 100644 --- a/user/src/main/proto/user.proto +++ b/user/src/main/proto/user.proto @@ -30,7 +30,7 @@ message UserProfile { security.ProofOfWork proofOfWork = 3; string terms = 4; string statement = 5; - string avatarVersion = 6; + sint32 avatarVersion = 6; } message UserIdentity {