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

jsonrpc/usersvc: use best block height/time in view call #1094

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

jchappelow
Copy link
Member

Alternative to #1088
Resolves #1084

action get_post($id) public view {
    SELECT *, @block_timestamp as stamp, @height as height
    FROM posts
    WHERE id = $id;
}
 $  kwil-cli database call -i xc4503ccf15daada96e36cbbacf641f48ebc6226e28906c8757866b91 -a get_post 'id:3'
| content | height | id |   stamp    | title  | user_id |
+---------+--------+----+------------+--------+---------+
| hihi    |    842 |  3 | 1732569623 | title2 |       1 |

$  kwil-cli database call -i xc4503ccf15daada96e36cbbacf641f48ebc6226e28906c8757866b91 -a get_post 'id:3'
| content | height | id |   stamp    | title  | user_id |
+---------+--------+----+------------+--------+---------+
| hihi    |    843 |  3 | 1732569630 | title2 |       1 |

@jchappelow jchappelow added this to the v0.9.3 milestone Nov 25, 2024
@jchappelow jchappelow removed this from the v0.9.3 milestone Nov 25, 2024
@brennanjl brennanjl merged commit 19ac757 into kwilteam:main Nov 26, 2024
2 checks passed
@brennanjl
Copy link
Collaborator

@jchappelow could you also backport to preview?

@brennanjl brennanjl mentioned this pull request Nov 26, 2024
@jchappelow
Copy link
Member Author

Sure, just a sec.

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.

make @block_timestamp available in action call
2 participants