Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
3b4a1f47
Unverified
Commit
3b4a1f47
authored
Mar 29, 2021
by
Shawn Tabrizi
Committed by
GitHub
Mar 29, 2021
Browse files
Emit an Event for Random Block Selected in Auction (#2740)
* Update auctions.rs * Update auctions.rs
parent
d23a6d5a
Pipeline
#131164
failed with stages
in 25 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
runtime/common/src/auctions.rs
View file @
3b4a1f47
...
@@ -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
{
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment