def test_invalid_secret_and_passphrase(self): with self.assertRaises(XRPLModelException): Sign( transaction=_TRANSACTION, secret=_SECRET, passphrase=_PASSPHRASE, )
def test_invalid_secret_and_key_type(self): with self.assertRaises(XRPLModelException): Sign( transaction=_TRANSACTION, secret=_SECRET, key_type="secp256k1", )
def test_invalid_seed_hex_and_passphrase(self): with self.assertRaises(XRPLModelException): Sign( transaction=_TRANSACTION, seed_hex=_SEED_HEX, passphrase=_PASSPHRASE, )
def test_invalid_seed_and_seed_hex(self): with self.assertRaises(XRPLModelException): Sign( transaction=_TRANSACTION, seed=_SEED, seed_hex=_SEED_HEX, )
def test_from_dict_recursive_transaction_tx_json(self): transaction = CheckCreate.from_dict(check_create_dict) sign_dict = {"secret": secret, "tx_json": transaction.to_dict()} sign = Sign.from_dict(sign_dict) expected_dict = { **sign_dict, "tx_json": transaction.to_dict(), "method": "sign", "fee_mult_max": 10, "fee_div_max": 1, "offline": False, } self.assertEqual(expected_dict, sign.to_dict())
def test_valid_seed(self): request = Sign(transaction=_TRANSACTION, seed=_SEED, key_type=CryptoAlgorithm.SECP256K1) self.assertTrue(request.is_valid())
def test_valid_secret(self): request = Sign( transaction=_TRANSACTION, secret=_SECRET, ) self.assertTrue(request.is_valid())
def test_invalid_secret_and_seed(self): with self.assertRaises(XRPLModelException): Sign(transaction=_TRANSACTION, secret=_SECRET, seed=_SEED)
def test_is_dict_of_model_when_not_true(self): self.assertFalse( Sign.is_dict_of_model( IssuedCurrencyAmount.from_dict(amount_dict).to_dict(), ), )