Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addressToScript not support data2 #645

Open
gpBlockchain opened this issue Nov 13, 2024 · 3 comments
Open

addressToScript not support data2 #645

gpBlockchain opened this issue Nov 13, 2024 · 3 comments
Assignees

Comments

@gpBlockchain
Copy link

code

it("address",async ()=>{
        let addr = scriptToAddress({
            args: "0x1234",
            codeHash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
            hashType: "data2"
        })

        console.log(addressToScript(addr))
    })

err


'ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwspqjxsd5mrgy' is not a valid address
Error: '0x4' is not a valid hash type
    at isPayloadValid (node_modules/@nervosnetwork/ckb-sdk-utils/src/address/index.ts:263:15)
    at parseAddress (node_modules/@nervosnetwork/ckb-sdk-utils/src/address/index.ts:300:5)
    at addressToScript (node_modules/@nervosnetwork/ckb-sdk-utils/src/address/index.ts:314:31)

if (hashType > 2) {
throw new HashTypeException(`0x${hashType.toString(16)}`)
}

@Keith-CY
Copy link
Member

code

it("address",async ()=>{
        let addr = scriptToAddress({
            args: "0x1234",
            codeHash: "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
            hashType: "data2"
        })

        console.log(addressToScript(addr))
    })

err


'ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwspqjxsd5mrgy' is not a valid address
Error: '0x4' is not a valid hash type
    at isPayloadValid (node_modules/@nervosnetwork/ckb-sdk-utils/src/address/index.ts:263:15)
    at parseAddress (node_modules/@nervosnetwork/ckb-sdk-utils/src/address/index.ts:300:5)
    at addressToScript (node_modules/@nervosnetwork/ckb-sdk-utils/src/address/index.ts:314:31)

if (hashType > 2) {
throw new HashTypeException(`0x${hashType.toString(16)}`)
}

hash type: data2 will be supported in 3 days.

@Keith-CY
Copy link
Member

Should be fixed by #648

@Keith-CY
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants