Skip to content

Commit

Permalink
fix indexing err on wasm-nft minting
Browse files Browse the repository at this point in the history
  • Loading branch information
Vritra4 committed Apr 30, 2024
1 parent c023dd8 commit 0655579
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions submodules/wasm-nft/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ func (sm WasmNFTSubmodule) handleMintEvent(ctx context.Context, event types.Even
}
}

err = sm.applyCollectionOwnerMap(ctx, data.ContractAddress, data.Minter, true)
err = sm.applyCollectionOwnerMap(ctx, data.ContractAddress, data.Owner, true)
if err != nil {
return cosmoserr.Wrap(err, "failed to insert collection into collectionOwnersMap")
}

token, err := sm.getIndexedNftFromVMStore(ctx, data.ContractAddress, data.TokenId, &data.Minter)
token, err := sm.getIndexedNftFromVMStore(ctx, data.ContractAddress, data.TokenId, &data.Owner)
if err != nil {
return cosmoserr.Wrap(err, "failed to get token info")
}
Expand All @@ -94,9 +94,9 @@ func (sm WasmNFTSubmodule) handleMintEvent(ctx context.Context, event types.Even
return cosmoserr.Wrap(err, "failed to set token")
}

err = sm.tokenOwnerMap.Set(ctx, collections.Join3(data.Minter, data.ContractAddress, data.TokenId), true)
err = sm.tokenOwnerMap.Set(ctx, collections.Join3(data.Owner, data.ContractAddress, data.TokenId), true)
if err != nil {
sm.Logger(ctx).Error("failed to insert into tokenOwnerSet", "minter", data.Minter, "collection-addr", data.ContractAddress, "token-id", token.Nft.TokenId, "error", err)
sm.Logger(ctx).Error("failed to insert into tokenOwnerSet", "minter", data.Minter, "owner", data.Owner, "collection-addr", data.ContractAddress, "token-id", token.Nft.TokenId, "error", err)
return cosmoserr.Wrap(err, "failed to insert into tokenOwnerSet")
}

Expand Down

0 comments on commit 0655579

Please sign in to comment.