Skip to content

Commit

Permalink
Improves names of orphan detect methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
steven2308 committed Jan 2, 2024
1 parent fdc6afb commit 5733efd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions contracts/RMRK/utils/RMRKCatalogUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ contract RMRKCatalogUtils {
* @param slotPartIds Array of slot part IDs of the parent token's assets to search for orphan equipments
* @return equipments Array of extended equipment data structs containing the equipment data, including the slot part ID
*/
function getOrphanedEquipmentsFromParentAsset(
function getOrphanEquipmentsFromParentAsset(
address parentAddress,
uint256 parentId,
address catalogAddress,
Expand Down Expand Up @@ -197,7 +197,7 @@ contract RMRKCatalogUtils {
* @param parentId ID of the parent token
* @return equipments Array of extended equipment data structs containing the equipment data, including the slot part ID
*/
function getOrphanedEquipmentFromChildAsset(
function getOrphanEquipmentsFromChildAsset(
address parentAddress,
uint256 parentId
) public view returns (ExtendedEquipment[] memory equipments) {
Expand Down
8 changes: 4 additions & 4 deletions docs/RMRK/utils/RMRKCatalogUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ Used to get the extended part data of many parts from the specified catalog in a
|---|---|---|
| parts | RMRKCatalogUtils.ExtendedPart[] | Array of extended part data structs containing the part data |

### getOrphanedEquipmentFromChildAsset
### getOrphanEquipmentsFromChildAsset

```solidity
function getOrphanedEquipmentFromChildAsset(address parentAddress, uint256 parentId) external view returns (struct RMRKCatalogUtils.ExtendedEquipment[] equipments)
function getOrphanEquipmentsFromChildAsset(address parentAddress, uint256 parentId) external view returns (struct RMRKCatalogUtils.ExtendedEquipment[] equipments)
```

Used to get data about children equipped to a specified token, where the child asset has been replaced.
Expand All @@ -106,10 +106,10 @@ Used to get data about children equipped to a specified token, where the child a
|---|---|---|
| equipments | RMRKCatalogUtils.ExtendedEquipment[] | Array of extended equipment data structs containing the equipment data, including the slot part ID |

### getOrphanedEquipmentsFromParentAsset
### getOrphanEquipmentsFromParentAsset

```solidity
function getOrphanedEquipmentsFromParentAsset(address parentAddress, uint256 parentId, address catalogAddress, uint64[] slotPartIds) external view returns (struct RMRKCatalogUtils.ExtendedEquipment[] equipments)
function getOrphanEquipmentsFromParentAsset(address parentAddress, uint256 parentId, address catalogAddress, uint64[] slotPartIds) external view returns (struct RMRKCatalogUtils.ExtendedEquipment[] equipments)
```

Used to get data about children equipped to a specified token, where the parent asset has been replaced.
Expand Down
20 changes: 10 additions & 10 deletions test/catalogUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ describe('Collection Utils For Orphans', function () {
true,
);

const equipments = await catalogUtils.getOrphanedEquipmentsFromParentAsset(
const equipments = await catalogUtils.getOrphanEquipmentsFromParentAsset(
soldier.address,
soldierID,
catalog.address,
Expand Down Expand Up @@ -300,16 +300,16 @@ describe('Collection Utils For Orphans', function () {
// Children still marked as equipped, so it cannot be transferred or equip something else into the slot
expect(await soldier.isChildEquipped(soldierID, weapon.address, weaponsIds[0])).to.eql(true);

expect(
await catalogUtils.getOrphanedEquipmentFromChildAsset(soldier.address, soldierID),
).to.eql([
expect(await catalogUtils.getOrphanEquipmentsFromChildAsset(soldier.address, soldierID)).to.eql(
[
bn(soldierResId),
bn(partIdForWeapon),
weapon.address,
weaponsIds[0],
bn(weaponAssetsEquip[0]),
[
bn(soldierResId),
bn(partIdForWeapon),
weapon.address,
weaponsIds[0],
bn(weaponAssetsEquip[0]),
],
],
]);
);
});
});

0 comments on commit 5733efd

Please sign in to comment.