Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collateral scale issue #64

Merged
merged 5 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build-and-test-clean": "rm -rf generated && graph codegen && graph build && graph test",
"create-local": "graph create --node http://localhost:8020/ ajna",
"remove-local": "graph remove --node http://localhost:8020/ ajna",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 ajna -l rc6",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 ajna -l rc7",
"test": "graph test"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/mappings/grant-fund.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export function handleVoteCast(event: VoteCastEvent): void {
const stage = getCurrentStage(voteCast.blockNumber, distributionPeriod)

// proposal is in screening stage
if (stage === "SCREENING") {
if (stage == "SCREENING") {
const screeningVotesCast = wadToDecimal(event.params.weight)
proposal.screeningVotesReceived = proposal.screeningVotesReceived.plus(screeningVotesCast)
distributionPeriod.screeningVotesCast = distributionPeriod.screeningVotesCast.plus(event.params.weight.toBigDecimal())
Expand Down Expand Up @@ -325,7 +325,7 @@ export function handleVoteCast(event: VoteCastEvent): void {
// save screeningVote to the store
screeningVote.save()
}
else if (stage === "FUNDING") {
else if (stage == "FUNDING") {
// create FundingVote entity
const fundingVote = loadOrCreateFundingVote(getFundingVoteId(proposalId, voter.id, distributionId))

Expand Down
2 changes: 1 addition & 1 deletion src/utils/pool/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export function updatePool(pool: Pool): void {
pool.quoteTokenBalance = wadToDecimal(unnormalizedTokenBalance.times(scaleFactor))
// update collateral token balances
// use the appropriate contract for querying balanceOf the pool
if (pool.poolType === 'Fungible') {
if (pool.poolType == 'Fungible') {
token = Token.load(pool.collateralToken)!
scaleFactor = TEN_BI.pow(18 - token.decimals as u8)
unnormalizedTokenBalance = getTokenBalance(Address.fromBytes(pool.collateralToken), poolAddress)
Expand Down
Loading