Skip to content

Commit

Permalink
rename to createCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
waynehoover committed Jun 22, 2023
1 parent 5dadd68 commit 8253b97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contracts/QuestFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ contract QuestFactory is Initializable, OwnableUpgradeable, AccessControlUpgrade
/// @dev Create an ERC1155 QuestNFT collection
/// @param collectionName_ The collection name of the 1155 NFT contract
/// @return address the QuestNFT contract address
function createQuestNFT(string memory collectionName_) nonReentrant external returns (address) {
function createCollection(string memory collectionName_) nonReentrant external returns (address) {
address payable newQuestNFT = payable(Clones.cloneDeterministic(questNFTAddress, keccak256(abi.encodePacked(msg.sender, collectionName_))));

QuestNFTContract(newQuestNFT).initialize(
Expand Down
14 changes: 7 additions & 7 deletions test/QuestFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ describe('QuestFactory', () => {
})
})

describe('createQuestNFT()', () => {
describe('createCollection()', () => {
it('Should create a quest NFT collection', async () => {
const tx = await deployedFactoryContract.createQuestNFT('collectionName')
const tx = await deployedFactoryContract.createCollection('collectionName')
const receipt = await tx.wait()
let newQuestNFTAddress = ''

Expand All @@ -500,7 +500,7 @@ describe('QuestFactory', () => {
it('Should add a quest to a collection', async () => {
const totalParticipants = 10
const transferAmount = await deployedFactoryContract.totalQuestNFTFee(totalParticipants)
await deployedFactoryContract.createQuestNFT('collectionName')
await deployedFactoryContract.createCollection('collectionName')
const collectionAddress = await deployedFactoryContract.ownerCollections(owner.address, 0)

const tx = await deployedFactoryContract
Expand Down Expand Up @@ -535,7 +535,7 @@ describe('QuestFactory', () => {
it('Should revert when adding a quest to a collection with the same questid', async () => {
const totalParticipants = 10
const transferAmount = await deployedFactoryContract.totalQuestNFTFee(totalParticipants)
await deployedFactoryContract.createQuestNFT('collectionName')
await deployedFactoryContract.createCollection('collectionName')
const collectionAddress = await deployedFactoryContract.ownerCollections(owner.address, 0)

const tx = await deployedFactoryContract
Expand Down Expand Up @@ -570,7 +570,7 @@ describe('QuestFactory', () => {
it('Should revert when not passing the correct msg.value', async () => {
const totalParticipants = 10
const transferAmount = await deployedFactoryContract.totalQuestNFTFee(totalParticipants)
await deployedFactoryContract.createQuestNFT('collectionName')
await deployedFactoryContract.createCollection('collectionName')
const collectionAddress = await deployedFactoryContract.ownerCollections(owner.address, 0)

await expect(
Expand All @@ -591,7 +591,7 @@ describe('QuestFactory', () => {
it('Should revert when not passing the correct msg.value', async () => {
const totalParticipants = 10
const transferAmount = await deployedFactoryContract.totalQuestNFTFee(totalParticipants)
await deployedFactoryContract.createQuestNFT('collectionName')
await deployedFactoryContract.createCollection('collectionName')
const collectionAddress = await deployedFactoryContract.ownerCollections(owner.address, 0)

await expect(
Expand Down Expand Up @@ -622,7 +622,7 @@ describe('QuestFactory', () => {
const transferAmount = await deployedFactoryContract.totalQuestNFTFee(totalParticipants)
messageHash = utils.solidityKeccak256(['address', 'string'], [owner.address.toLowerCase(), nftQuestId])
signature = await wallet.signMessage(utils.arrayify(messageHash))
await deployedFactoryContract.createQuestNFT('collectionName')
await deployedFactoryContract.createCollection('collectionName')
const collectionAddresses = await deployedFactoryContract.ownerCollectionsByOwner(owner.address)
const collectionAddress = collectionAddresses[0]

Expand Down

0 comments on commit 8253b97

Please sign in to comment.