Skip to content

Commit

Permalink
fix: for PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
boolafish committed Dec 10, 2019
1 parent 9d59c37 commit f0153d2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ contract FeeClaimOutputToPaymentTxCondition is ISpendingCondition {

/**
* @dev This implementation checks signature for spending fee claim output. It should be signed with the owner signature.
* The fee claim output that is spendable would be following GenericTransaction Output format.
* @param feeTxBytes Encoded fee transaction, in bytes
* The fee claim output that is spendable follows Fungible Token Output format.
* @param feeTxBytes Encoded fee transaction
* @param feeClaimOutputIndex Output index of the fee claim output
* @param feeTxPos The tx position of the fee tx
* @param paymentTxBytes Payment transaction (in bytes) that spends the fee claim output
Expand All @@ -56,15 +56,15 @@ contract FeeClaimOutputToPaymentTxCondition is ISpendingCondition {
returns (bool)
{
require(feeClaimOutputIndex == 0, "Fee claim output must be the first output of fee tx");

GenericTransaction.Transaction memory feeTx = GenericTransaction.decode(feeTxBytes);
GenericTransaction.Output memory feeClaimOutput = GenericTransaction.getOutput(feeTx, feeClaimOutputIndex);

require(feeTx.txType == feeTxType, "Fee tx is not with the expected tx type");
require(feeClaimOutput.outputType == feeClaimOutputType, "Fee claim output is not with the expected output type");
require(feeTx.txType == feeTxType, "Unexpected tx type for fee transaction");
require(feeClaimOutput.outputType == feeClaimOutputType, "Unexpected output type for fee claim output");

PaymentTransactionModel.Transaction memory paymentTx = PaymentTransactionModel.decode(paymentTxBytes);
require(paymentTx.txType == paymentTxType, "The payment tx is not with the expected tx type");
require(paymentTx.txType == paymentTxType, "Unexpected tx type for payment transaction");

UtxoPosLib.UtxoPos memory utxoPos = UtxoPosLib.build(TxPosLib.TxPos(feeTxPos), feeClaimOutputIndex);
require(
Expand Down
2 changes: 1 addition & 1 deletion plasma_framework/contracts/src/exits/fee/FeeExitGame.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity 0.5.11;

/**
* It is by desing to be an empty contract. We only wants to be able to register the tx type to the framework.
* It is by desing to be an empty contract. We only want to be able to register the tx type to the framework.
* For simplicity, a fee claiming tx does not have the ability to exit directly.
* It should be first spend to a Payment tx and then exit the fund from Payment tx.
*/
Expand Down
4 changes: 2 additions & 2 deletions plasma_framework/test/endToEndTests/FeeClaim.e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ contract('PlasmaFramework - Fee Claim', ([_, _maintainer, authority, richFather,
return this.ethVault.deposit(depositTx, { from: alice, value: DEPOSIT_VALUE });
});

describe('When Alice transfer to Bob, fee is implicitly collected', () => {
describe('When Alice transfers to Bob, fee is implicitly collected', () => {
let aliceBalanceUtxoPosAfterTransferToBob;
let aliceTransferToBobTxBytes;

Expand Down Expand Up @@ -138,7 +138,7 @@ contract('PlasmaFramework - Fee Claim', ([_, _maintainer, authority, richFather,
await this.framework.submitBlock(merkleTree.root, { from: authority });
});

describe('When Alice transfer to Carol, fee is implicitly collected', () => {
describe('When Alice transfers to Carol, fee is implicitly collected', () => {
let aliceTransferToCarolTxBytes;

before(async () => {
Expand Down
2 changes: 1 addition & 1 deletion plasma_framework/test/helpers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class FeeBlockNumOutput {


/**
* Fee Transaction is not really following the full rule of GenericTransaction.
* Fee Transaction does not follows Generic Transaction format.
* It diverges in the output data structure by having two output data structures:
* 1. GenericTransactionOutput
* 2. FeeBlockNumOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ contract('FeeClaimOutputToPaymentTxCondition', ([richFather, bob]) => {
);
});

it('should fail when fee tx type does not match', async () => {
it('should fail when fee tx is not with the expected tx type', async () => {
const { args } = getTestData();
const mismatchFeeTxType = 999;
const conditionWithDifferentTxType = await FeeClaimOutputToPaymentTxCondition.new(
Expand All @@ -105,11 +105,11 @@ contract('FeeClaimOutputToPaymentTxCondition', ([richFather, bob]) => {
args.inputIndex,
args.signature,
),
'Fee tx is not with the expected tx type',
'Unexpected tx type for fee transaction',
);
});

it('should fail when fee claim output type does not match', async () => {
it('should fail when fee claim output is not with the expected output type', async () => {
const { args } = getTestData();
const mismatchFeeClaimOutputType = 999;
const conditionWithDifferentTxType = await FeeClaimOutputToPaymentTxCondition.new(
Expand All @@ -125,11 +125,11 @@ contract('FeeClaimOutputToPaymentTxCondition', ([richFather, bob]) => {
args.inputIndex,
args.signature,
),
'Fee claim output is not with the expected output type',
'Unexpected output type for fee claim output',
);
});

it('should fail when payment tx type does not match', async () => {
it('should fail when payment tx is not with the expected tx type', async () => {
const { args } = getTestData();
const mismatchPaymentTxType = 999;
const conditionWithDifferentTxType = await FeeClaimOutputToPaymentTxCondition.new(
Expand All @@ -145,7 +145,7 @@ contract('FeeClaimOutputToPaymentTxCondition', ([richFather, bob]) => {
args.inputIndex,
args.signature,
),
'The payment tx is not with the expected tx type',
'Unexpected tx type for payment transaction',
);
});

Expand Down

0 comments on commit f0153d2

Please sign in to comment.