Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lbqds committed Nov 21, 2024
1 parent e154bcb commit 0fb2509
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/web3/src/contract/dapp-tx-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You should have received a copy of the GNU Lesser General Public License
along with the library. If not, see <http://www.gnu.org/licenses/>.
*/

import { contractIdFromAddress } from '../address'
import { contractIdFromAddress, isContractAddress } from '../address'
import { Val } from '../api'
import {
AddressConst,
Expand Down Expand Up @@ -70,8 +70,7 @@ export class DappTransactionBuilder {
if (!isBase58(params.contractAddress)) {
throw new Error(`Invalid contract address: ${params.contractAddress}, expected a base58 string`)
}
const contractLockupScript = lockupScriptCodec.decode(base58ToBytes(params.contractAddress))
if (contractLockupScript.kind !== 'P2C') {
if (!isContractAddress(params.contractAddress)) {
throw new Error(`Invalid contract address: ${params.contractAddress}, expected a P2C address`)
}

Expand Down

0 comments on commit 0fb2509

Please sign in to comment.