Minor styling and naming changes

This commit is contained in:
Amir Bandeali 2019-09-02 23:35:15 -07:00
parent 75a8b1c081
commit ea8669439f
8 changed files with 26 additions and 14 deletions

View File

@ -41,7 +41,7 @@ library LibZeroExTransaction {
struct ZeroExTransaction {
uint256 salt; // Arbitrary number to ensure uniqueness of transaction hash.
uint256 expirationTimeSeconds; // Timestamp in seconds at which transaction expires.
uint256 gasPrice; // gasPrice at which transaction is required to be executed with.
uint256 gasPrice; // gasPrice that transaction is required to be executed with.
address signerAddress; // Address of transaction signer.
bytes data; // AbiV2 encoded calldata.
}

View File

@ -120,14 +120,14 @@ contract MixinAssetProxyDispatcher is
);
// Call the asset proxy's transferFrom function with the constructed calldata.
(bool didSucceed, bytes memory revertData) = assetProxy.call(proxyCalldata);
(bool didSucceed, bytes memory returnData) = assetProxy.call(proxyCalldata);
// If the transaction did not succeed, revert with the returned data.
if (!didSucceed) {
LibRichErrors.rrevert(LibExchangeRichErrors.AssetProxyTransferError(
orderHash,
assetData,
revertData
returnData
));
}
}

View File

@ -483,7 +483,11 @@ contract MixinExchangeCore is
if (address(this).balance >= protocolFee) {
valuePaid = protocolFee;
}
IStaking(feeCollector).payProtocolFee.value(valuePaid)(order.makerAddress, takerAddress, protocolFee);
IStaking(feeCollector).payProtocolFee.value(valuePaid)(
order.makerAddress,
takerAddress,
protocolFee
);
} else {
fillResults.protocolFeePaid = 0;
}

View File

@ -513,7 +513,11 @@ contract MixinMatchOrders is
if (balance >= protocolFee) {
valuePaid = protocolFee;
}
IStaking(feeCollector).payProtocolFee.value(valuePaid)(leftOrder.makerAddress, takerAddress, protocolFee);
IStaking(feeCollector).payProtocolFee.value(valuePaid)(
leftOrder.makerAddress,
takerAddress,
protocolFee
);
// Pay the right order's protocol fee.
if (balance - valuePaid >= protocolFee) {
@ -521,7 +525,11 @@ contract MixinMatchOrders is
} else {
valuePaid = 0;
}
IStaking(feeCollector).payProtocolFee.value(valuePaid)(rightOrder.makerAddress, takerAddress, protocolFee);
IStaking(feeCollector).payProtocolFee.value(valuePaid)(
rightOrder.makerAddress,
takerAddress,
protocolFee
);
} else {
matchedFillResults.left.protocolFeePaid = 0;
matchedFillResults.right.protocolFeePaid = 0;

View File

@ -25,9 +25,9 @@ contract IEIP1271Wallet is
LibEIP1271
{
/// @dev Verifies that a signature is valid.
/// @param data Arbitrary data.
/// @param signature Signature of `data`.
/// @return magicValue .
/// @param data Arbitrary signed data.
/// @param signature Proof that data has been signed.
/// @return magicValue bytes4(0x20c13b0b) if the signature check succeeds.
function isValidSignature(
bytes calldata data,
bytes calldata signature

View File

@ -41,7 +41,7 @@ contract ISignatureValidator {
event SignatureValidatorApproval(
address indexed signerAddress, // Address that approves or disapproves a contract to verify signatures.
address indexed validatorAddress, // Address of signature validator contract.
bool approved // Approval or disapproval of validator contract.
bool isApproved // Approval or disapproval of validator contract.
);
/// @dev Approves a hash on-chain.

View File

@ -1152,7 +1152,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
const logArgs = log.args;
expect(logArgs.signerAddress).to.equal(signerAddress);
expect(logArgs.validatorAddress).to.equal(validatorWallet.address);
expect(logArgs.approved).to.equal(approval);
expect(logArgs.isApproved).to.equal(approval);
});
it('should emit a SignatureValidatorApprovalSet with correct args when a validator is disapproved', async () => {
const approval = false;
@ -1170,7 +1170,7 @@ blockchainTests.resets('MixinSignatureValidator', env => {
const logArgs = log.args;
expect(logArgs.signerAddress).to.equal(signerAddress);
expect(logArgs.validatorAddress).to.equal(validatorWallet.address);
expect(logArgs.approved).to.equal(approval);
expect(logArgs.isApproved).to.equal(approval);
});
});
});

View File

@ -611,7 +611,7 @@ blockchainTests.resets('Exchange transactions', env => {
>).args;
expect(validatorApprovalLogArgs.signerAddress).to.eq(takerAddress);
expect(validatorApprovalLogArgs.validatorAddress).to.eq(validatorAddress);
expect(validatorApprovalLogArgs.approved).to.eq(shouldApprove);
expect(validatorApprovalLogArgs.isApproved).to.eq(shouldApprove);
});
it('should approve a validator for the caller if called with no signature', async () => {
const shouldApprove = true;
@ -633,7 +633,7 @@ blockchainTests.resets('Exchange transactions', env => {
>).args;
expect(validatorApprovalLogArgs.signerAddress).to.eq(takerAddress);
expect(validatorApprovalLogArgs.validatorAddress).to.eq(validatorAddress);
expect(validatorApprovalLogArgs.approved).to.eq(shouldApprove);
expect(validatorApprovalLogArgs.isApproved).to.eq(shouldApprove);
});
});
describe('batchExecuteTransactions', () => {