Skip to content

Commit

Permalink
additional changes from recipient_id
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley committed Nov 6, 2024
1 parent 8b650ce commit 4b278a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/Models/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ public function sender(): BelongsTo
*/
public function recipient(): Wallet
{
$recipientId = $this->recipient_id;
if (! is_null($recipientId)) {
return Wallet::where('address', $recipientId)->firstOrFail();
$recipient = $this->recipient_address;
if (! is_null($recipient)) {
return Wallet::where('address', $recipient)->firstOrFail();
}

$vote = Arr::get($this, 'asset.votes.0');
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Transactions/TransactionDirection.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public function isSent(string $address): bool

public function isReceived(string $address): bool
{
return $this->transaction->recipient_id === $address;
return $this->transaction->recipient_address === $address;
}
}
4 changes: 2 additions & 2 deletions app/ViewModels/Concerns/Transaction/InteractsWithWallets.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public function sender(): ?MemoryWallet

public function recipient(): ?MemoryWallet
{
if (is_null($this->transaction->recipient_id)) {
if (is_null($this->transaction->recipient_address)) {
return $this->sender();
}

return MemoryWallet::fromAddress($this->transaction->recipient_id);
return MemoryWallet::fromAddress($this->transaction->recipient_address);
}
}

0 comments on commit 4b278a0

Please sign in to comment.