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

[BUG] Error when calling a contract using contract package hash #5050

Closed
devendran-m opened this issue Jan 3, 2025 · 2 comments · Fixed by #5051
Closed

[BUG] Error when calling a contract using contract package hash #5050

devendran-m opened this issue Jan 3, 2025 · 2 comments · Fixed by #5051
Assignees
Labels
bug Something isn't working

Comments

@devendran-m
Copy link
Contributor

Bug reported by David Hernando from MAKE

Bug Description:

The reportee's question and error he faced;

With AddressableEntities off, is it possible to call a contract by its contract package hash? I get an error with rc5:

Error in request. [Code: -32016] Invalid transaction.
Data: "the transaction was invalid: no such package at hash"

This is how the transaction was built;

            "entry_point": {
              "Custom": "unstake"
            },
            "target": {
              "Stored": {
                "id": {
                  "ByPackageHash": {
                    "addr": "601d407c7f1e339f4afd8ab6fcc4edc53619b3986c1ae84a6b3791b2ae394f8c",
                    "version": null
                  }
                },
                "runtime": "VmCasperV1"
              }
            }

The user faced a similar error with account_put_deploy, however, according to him, calling the contract by package name works normally.

The user also reported;

I'm using an SDK, but also tried with casper-client to send the transaction.
This is when I realized the node may be expecting a Package, because casper client only accepts a package-0123...def style key.

casper-client put-transaction package -v -k /home/casper/casper-nctl/assets/net-1/users/user-1/secret_key.pem \
    -n http://127.0.0.1:11101/rpc \
    --package-address package-9761df244f22aa4538cc844d29892086330e37cf157b213a8991d648fde34b48 \
    --session-entry-point unstake \
    --pricing-mode classic \
    --standard-payment true \
    --chain-name casper-net-1 \
    -p 5000000000 \
    -g 1
@devendran-m
Copy link
Contributor Author

It is included in RC6

@davidatwhiletrue
Copy link

Tested on RC6, and working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants