-
Notifications
You must be signed in to change notification settings - Fork 233
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
Add support for Soroban external calls 🎉 #1679
Add support for Soroban external calls 🎉 #1679
Conversation
Signed-off-by: salaheldinsoliman <[email protected]>
a659b6a
to
2708969
Compare
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
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.
Please rename Expression::PointerPosition
Looks great otherwise!
src/emit/expression.rs
Outdated
Expression::PointerPosition { pointer } => { | ||
let ptr = expression(target, bin, pointer, vartab, function, ns); | ||
let data = bin.vector_bytes(ptr); | ||
let res = bin | ||
.builder | ||
.build_ptr_to_int(data, bin.context.i64_type(), "sesa"); | ||
|
||
res.unwrap().into() | ||
} |
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.
Please help me understand Expression::PointerPosition
. It takes a vector (e.g. Type::DynamicString
), gets the pointer and converts the pointer to i64
(even though pointers are 32 bit in wasm).
How about renaming it to Expression::VectorData
?
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.
The expression is used to get the ptr position in linear memory as an i64
, then it is passed to Soroban's host (as a param to a host function that needs it)
The i64
rationale is that Soroban host always takes i64
values. And that expression is only used in Soroban at the moment
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
Signed-off-by: salaheldinsoliman <[email protected]>
07ad1a1
into
hyperledger-solang:main
This PR adds support for Soroban external calls. This is the first step to support value transfers from inside Soroban contracts.
What a follow up PR should do is support encoding/decoding of a bigger range of value types.