Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
a6fd8f78
Commit
a6fd8f78
authored
4 years ago
by
Shawn Tabrizi
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Emit an Event for Random Block Selected in Auction (#2740)
* Update auctions.rs * Update auctions.rs
parent
8ebbe19d
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
polkadot/runtime/common/src/auctions.rs
+5
-0
5 additions, 0 deletions
polkadot/runtime/common/src/auctions.rs
with
5 additions
and
0 deletions
polkadot/runtime/common/src/auctions.rs
+
5
−
0
View file @
a6fd8f78
...
@@ -147,6 +147,9 @@ decl_event!(
...
@@ -147,6 +147,9 @@ decl_event!(
/// A new bid has been accepted as the current winner.
/// A new bid has been accepted as the current winner.
/// \[who, para_id, amount, first_slot, last_slot\]
/// \[who, para_id, amount, first_slot, last_slot\]
BidAccepted
(
AccountId
,
ParaId
,
Balance
,
LeasePeriod
,
LeasePeriod
),
BidAccepted
(
AccountId
,
ParaId
,
Balance
,
LeasePeriod
,
LeasePeriod
),
/// The winning offset was chosen for an auction. This will map into the `Winning` storage map.
/// \[auction_index, block_number\]
WinningOffset
(
AuctionIndex
,
BlockNumber
),
}
}
);
);
...
@@ -496,6 +499,8 @@ impl<T: Config> Module<T> {
...
@@ -496,6 +499,8 @@ impl<T: Config> Module<T> {
.expect
(
"secure hashes should always be bigger than the block number; qed"
);
.expect
(
"secure hashes should always be bigger than the block number; qed"
);
let
offset
=
(
raw_offset_block_number
%
ending_period
)
/
T
::
SampleLength
::
get
();
let
offset
=
(
raw_offset_block_number
%
ending_period
)
/
T
::
SampleLength
::
get
();
let
auction_counter
=
AuctionCounter
::
get
();
Self
::
deposit_event
(
RawEvent
::
WinningOffset
(
auction_counter
,
offset
));
let
res
=
Winning
::
<
T
>
::
get
(
offset
)
.unwrap_or_default
();
let
res
=
Winning
::
<
T
>
::
get
(
offset
)
.unwrap_or_default
();
let
mut
i
=
T
::
BlockNumber
::
zero
();
let
mut
i
=
T
::
BlockNumber
::
zero
();
while
i
<
ending_period
{
while
i
<
ending_period
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment