Repository navigation
Expand file tree
/
Copy pathIotaLocalPoWTest.java
More file actions
44 lines (36 loc) · 1.77 KB
/
Copy pathIotaLocalPoWTest.java
File metadata and controls
44 lines (36 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package jota;
import cfb.pearldiver.PearlDiverLocalPoW;
import jota.dto.response.SendTransferResponse;
import jota.error.*;
import jota.model.Transfer;
import org.hamcrest.core.IsNull;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertThat;
/**
* Created by pinpong on 01.10.17.
*/
public class IotaLocalPoWTest {
private static final String TEST_SEED1 = "IHDEENZYITYVYSPKAURUZAQKGVJEREFDJMYTANNXXGPZ9GJWTEOJJ9IPMXOGZNQLSNMFDSQOTZAEETUEA";
private static final String TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2_2 = "RXTLHYQWBSJUZQXUS9LMLBE9RLAQFNDWBMZUGYJRJRHYRQQKVXBXJKEZOJDCVKFXM9GXYNMKTESEEILAYFCTLW9DQD";
private static final String TEST_MESSAGE = "JUSTANOTHERJOTATEST";
private static final String TEST_TAG = "JOTASPAM9999999999999999999";
private static final int MIN_WEIGHT_MAGNITUDE = 14;
private static final int DEPTH = 9;
private IotaAPI iotaClient;
@Before
public void createApiClientInstance() {
iotaClient = new IotaAPI.Builder().localPoW(new PearlDiverLocalPoW()).build();
}
@Ignore
@Test
public void shouldSendTransfer() throws ArgumentException, InvalidSignatureException, InvalidBundleException, NotEnoughBalanceException, InvalidSecurityLevelException, InvalidTrytesException, InvalidAddressException, InvalidTransferException {
List<Transfer> transfers = new ArrayList<>();
transfers.add(new jota.model.Transfer(TEST_ADDRESS_WITHOUT_CHECKSUM_SECURITY_LEVEL_2_2, 0, TEST_MESSAGE, TEST_TAG));
SendTransferResponse str = iotaClient.sendTransfer(TEST_SEED1, 2, DEPTH, MIN_WEIGHT_MAGNITUDE, transfers, null, null);
assertThat(str.getSuccessfully(), IsNull.notNullValue());
}
}