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

#86dthh08k - Add currentHash method to the native LedgerContract #1258

Merged
merged 1 commit into from
May 24, 2024

Conversation

meevee98
Copy link
Contributor

How to Reproduce

from boa3.sc.compiletime import public
from boa3.sc.contracts import LedgerContract
from boa3.sc.types import UInt256
@public
def main() -> UInt256:
return LedgerContract.get_current_hash()

Tests

async def test_get_current_hash(self):
await self.set_up_contract('GetCurrentHash.py')
result, _ = await self.call('main', [], return_type=types.UInt256, signing_accounts=[self.genesis])
block_ = await self.get_last_block(self.called_tx)
expected = block_.hash()
self.assertEqual(expected, result)

@meevee98 meevee98 self-assigned this May 24, 2024
@melanke
Copy link
Contributor

melanke commented May 24, 2024

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.212% (-0.003%) from 91.215%
when pulling 7994610 on CU-86dthh08k
into 49731b6 on development.

@luc10921 luc10921 merged commit 504b102 into development May 24, 2024
5 checks passed
@luc10921 luc10921 deleted the CU-86dthh08k branch May 24, 2024 20:15
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.

4 participants