File tree Expand file tree Collapse file tree 5 files changed +15
-15
lines changed
Expand file tree Collapse file tree 5 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ BEAM_EXPORT void Ctor(const Method::Create& r)
7979
8080 for (uint32_t i = 0 ; i < r.m_Validators ; i++)
8181 {
82- const auto & v = ((const ValidatorInit *)(&r + 1 ))[i];
82+ const auto & v = ((const State::Validator::Init *)(&r + 1 ))[i];
8383 _POD_ (vk.m_Address ) = v.m_Address ;
8484
8585 Env::Halt_if (!v.m_Stake );
Original file line number Diff line number Diff line change @@ -14,12 +14,6 @@ namespace PBFT
1414
1515 typedef HashValue Address;
1616
17- struct ValidatorInit {
18- Address m_Address;
19- Amount m_Stake;
20- PubKey m_Delegator;
21- };
22-
2317 // The contract implements the following logic:
2418 //
2519 // 1. At each block the node needs the current validator set. The info node needs is:
@@ -143,6 +137,12 @@ namespace PBFT
143137 // this is the part of interest to the node.
144138 uint64_t m_Weight;
145139 uint8_t m_Flags;
140+
141+ struct Init {
142+ Address m_Address;
143+ Amount m_Stake;
144+ PubKey m_Delegator;
145+ };
146146 };
147147
148148 struct ValidatorPlus
@@ -259,7 +259,7 @@ namespace PBFT
259259 static const uint32_t s_iMethod = 0 ;
260260 Settings m_Settings;
261261 uint32_t m_Validators;
262- // followed by array of ValidatorInit structs
262+ // followed by array of Validator::Init structs
263263 };
264264
265265 struct ValidatorStatusUpdate
Original file line number Diff line number Diff line change @@ -2250,7 +2250,7 @@ namespace bvm2 {
22502250 struct Args
22512251 :public Shaders::PBFT::Method::Create
22522252 {
2253- Shaders::PBFT::ValidatorInit m_pVals[nValidators];
2253+ Shaders::PBFT::State::Validator::Init m_pVals[nValidators];
22542254 } args;
22552255#pragma pack (pop)
22562256
Original file line number Diff line number Diff line change @@ -1865,7 +1865,7 @@ namespace beam
18651865 Shaders::PBFT::Method::Create m;
18661866 ZeroObject (m);
18671867
1868- std::vector<Shaders::PBFT::ValidatorInit > vVals;
1868+ std::vector<Shaders::PBFT::State::Validator::Init > vVals;
18691869 ECC::Scalar::Native sk;
18701870
18711871 m.m_Validators = 2 ;
@@ -1881,11 +1881,11 @@ namespace beam
18811881 vVals[0 ].m_Stake = Rules::Coin * 700 ;
18821882 vVals[1 ].m_Stake = Rules::Coin * 700 ;
18831883
1884- pKrn->m_Args .resize (sizeof (m) + sizeof (Shaders::PBFT::ValidatorInit ) * m.m_Validators );
1884+ pKrn->m_Args .resize (sizeof (m) + sizeof (Shaders::PBFT::State::Validator::Init ) * m.m_Validators );
18851885 memcpy (&pKrn->m_Args .front (), &m, sizeof (m));
18861886
18871887 if (m.m_Validators )
1888- memcpy (&pKrn->m_Args .front () + sizeof (m), &vVals.front (), sizeof (Shaders::PBFT::ValidatorInit ) * m.m_Validators );
1888+ memcpy (&pKrn->m_Args .front () + sizeof (m), &vVals.front (), sizeof (Shaders::PBFT::State::Validator::Init ) * m.m_Validators );
18891889
18901890 ECC::SetRandom (sk);
18911891 ECC::Point::Native ptFunds (beam::Zero);
Original file line number Diff line number Diff line change @@ -2982,7 +2982,7 @@ namespace
29822982 m.m_Validators = s_Validators;
29832983 m.m_Settings .m_aidStake = 7 ;
29842984
2985- std::vector<Shaders::PBFT::ValidatorInit > vVals;
2985+ std::vector<Shaders::PBFT::State::Validator::Init > vVals;
29862986 ECC::Scalar::Native sk;
29872987
29882988 vVals.resize (s_Validators);
@@ -2993,11 +2993,11 @@ namespace
29932993 vVals[i].m_Stake = Rules::Coin * 5000 ;
29942994 }
29952995
2996- pKrn->m_Args .resize (sizeof (m) + sizeof (Shaders::PBFT::ValidatorInit ) * m.m_Validators );
2996+ pKrn->m_Args .resize (sizeof (m) + sizeof (Shaders::PBFT::State::Validator::Init ) * m.m_Validators );
29972997 memcpy (&pKrn->m_Args .front (), &m, sizeof (m));
29982998
29992999 if (m.m_Validators )
3000- memcpy (&pKrn->m_Args .front () + sizeof (m), &vVals.front (), sizeof (Shaders::PBFT::ValidatorInit ) * m.m_Validators );
3000+ memcpy (&pKrn->m_Args .front () + sizeof (m), &vVals.front (), sizeof (Shaders::PBFT::State::Validator::Init ) * m.m_Validators );
30013001
30023002 sk.GenRandomNnz ();
30033003 ECC::Point::Native ptFunds (beam::Zero);
You can’t perform that action at this time.
0 commit comments