-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5018: Make it possible to query BidKind records in smart contracts r=igor-casper a=igor-casper It's been found desirable for smart contracts to be able to query global state for BidKind records like such: ```rs let key = Key::BidAddr(BidAddr::DelegatedPurse { validator, delegator }); let bid: BidKind = read_from_key(key); ``` The above snippet works under this PR. This was done by implementing ``CLTyped`` for ``BidKind``, and allowing ``CLValue`` to be constructed from ``StoredValue::BidKind`` using the ``TryFrom`` implementation. Appropriate tests have also been created, extending the ``staking-stored`` contract with this new functionality. Co-authored-by: igor-casper <igor@casper.network>
- Loading branch information
Showing
4 changed files
with
217 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters