Skip to content

Commit

Permalink
Add FEE member to custom Dapp and in/out transfer transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
pablitovicente committed Jul 8, 2019
1 parent e629652 commit b1e2c12
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
12 changes: 1 addition & 11 deletions src/transactions/5_dapp_transaction.ts
Expand Up @@ -94,6 +94,7 @@ export class DappTransaction extends BaseTransaction {
public readonly containsUniqueData: boolean;
public readonly asset: DappAsset;
public static TYPE = 5;
public static FEE = DAPP_FEE.toString();

public constructor(rawTransaction: unknown) {
super(rawTransaction);
Expand Down Expand Up @@ -237,17 +238,6 @@ export class DappTransaction extends BaseTransaction {
);
}

if (!this.fee.eq(DAPP_FEE)) {
errors.push(
new TransactionError(
`Fee must be equal to ${DAPP_FEE}`,
this.id,
'.fee',
this.fee.toString(),
DAPP_FEE
)
);
}
const validLinkSuffix = ['.zip'];

if (errors.length > 0) {
Expand Down
13 changes: 1 addition & 12 deletions src/transactions/6_in_transfer_transaction.ts
Expand Up @@ -55,6 +55,7 @@ export const inTransferAssetFormatSchema = {
export class InTransferTransaction extends BaseTransaction {
public readonly asset: InTransferAsset;
public static TYPE = 6;
public static FEE = IN_TRANSFER_FEE.toString();

public constructor(rawTransaction: unknown) {
super(rawTransaction);
Expand Down Expand Up @@ -147,18 +148,6 @@ export class InTransferTransaction extends BaseTransaction {
);
}

if (!this.fee.eq(IN_TRANSFER_FEE)) {
errors.push(
new TransactionError(
`Fee must be equal to ${IN_TRANSFER_FEE}`,
this.id,
'.fee',
this.fee.toString(),
IN_TRANSFER_FEE
)
);
}

return errors;
}

Expand Down
13 changes: 1 addition & 12 deletions src/transactions/7_out_transfer_transaction.ts
Expand Up @@ -59,6 +59,7 @@ export class OutTransferTransaction extends BaseTransaction {
public readonly asset: OutTransferAsset;
public readonly containsUniqueData: boolean;
public static TYPE = 7;
public static FEE = OUT_TRANSFER_FEE.toString();

public constructor(rawTransaction: unknown) {
super(rawTransaction);
Expand Down Expand Up @@ -139,18 +140,6 @@ export class OutTransferTransaction extends BaseTransaction {
);
}

if (!this.fee.eq(OUT_TRANSFER_FEE)) {
errors.push(
new TransactionError(
`Fee must be equal to ${OUT_TRANSFER_FEE}`,
this.id,
'.fee',
this.fee.toString(),
OUT_TRANSFER_FEE
)
);
}

if (this.recipientId === '') {
errors.push(
new TransactionError(
Expand Down

0 comments on commit b1e2c12

Please sign in to comment.