Skip to content

Commit

Permalink
Merge pull request #29 from sc0Vu/fix-26
Browse files Browse the repository at this point in the history
Fix #26
  • Loading branch information
sc0Vu committed Sep 21, 2020
2 parents e2f3461 + 8d2584e commit 5ae9729
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Transaction implements ArrayAccess
*
* @var array
*/
protected $txData;
protected $txData = [];

/**
* RLP encoding instance
Expand Down
17 changes: 17 additions & 0 deletions test/unit/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,21 @@ public function testIssue15()
$this->assertEquals($signedTransactions[0], $signedTransactions[$i]);
}
}

/**
* testIssue26
* default $txData should be empty array
*
* @return void
*/
public function testIssue26()
{
$tests = [
null, [], [null]
];
for ($i=0; $i<count($tests); $i++) {
$transaction = new Transaction($tests[i]);
$this->assertEquals($transaction->txData, []);
}
}
}

0 comments on commit 5ae9729

Please sign in to comment.