mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-02-12 15:05:02 -05:00
squash backend changes (#438)
This commit is contained in:
@@ -35,10 +35,15 @@ export async function createQuest(
|
||||
throw new Error('Player not allowed to create quests');
|
||||
}
|
||||
|
||||
const { skills_id: skillsId, ...questValues } = quest;
|
||||
|
||||
const questInput: Quest_Insert_Input = {
|
||||
...quest,
|
||||
...questValues,
|
||||
repetition: questRepetition,
|
||||
created_by_player_id: playerId,
|
||||
quest_skills: {
|
||||
data: skillsId.map(s => ({ skill_id: s })),
|
||||
},
|
||||
};
|
||||
|
||||
const data = await client.CreateQuest({ objects: questInput });
|
||||
|
||||
@@ -17,7 +17,10 @@ export async function isAllowedToCreateQuest(
|
||||
const pSEEDBalance = await pSEEDContract.balanceOf(playerAddress);
|
||||
const pSEEDDecimals = await pSEEDContract.decimals();
|
||||
const minimumPooledSeedBalance = new BN(100);
|
||||
const pSEEDBalanceInDecimal = amountToDecimal(pSEEDBalance, pSEEDDecimals);
|
||||
const pSEEDBalanceInDecimal = amountToDecimal(
|
||||
pSEEDBalance.toString(),
|
||||
pSEEDDecimals,
|
||||
);
|
||||
|
||||
const allowed = new BN(pSEEDBalanceInDecimal).gt(minimumPooledSeedBalance);
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ export async function updateCompletion(
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
success: true,
|
||||
quest_completion_id: questCompletion.id,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user