def test_to_xrpl_signer(self): tx = SignerListSet( account="rweYz56rfmQ98cAdRaeTxQS9wVMGnrdsFp", sequence=290, signer_quorum=1, signer_entries=[ SignerEntry( account="rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", signer_weight=1, ), ], ) expected = { "Account": "rweYz56rfmQ98cAdRaeTxQS9wVMGnrdsFp", "TransactionType": "SignerListSet", "Sequence": 290, "Flags": 0, "SigningPubKey": "", "SignerQuorum": 1, "SignerEntries": [{ "SignerEntry": { "Account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", "SignerWeight": 1, } }], } self.assertEqual(tx.to_xrpl(), expected)
def test_from_dict_signer(self): dictionary = { "account": "rpqBNcDpWaqZC2Rksayf8UyG66Fyv2JTQy", "fee": "10", "sequence": 16175710, "flags": 0, "signer_quorum": 1, "signer_entries": [{ "signer_entry": { "account": "rJjusz1VauNA9XaHxJoiwHe38bmQFz1sUV", "signer_weight": 1, } }], } expected = SignerListSet( account="rpqBNcDpWaqZC2Rksayf8UyG66Fyv2JTQy", fee="10", sequence=16175710, flags=0, signer_quorum=1, signer_entries=[ SignerEntry(account="rJjusz1VauNA9XaHxJoiwHe38bmQFz1sUV", signer_weight=1) ], ) actual = SignerListSet.from_dict(dictionary) self.assertEqual(actual, expected)
def test_add_signer(self): # sets up another signer for this account other_signer = Wallet.create() response = submit_transaction( SignerListSet( account=WALLET.classic_address, sequence=WALLET.sequence, signer_quorum=1, signer_entries=[ SignerEntry( account=other_signer.classic_address, signer_weight=1, ), ], ), WALLET, ) self.assertTrue(response.is_successful()) WALLET.sequence += 1
FEE = get_fee(JSON_RPC_CLIENT) # # Set up signer list FIRST_SIGNER = Wallet.create() SECOND_SIGNER = Wallet.create() LIST_SET_TX = sign_and_reliable_submission( SignerListSet( account=WALLET.classic_address, sequence=WALLET.next_sequence_num, last_ledger_sequence=WALLET.next_sequence_num + 10, fee=FEE, signer_quorum=2, signer_entries=[ SignerEntry( account=FIRST_SIGNER.classic_address, signer_weight=1, ), SignerEntry( account=SECOND_SIGNER.classic_address, signer_weight=1, ), ], ), WALLET, ) class TestSubmitMultisigned(TestCase): def test_basic_functionality(self): # # Perform multisign