-
Notifications
You must be signed in to change notification settings - Fork 60
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
rusk-wallet: Implement http contract query #3169
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Daksh <[email protected]>
4d1b160
to
689d386
Compare
bc14031
to
eba9217
Compare
Why do you request gas price for contract query? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return value from http_contract_call
should be Option<Vec<u8>>
IMO
Just to be clear There is NO need to create a transaction to to query a contract, so I don't get which tx_hash this snippet refers to let http_call = wallet
.http_contract_call(contract_id, &fn_name, &fn_args)
.await?;
Ok(RunResult::ContractCall(tx.hash(), http_call)) |
@herr-seppia The http contract call is done alongside already existing tx contract call so if you do contract call it will send both the transaction and the http request to return values |
What's the need for sending both? |
@herr-seppia I combined them because if you wanna call If you want I can separate them that might save gas fees but the user might be confused |
let hash = hex::encode(scalar.to_bytes()); | ||
writeln!(f, "> Contract call transaction hash: {hash}",)?; | ||
|
||
writeln!(f, "> Http contract query: {:?}", bytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will give really ugly output, use hex::encode(bytes)
Don't mix the transactions and the queries pls About "save fees", there is no fee to save, since the query is free |
@herr-seppia Just so you know I'm aware the query is just an http request it not a transaction and there's no fees involved, I said fees because we might wanna do http call and not transaction contract call so that might save fees but I'll seperate both of them now I thought it made senese to do both of them together |
Closes #3108
Deploy
my_first_contract.wasm
Copy the generated contract_id and then contract callincrement
function 4 timesThen call
read_value
Only supports u32 return values