Skip to content

Commit

Permalink
validator owner address to be changed on the stakingNFT transfer.
Browse files Browse the repository at this point in the history
  • Loading branch information
reddyismav committed Apr 2, 2021
1 parent 3116046 commit 987e9d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion root/src/mappings/staking-nft.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Transfer } from '../../generated/StakingNft/StakingNft'
import { StakingNFTTransfer } from '../../generated/schema'
import { StakingNFTTransfer, Validator } from '../../generated/schema'

// To be invoked when staking NFT contracts Transfer event to be emitted
//
Expand Down Expand Up @@ -27,6 +27,10 @@ export function handleTransfer(event: Transfer): void {
transactionHashes.push(event.transaction.hash)
entity.transactionHashes = transactionHashes

let validator = Validator.load(event.params.tokenId)
validator.owner = event.params.to

// save entity
entity.save()
validator.save()
}
1 change: 1 addition & 0 deletions root/subgraph.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ dataSources:
language: wasm/assemblyscript
entities:
- StakingNFTTransfer
- Validator
abis:
- name: StakingNft
file: ./abis/StakingNft.json
Expand Down

0 comments on commit 987e9d7

Please sign in to comment.