package leigh.chain;

import leigh.mecha.log.MechaLogger;
import leigh.mecha.log.MechaLoggerFactory;
import org.junit.jupiter.api.Test;
import org.web3j.crypto.CipherException;
import org.web3j.crypto.WalletUtils;

import java.io.IOException;
import java.nio.file.Files;
import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;

public class WalletTest {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(WalletTest.class);

    @Test
    public void testWallet() throws IOException, InvalidAlgorithmParameterException, CipherException, NoSuchAlgorithmException, NoSuchProviderException {
        String fileName =
                WalletUtils.generateNewWalletFile( "abc123",
                        Files.createTempDirectory(null).toFile());

        logger.info("Created temporary wallet. [fn: {}]", fileName);
    }

}
