proxyData -> assetData
This commit is contained in:
@@ -29,7 +29,7 @@ contract LibAssetProxyDecoder is
|
|||||||
string constant INVALID_ERC721_METADATA_LENGTH = "Metadata must have a length of at least 53.";
|
string constant INVALID_ERC721_METADATA_LENGTH = "Metadata must have a length of at least 53.";
|
||||||
|
|
||||||
/// @dev Decodes ERC721 Asset Proxy data
|
/// @dev Decodes ERC721 Asset Proxy data
|
||||||
function decodeERC20Data(bytes memory proxyData)
|
function decodeERC20Data(bytes memory assetData)
|
||||||
internal
|
internal
|
||||||
pure
|
pure
|
||||||
returns (
|
returns (
|
||||||
@@ -38,17 +38,17 @@ contract LibAssetProxyDecoder is
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
require(
|
require(
|
||||||
proxyData.length == 21,
|
assetData.length == 21,
|
||||||
INVALID_ERC20_METADATA_LENGTH
|
INVALID_ERC20_METADATA_LENGTH
|
||||||
);
|
);
|
||||||
proxyId = uint8(proxyData[0]);
|
proxyId = uint8(assetData[0]);
|
||||||
token = readAddress(proxyData, 1);
|
token = readAddress(assetData, 1);
|
||||||
|
|
||||||
return (proxyId, token);
|
return (proxyId, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @dev Decodes ERC721 Asset Proxy data
|
/// @dev Decodes ERC721 Asset Proxy data
|
||||||
function decodeERC721Data(bytes memory proxyData)
|
function decodeERC721Data(bytes memory assetData)
|
||||||
internal
|
internal
|
||||||
pure
|
pure
|
||||||
returns (
|
returns (
|
||||||
@@ -59,14 +59,14 @@ contract LibAssetProxyDecoder is
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
require(
|
require(
|
||||||
proxyData.length >= 53,
|
assetData.length >= 53,
|
||||||
INVALID_ERC721_METADATA_LENGTH
|
INVALID_ERC721_METADATA_LENGTH
|
||||||
);
|
);
|
||||||
proxyId = uint8(proxyData[0]);
|
proxyId = uint8(assetData[0]);
|
||||||
token = readAddress(proxyData, 1);
|
token = readAddress(assetData, 1);
|
||||||
tokenId = readUint256(proxyData, 21);
|
tokenId = readUint256(assetData, 21);
|
||||||
if (proxyData.length > 53) {
|
if (assetData.length > 53) {
|
||||||
data = readBytes(proxyData, 53);
|
data = readBytes(assetData, 53);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (proxyId, token, tokenId, data);
|
return (proxyId, token, tokenId, data);
|
||||||
|
@@ -409,7 +409,7 @@ describe('LibBytes', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.only('writeBytes', () => {
|
describe('writeBytes', () => {
|
||||||
it('should successfully write short, nested array of bytes when it takes up the whole array)', async () => {
|
it('should successfully write short, nested array of bytes when it takes up the whole array)', async () => {
|
||||||
const testBytesOffset = new BigNumber(0);
|
const testBytesOffset = new BigNumber(0);
|
||||||
const emptyByteArray = ethUtil.bufferToHex(new Buffer(shortTestBytesAsBuffer.byteLength));
|
const emptyByteArray = ethUtil.bufferToHex(new Buffer(shortTestBytesAsBuffer.byteLength));
|
||||||
|
Reference in New Issue
Block a user