Skip to content

Commit

Permalink
Apply recommendation on WalletAccountService and delete Kernel Starta…
Browse files Browse the repository at this point in the history
…ble Interface
  • Loading branch information
boubaker committed Oct 9, 2024
1 parent b60e9d5 commit 13bcc3d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@

import org.exoplatform.social.core.identity.model.Identity;

import io.meeds.wallet.model.*;

import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import io.meeds.wallet.model.ContractDetail;
import io.meeds.wallet.model.Wallet;
import io.meeds.wallet.model.WalletAddressLabel;
import io.meeds.wallet.model.WalletProvider;
import io.meeds.wallet.model.WalletState;
import io.meeds.wallet.model.WalletType;

/**
* A service to manage wallets of different types: user, space, admin
*/
@Service
@Primary
public interface WalletAccountService {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.SignatureException;
import java.util.*;

import jakarta.servlet.ServletContext;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.picocontainer.Startable;
import org.springframework.stereotype.Service;
import org.web3j.crypto.Keys;
import org.web3j.crypto.Sign;
import org.web3j.crypto.Sign.SignatureData;
Expand All @@ -78,14 +82,16 @@
import io.meeds.wallet.model.WalletProvider;
import io.meeds.wallet.model.WalletState;
import io.meeds.wallet.model.WalletType;
import io.meeds.wallet.service.WalletAccountService;
import io.meeds.wallet.service.WalletTokenAdminService;
import io.meeds.wallet.statistic.ExoWalletStatistic;
import io.meeds.wallet.statistic.ExoWalletStatisticService;
import io.meeds.wallet.storage.AddressLabelStorage;
import io.meeds.wallet.storage.WalletStorage;

public class WalletAccountServiceImpl implements WalletAccountService, ExoWalletStatisticService, Startable {
import jakarta.annotation.PostConstruct;
import jakarta.servlet.ServletContext;

@Service
public class WalletAccountServiceImpl implements WalletAccountService, ExoWalletStatisticService {

private static final String ERROR_BROADCASTING_EVENT_FOR_WALLET = "Error broadcasting event {} for wallet {}";

Expand Down Expand Up @@ -139,7 +145,7 @@ public WalletAccountServiceImpl(PortalContainer container,
}
}

@Override
@PostConstruct
public void start() {
// Ensure to make initialization after starting all other services of Wallet
PortalContainer.addInitTask(container.getPortalContext(), new RootContainer.PortalContainerPostInitTask() {
Expand All @@ -159,11 +165,6 @@ public void execute(ServletContext context, PortalContainer portalContainer) {
});
}

@Override
public void stop() {
// Nothing to stop
}

@Override
public Set<Wallet> listWallets() {
Set<Wallet> wallets = accountStorage.listWallets();
Expand Down

0 comments on commit 13bcc3d

Please sign in to comment.