Skip to content

Commit

Permalink
Additional debugging output on several hardware wallet tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zulucrypto committed Aug 12, 2018
1 parent 351f0a0 commit c1f5db0
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/HardwareWallet/AccountMergeOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public function testMergeAccount()
'Merge Account: ',
' Source: ' . $sourceKeypair->getPublicKey(),
' Destination: ' . $destinationKeypair->getPublicKey(),
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
3 changes: 3 additions & 0 deletions tests/HardwareWallet/AllowTrustOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function testAllowTrust()
' Source: ' . $sourceKeypair->getPublicKey(),
' Asset: ' . $asset->getAssetCode(),
'Trusted Account: ' . $trustedKeypair->getPublicKey(),
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
3 changes: 3 additions & 0 deletions tests/HardwareWallet/BumpSequenceOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public function testSimpleBumpSequence()
' Bump Sequence: basic',
' Source: ' . $sourceKeypair->getPublicKey(),
' Bump To: ' . $bumpTo->toString(),
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
6 changes: 6 additions & 0 deletions tests/HardwareWallet/ChangeTrustOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function testAddMaxTrustline()
' Code: ' . $asset->getAssetCode(),
' Amount: ' . 'Maximum',
' Issuer: ' . $asset->getIssuer()->getAccountIdString(),
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand All @@ -58,6 +61,9 @@ public function testAddTrustline()
' Code: ' . $asset->getAssetCode(),
' Amount: ' . '1000',
' Issuer: ' . $asset->getIssuer()->getAccountIdString(),
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
3 changes: 3 additions & 0 deletions tests/HardwareWallet/CreateAccountOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public function testCreateAccount()
' Source: ' . $sourceKeypair->getPublicKey(),
'Creating account: ' . $newKeypair->getPublicKey(),
' Initial balance: ' . 100.0333,
'',
' B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
3 changes: 3 additions & 0 deletions tests/HardwareWallet/CreatePassiveOfferOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function testNewPassiveOffer()
' Source: ' . $sourceKeypair->getPublicKey(),
' Selling: ' . $amount . 'XLM',
' Buying: ' . 'For ' . $price . ' per ' . $buyingAsset->getAssetCode() . ' (' . $buyingAsset->getIssuer()->getAccountIdString() . ')',
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
3 changes: 3 additions & 0 deletions tests/HardwareWallet/ManageDataOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function testSetDataValue()
' Source: ' . $sourceKeypair->getPublicKey(),
' Key: ' . $dataKey,
' Value Hash: ' . hash('sha256', $dataValue),
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
3 changes: 3 additions & 0 deletions tests/HardwareWallet/ManageOfferOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function testNewOffer()
' Source: ' . $sourceKeypair->getPublicKey(),
' Selling: ' . $amount . 'XLM',
' Buying: ' . 'For ' . $price . ' per ' . $buyingAsset->getAssetCode() . ' (' . $buyingAsset->getIssuer()->getAccountIdString() . ')',
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
11 changes: 9 additions & 2 deletions tests/HardwareWallet/PathPaymentOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PathPaymentOpTest extends HardwareWalletIntegrationTest
/**
* @group requires-hardwarewallet
*/
public function testNativeAssetPaymentNoPaths()
public function testNativeAssetPathPaymentNoPaths()
{
$sourceKeypair = Keypair::newFromMnemonic($this->mnemonic);
$destKeypair = Keypair::newFromMnemonic($this->mnemonic, 'destination');
Expand Down Expand Up @@ -46,6 +46,9 @@ public function testNativeAssetPaymentNoPaths()
' Max Paid: ' . $maxAmount . ' XLM',
'Amount Received: ' . sprintf('%s %s (%s)', $receivesAmount, $receiverGetsAsset->getAssetCode(), $receiverGetsAsset->getIssuer()->getAccountIdString()),
' To: ' . $destKeypair->getPublicKey(),
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand All @@ -55,7 +58,7 @@ public function testNativeAssetPaymentNoPaths()
/**
* @group requires-hardwarewallet
*/
public function testNativeAssetPaymentOnePath()
public function testNativeAssetPathPaymentOnePath()
{
$sourceKeypair = Keypair::newFromMnemonic($this->mnemonic);
$destKeypair = Keypair::newFromMnemonic($this->mnemonic, 'destination');
Expand Down Expand Up @@ -90,6 +93,10 @@ public function testNativeAssetPaymentOnePath()
' Max Paid: ' . $maxAmount . ' XLM',
'Amount Received: ' . sprintf('%s %s (%s)', $receivesAmount, $receiverGetsAsset->getAssetCode(), $receiverGetsAsset->getIssuer()->getAccountIdString()),
' To: ' . $destKeypair->getPublicKey(),
' Path 1: ' . sprintf('%s (%s)', $pathAsset1->getAssetCode(), $pathAsset1->getIssuer()->getAccountIdString()),
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
9 changes: 9 additions & 0 deletions tests/HardwareWallet/PaymentOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public function testNativeAssetPayment()
'Source: ' . $sourceKeypair->getPublicKey(),
' Pay: ' . $amount . ' XLM',
' To: ' . $destKeypair->getPublicKey(),
'',
' B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down Expand Up @@ -91,6 +94,9 @@ public function testCustomAsset4Payment()
'Source: ' . $sourceKeypair->getPublicKey(),
' Pay: ' . sprintf('%s %s (%s)', $amount, $asset->getAssetCode(), $asset->getIssuer()->getAccountIdString()),
' To: ' . $destKeypair->getPublicKey(),
'',
' B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down Expand Up @@ -121,6 +127,9 @@ public function testCustomAsset7Payment()
'Source: ' . $sourceKeypair->getPublicKey(),
' Pay: ' . sprintf('%s %s (%s)', $amount, $asset->getAssetCode(), $asset->getIssuer()->getAccountIdString()),
' To: ' . $destKeypair->getPublicKey(),
'',
' B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down
3 changes: 3 additions & 0 deletions tests/HardwareWallet/SetOptionsOpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public function testSetInflationDestination()
' Set Option: inflation destination',
' Source: ' . $sourceKeypair->getPublicKey(),
'Inf. Destination: ' . $inflationDestination->getPublicKey(),
'',
'B64 Transaction: ' . base64_encode($transaction->toXdr()),
' Signature: ' . $knownSignature->getWithoutHintBase64(),
]));
$hardwareSignature = $transaction->signWith($this->horizonServer->getSigningProvider());

Expand Down

0 comments on commit c1f5db0

Please sign in to comment.