Skip to content

Commit

Permalink
allow only from for contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlincecum committed Jul 10, 2024
1 parent 5be0776 commit 4efb839
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transaction/quai-transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ export class QuaiTransaction extends AbstractTransaction<Signature> implements Q
if (!this.originZone) {
throw new Error('Invalid Zone for from address');
}
if (!(this.from && this.to)) {
throw new Error('Missing from or to address');
if (!this.from) {
throw new Error('Missing from address');
}

const isSameLedger = isQuaiAddress(this.from) === isQuaiAddress(this.to);
const isSameLedger = !this.to || isQuaiAddress(this.from) === isQuaiAddress(this.to);
if (this.isExternal && !isSameLedger) {
throw new Error('Cross-zone & cross-ledger transactions are not supported');
}
Expand Down

0 comments on commit 4efb839

Please sign in to comment.