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

Support Timepoint, Duration #866

Merged
merged 4 commits into from
Jun 20, 2023
Merged

Support Timepoint, Duration #866

merged 4 commits into from
Jun 20, 2023

Conversation

jayz22
Copy link
Contributor

@jayz22 jayz22 commented Jun 20, 2023

What

Resolves #724

  • Implement {Timepoint, Duration} <-> u64 conversions
  • A drive-by clean up for get_current_call_stack to return Address
  • Clean up some trailing whitespaces in env.json

Why

[TODO: Why this change is being made. Include any context required to understand the why.]

Known limitations

[TODO or N/A]

@jayz22 jayz22 requested review from graydon, sisuresh and a team as code owners June 20, 2023 14:54
@leighmcculloch
Copy link
Member

What's the win out of having these two disjoint types when they're just u64 values?

I think I missed the conversation when we added them.

@jayz22
Copy link
Contributor Author

jayz22 commented Jun 20, 2023

What's the win out of having these two disjoint types when they're just u64 values?

I think I missed the conversation when we added them.

They are special case u64 subtypes that can have different semantics and operations. They can represent for example ledger timestamp and can specify its own display format (instead of a plain u64). Similar to how String, Symbol are related to Bytes.
For now we just support them by converting them to and from u64, which is the bare minimum so that the guest can implement the semantics in ways they want. We might enrich them post V1.

soroban-env-common/env.json Outdated Show resolved Hide resolved
@leighmcculloch leighmcculloch merged commit e7d6c8c into stellar:main Jun 20, 2023
9 checks passed
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

Successfully merging this pull request may close these issues.

Add host functions to transport objects between host and guest memory for String, Timepoint, Duration
2 participants