Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #34 from nervosnetwork/add-missing-gw
Browse files Browse the repository at this point in the history
fix: Add missing gw prefix
  • Loading branch information
RetricSu authored Jul 23, 2021
2 parents dceb4dd + 28c4c55 commit 49b26d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/api-server/src/methods/modules/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1173,8 +1173,8 @@ async function ethContractAddressToAccountId(
}
// todo: support create2 contract address in which case it has not been created.
try {
const scriptHash = await rpc.get_script_hash_by_short_address(address);
const accountId = await rpc.get_account_id_by_script_hash(scriptHash);
const scriptHash = await rpc.gw_get_script_hash_by_short_address(address);
const accountId = await rpc.gw_get_account_id_by_script_hash(scriptHash);
console.log(`eth contract address: ${address}, account id: ${accountId}`);
return accountId == null ? undefined : +accountId;
} catch (error) {
Expand Down Expand Up @@ -1298,7 +1298,7 @@ async function allTypeEthAddressToAccountId(
address: string
): Promise<number | null> {
const scriptHash = ethAddressToScriptHash(address);
let accountId = await rpc.get_account_id_by_script_hash(scriptHash);
let accountId = await rpc.gw_get_account_id_by_script_hash(scriptHash);
if (accountId === null || accountId === undefined) {
accountId = await ethContractAddressToAccountId(address, rpc);
}
Expand Down Expand Up @@ -1326,7 +1326,7 @@ async function buildEthCallTx(txCallObj: TransactionCallObject, rpc: RPC) {
typeof fromAddress === "string"
) {
const fromScriptHash = ethAddressToScriptHash(fromAddress);
fromId = await rpc.get_account_id_by_script_hash(fromScriptHash);
fromId = await rpc.gw_get_account_id_by_script_hash(fromScriptHash);
console.log(`fromId: ${fromId}`);
}
const toId = await ethContractAddressToAccountId(toAddress, rpc);
Expand Down

0 comments on commit 49b26d5

Please sign in to comment.