Skip to content

Commit 3b753e6

Browse files
authored
Merge pull request #194 from iotaledger/fix/non-existing-address
Fix: Indexer plugin search query
2 parents 0dc4d00 + 59ce67f commit 3b753e6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/app/routes/explorer/Address.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ALIAS_ADDRESS_TYPE, NFT_ADDRESS_TYPE, TransactionHelper } from "@iota/iota.js";
1+
import { ALIAS_ADDRESS_TYPE, Bech32Helper, NFT_ADDRESS_TYPE, TransactionHelper } from "@iota/iota.js";
22
import React, { ReactNode } from "react";
33
import { Link, RouteComponentProps } from "react-router-dom";
44
import { ReactComponent as ChevronLeftIcon } from "../../../assets/chevron-left.svg";
@@ -42,6 +42,10 @@ class Address extends AsyncComponent<RouteComponentProps<AddressProps>, AddressS
4242
const nodeConfigService = ServiceFactory.get<NodeConfigService>("node-config");
4343
this._bech32Hrp = nodeConfigService.getBech32Hrp();
4444

45+
if (!Bech32Helper.matches(this.props.match.params.address, this._bech32Hrp)) {
46+
this.props.history.push(`/explorer/search/${this.props.match.params.address}`);
47+
}
48+
4549
this.state = {
4650
address: { ...Bech32AddressHelper.buildAddress(props.match.params.address, this._bech32Hrp) },
4751
outputs: [],

src/utils/outputsHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class OutputsHelper {
5050
// Basic output -> storage return address
5151
this.tryFetchOutputs(
5252
async query => indexerPlugin.basicOutputs(query),
53-
{ storageReturnAddressBech32: this.query },
53+
{ storageDepositReturnAddressBech32: this.query },
5454
AssociationType.BASIC_STORAGE_RETURN
5555
),
5656

@@ -113,7 +113,7 @@ export class OutputsHelper {
113113
// Nft output -> storage return address
114114
this.tryFetchOutputs(
115115
async query => indexerPlugin.nfts(query),
116-
{ storageReturnAddressBech32: this.query },
116+
{ storageDepositReturnAddressBech32: this.query },
117117
AssociationType.NFT_STORAGE_RETURN
118118
),
119119

0 commit comments

Comments
 (0)