Skip to content

Commit

Permalink
Collateral scale issue (#64)
Browse files Browse the repository at this point in the history
* recommitting logging changes

* moar logging

* AssemblyScript uses === for reference comparison

* removed debugging statements

* eliminate more === where reference comparison undesirable
  • Loading branch information
EdNoepel authored Aug 28, 2023
1 parent 806565f commit 7a4d040
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit 7a4d040

Please sign in to comment.