Skip to content

Commit

Permalink
make event formatting prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahannan committed Apr 24, 2024
1 parent 263e30a commit b518689
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
18 changes: 16 additions & 2 deletions contracts/FungibleToken.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,14 @@ access(all) contract interface FungibleToken: ViewResolver {
//
self.balance == before(self.balance) - amount:
"New Vault balance must be the difference of the previous balance and the withdrawn Vault balance"
emit Withdrawn(type: result.getType().identifier, amount: amount, from: self.owner?.address, fromUUID: self.uuid, withdrawnUUID: result.uuid, balanceAfter: self.balance)
emit Withdrawn(
type: result.getType().identifier,
amount: amount,
from: self.owner?.address,
fromUUID: self.uuid,
withdrawnUUID: result.uuid,
balanceAfter: self.balance
)
}
}

Expand All @@ -200,7 +207,14 @@ access(all) contract interface FungibleToken: ViewResolver {
"Cannot deposit an incompatible token type"
}
post {
emit Deposited(type: before(from.getType().identifier), amount: before(from.balance), to: self.owner?.address, toUUID: self.uuid, depositedUUID: before(from.uuid), balanceAfter: self.balance)
emit Deposited(
type: before(from.getType().identifier),
amount: before(from.balance),
to: self.owner?.address,
toUUID: self.uuid,
depositedUUID: before(from.uuid),
balanceAfter: self.balance
)
self.balance == before(self.balance) + before(from.balance):
"New Vault balance must be the sum of the previous balance and the deposited Vault"
}
Expand Down
Loading

0 comments on commit b518689

Please sign in to comment.