use of org.aion.rpc.types.RPCTypes.LockAccountParams in project aion by aionnetwork.
the class PersonalRPCImplTest method testPersonal_lockAccount.
@Test
public void testPersonal_lockAccount() {
AionAddress address = new AionAddress(ByteUtil.hexStringToBytes("a07913c03686c9659c1b614d098fd1db380a52b71fd58526b53d8107f7b355d5"));
String password0 = "password";
String password1 = "password1";
LockAccountParams params0 = new LockAccountParams(address, password0);
LockAccountParams params1 = new LockAccountParams(address, password1);
doReturn(false).when(chainHolder).lockAccount(eq(address), eq(password0));
doReturn(true).when(chainHolder).lockAccount(eq(address), eq(password1));
assertFalse(execute(new Request(idGenerator.generateID(), lockAccountMethod, LockAccountParamsConverter.encode(params0), VersionType.Version2), BoolConverter::decode));
assertTrue(execute(new Request(idGenerator.generateID(), lockAccountMethod, LockAccountParamsConverter.encode(params1), VersionType.Version2), BoolConverter::decode));
}
Aggregations