@@ -28,6 +28,34 @@ def test_it_should_sign_it_with_a_passphrase(passphrase, load_transaction_fixtur
2828 assert builder .transaction .data ['hash' ] == fixture ['data' ]['hash' ]
2929 assert builder .verify ()
3030
31+ def test_it_should_sign_with_a_legacy_second_signature (passphrase , second_passphrase , load_transaction_fixture ):
32+ fixture = load_transaction_fixture ('transactions/transfer-legacy-second-signature' )
33+
34+ builder = (
35+ TransferBuilder
36+ .new ()
37+ .gas_price (fixture ['data' ]['gasPrice' ])
38+ .nonce (fixture ['data' ]['nonce' ])
39+ .gas_limit (fixture ['data' ]['gasLimit' ])
40+ .to (fixture ['data' ]['to' ])
41+ .value (fixture ['data' ]['value' ])
42+ .legacy_second_sign (passphrase , second_passphrase )
43+ )
44+
45+ assert builder .transaction .data ['gasPrice' ] == int (fixture ['data' ]['gasPrice' ])
46+ assert builder .transaction .data ['gasLimit' ] == int (fixture ['data' ]['gasLimit' ])
47+ assert builder .transaction .data ['nonce' ] == fixture ['data' ]['nonce' ]
48+ assert builder .transaction .data ['to' ] == fixture ['data' ]['to' ]
49+ assert builder .transaction .data ['value' ] == int (fixture ['data' ]['value' ])
50+ assert builder .transaction .data ['v' ] == fixture ['data' ]['v' ]
51+ assert builder .transaction .data ['r' ] == fixture ['data' ]['r' ]
52+ assert builder .transaction .data ['s' ] == fixture ['data' ]['s' ]
53+ assert builder .transaction .data ['legacySecondSignature' ] == fixture ['data' ]['legacySecondSignature' ]
54+
55+ assert builder .transaction .serialize ().hex () == fixture ['serialized' ]
56+ assert builder .transaction .data ['hash' ] == fixture ['data' ]['hash' ]
57+ assert builder .verify ()
58+
3159def test_it_should_handle_unit_converter (passphrase , address ):
3260 builder = (
3361 TransferBuilder
0 commit comments