Search in sources :

Example 1 with PasswordParams

use of org.aion.rpc.types.RPCTypes.PasswordParams in project aion by aionnetwork.

the class PersonalRPCImplTest method testPersonal_newAccount.

@Test
public void testPersonal_newAccount() {
    AionAddress expectedAddress = new AionAddress(ByteUtil.hexStringToBytes("a07913c03686c9659c1b614d098fd1db380a52b71fd58526b53d8107f7b355d5"));
    String password = "password";
    doReturn(expectedAddress).when(chainHolder).newAccount(anyString());
    Request request = new Request(idGenerator.generateID(), newAccountMethod, PasswordParamsConverter.encode(new PasswordParams(password)), VersionType.Version2);
    AionAddress responseAddress = execute(request, AddressConverter::decode);
    assertEquals(expectedAddress, responseAddress);
}
Also used : AionAddress(org.aion.types.AionAddress) PasswordParams(org.aion.rpc.types.RPCTypes.PasswordParams) Request(org.aion.rpc.types.RPCTypes.Request) AddressConverter(org.aion.rpc.types.RPCTypesConverter.AddressConverter) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Aggregations

PasswordParams (org.aion.rpc.types.RPCTypes.PasswordParams)1 Request (org.aion.rpc.types.RPCTypes.Request)1 AddressConverter (org.aion.rpc.types.RPCTypesConverter.AddressConverter)1 AionAddress (org.aion.types.AionAddress)1 Test (org.junit.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1