I'm trying to create a staking contract. I'm using self.blockchain().get_block_timestamp(); to figure out the amount of rewords that I should give to the client when it unstakes, claim, reinvest etc..
All is good in the mentioned cases. The problem arises in my report method. I have a mandos tests where I move foreword 1 seconds and when I interogate the report the estimations get recalculated and reported.
On devnet I get these estimation recalculated only the first time when I query the view. Then it seams that the view gets stuck in time untill some of the endpoints that modifiye the client section of the sorage is called.
Is there something specific that I should do or params that I should pass to make sure that the code from the view is recalculated every time based on the actual self.blockchain().get_block_timestamp(); of the interrogation time ?
It's a bit weird if you only increase it by 1 second, since a block is produced every 6 seconds, so maybe there is some rounding going on?
However it would still be weird, especially if you say that it gets stuck there. But can't really say much without seeing your code :)
It's a bit weird if you only increase it by 1 second, since a block is produced every 6 seconds, so maybe there is some rounding going on? However it would still be weird, especially if you say that it gets stuck there. But can't really say much without seeing your code :)