Skip to content

Commit

Permalink
Intersect in multiprotocolapp
Browse files Browse the repository at this point in the history
  • Loading branch information
tkporter committed Nov 29, 2023
1 parent 825b309 commit 3b44c7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typescript/helloworld/src/multiProtocolApp/evmAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ export class EvmHelloWorldAdapter
destination: ChainName,
message: string,
value: string,
sender: Address,
): Promise<EthersV5Transaction> {
const contract = this.getConnectedContract();
const toDomain = this.multiProvider.getDomainId(destination);
const { transactionOverrides } = this.multiProvider.getChainMetadata(
this.chainName,
);
const signerAddress = await contract.signer.getAddress();

const quote = await contract.callStatic.quoteDispatch(
toDomain,
Expand All @@ -50,7 +50,7 @@ export class EvmHelloWorldAdapter
// Some networks, like PolygonZkEvm, require a `from` address
// with funds to be specified when estimating gas for a transaction
// that provides non-zero `value`.
from: signerAddress,
from: sender,
value: BigNumber.from(value).add(quote),
},
);
Expand Down
1 change: 1 addition & 0 deletions typescript/sdk/src/app/MultiProtocolApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export abstract class MultiProtocolApp<
public readonly addresses: ChainMap<ContractAddrs>,
public readonly logger = debug('hyperlane:MultiProtocolApp'),
) {
multiProvider = multiProvider.intersect(Object.keys(addresses)).result;
super(multiProvider.metadata);
}

Expand Down

0 comments on commit 3b44c7d

Please sign in to comment.