コード例 #1
0
 def test_invalid_secret_and_passphrase(self):
     with self.assertRaises(XRPLModelException):
         Sign(
             transaction=_TRANSACTION,
             secret=_SECRET,
             passphrase=_PASSPHRASE,
         )
コード例 #2
0
 def test_invalid_secret_and_key_type(self):
     with self.assertRaises(XRPLModelException):
         Sign(
             transaction=_TRANSACTION,
             secret=_SECRET,
             key_type="secp256k1",
         )
コード例 #3
0
 def test_invalid_seed_hex_and_passphrase(self):
     with self.assertRaises(XRPLModelException):
         Sign(
             transaction=_TRANSACTION,
             seed_hex=_SEED_HEX,
             passphrase=_PASSPHRASE,
         )
コード例 #4
0
 def test_invalid_seed_and_seed_hex(self):
     with self.assertRaises(XRPLModelException):
         Sign(
             transaction=_TRANSACTION,
             seed=_SEED,
             seed_hex=_SEED_HEX,
         )
コード例 #5
0
    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())
コード例 #6
0
 def test_valid_seed(self):
     request = Sign(transaction=_TRANSACTION,
                    seed=_SEED,
                    key_type=CryptoAlgorithm.SECP256K1)
     self.assertTrue(request.is_valid())
コード例 #7
0
 def test_valid_secret(self):
     request = Sign(
         transaction=_TRANSACTION,
         secret=_SECRET,
     )
     self.assertTrue(request.is_valid())
コード例 #8
0
 def test_invalid_secret_and_seed(self):
     with self.assertRaises(XRPLModelException):
         Sign(transaction=_TRANSACTION, secret=_SECRET, seed=_SEED)
コード例 #9
0
 def test_is_dict_of_model_when_not_true(self):
     self.assertFalse(
         Sign.is_dict_of_model(
             IssuedCurrencyAmount.from_dict(amount_dict).to_dict(), ), )