ran prettier and updated changelog
This commit is contained in:
parent
c68278d824
commit
cfc4e345cc
@ -1,4 +1,13 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "2.3.0",
|
||||||
|
"changes": [
|
||||||
|
{
|
||||||
|
"note": "Updated ERC1155 Asset Proxy. Less optimization. More explicit handling of edge cases.",
|
||||||
|
"pr": 1852
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"changes": [
|
"changes": [
|
||||||
|
@ -1532,17 +1532,12 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetData,
|
assetData,
|
||||||
);
|
);
|
||||||
const offsetToAssetData = "0000000000000000000000000000000000000000000000000000000000000080";
|
const offsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||||
const invalidOffsetToAssetData = "0000000000000000000000000000000000000000000000000000000000000180";
|
const invalidOffsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000180';
|
||||||
const badTxData = txData.replace(offsetToAssetData, invalidOffsetToAssetData);
|
const badTxData = txData.replace(offsetToAssetData, invalidOffsetToAssetData);
|
||||||
|
|
||||||
console.log(JSON.stringify(RevertReason.InvalidAssetData));
|
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedAsync(
|
||||||
erc1155ProxyWrapper.transferFromRawAsync(
|
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
|
||||||
badTxData,
|
|
||||||
authorized,
|
|
||||||
),
|
|
||||||
RevertReason.InvalidAssetDataLength,
|
RevertReason.InvalidAssetDataLength,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -1570,16 +1565,13 @@ describe('ERC1155Proxy', () => {
|
|||||||
assetData,
|
assetData,
|
||||||
);
|
);
|
||||||
// append asset data to end of tx data with a length of 0x300 bytes, which will extend past actual calldata.
|
// append asset data to end of tx data with a length of 0x300 bytes, which will extend past actual calldata.
|
||||||
const offsetToAssetData = "0000000000000000000000000000000000000000000000000000000000000080";
|
const offsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000080';
|
||||||
const invalidOffsetToAssetData = "0000000000000000000000000000000000000000000000000000000000000200";
|
const invalidOffsetToAssetData = '0000000000000000000000000000000000000000000000000000000000000200';
|
||||||
const newAssetData = "0000000000000000000000000000000000000000000000000000000000000304";
|
const newAssetData = '0000000000000000000000000000000000000000000000000000000000000304';
|
||||||
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
const badTxData = `${txData.replace(offsetToAssetData, invalidOffsetToAssetData)}${newAssetData}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedAsync(
|
||||||
erc1155ProxyWrapper.transferFromRawAsync(
|
erc1155ProxyWrapper.transferFromRawAsync(badTxData, authorized),
|
||||||
badTxData,
|
|
||||||
authorized,
|
|
||||||
),
|
|
||||||
RevertReason.InvalidAssetData,
|
RevertReason.InvalidAssetData,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -1610,7 +1602,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetDataWithExtraData,
|
assetDataWithExtraData,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidAssetDataLength
|
RevertReason.InvalidAssetDataLength,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should revert if length of assetData is less than 132 bytes', async () => {
|
it('should revert if length of assetData is less than 132 bytes', async () => {
|
||||||
@ -1623,7 +1615,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
// long and will trigger the `invalid length` error.
|
// long and will trigger the `invalid length` error.
|
||||||
// we must be sure to use a # of bytes that is still %32
|
// we must be sure to use a # of bytes that is still %32
|
||||||
// so that we know the error is not triggered by another check in the code.
|
// so that we know the error is not triggered by another check in the code.
|
||||||
const zeros96Bytes = "0".repeat(188);
|
const zeros96Bytes = '0'.repeat(188);
|
||||||
const assetData131Bytes = `${AssetProxyId.ERC1155}${zeros96Bytes}`;
|
const assetData131Bytes = `${AssetProxyId.ERC1155}${zeros96Bytes}`;
|
||||||
// execute transfer
|
// execute transfer
|
||||||
await expectTransactionFailedAsync(
|
await expectTransactionFailedAsync(
|
||||||
@ -1638,7 +1630,7 @@ describe('ERC1155Proxy', () => {
|
|||||||
authorized,
|
authorized,
|
||||||
assetData131Bytes,
|
assetData131Bytes,
|
||||||
),
|
),
|
||||||
RevertReason.InvalidAssetDataLength
|
RevertReason.InvalidAssetDataLength,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should transfer nothing if value is zero', async () => {
|
it('should transfer nothing if value is zero', async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user