mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 08:44:28 +00:00
Merge pull request #118 from prestonvanloon/fix/already-deposited
Only deposit as notary if not already deposited Former-commit-id: eaaacb92c2f79f4664279a3bcc5973ad89241b42 [formerly b95f0e744d05df2590d868ed447fb2d8dffbceba] Former-commit-id: 0d4c692f25a765f1e8529cdbc95d4593aeefd0f7
This commit is contained in:
commit
5359cf04a9
@ -140,6 +140,10 @@ func joinNotaryPool(c client.Client) error {
|
||||
return errors.New("joinNotaryPool called when deposit flag was not set")
|
||||
}
|
||||
|
||||
if b, err := isAccountInNotaryPool(c); b || err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Info("Joining notary pool")
|
||||
txOps, err := c.CreateTXOpts(sharding.NotaryDeposit)
|
||||
if err != nil {
|
||||
|
@ -138,4 +138,20 @@ func TestJoinNotaryPool(t *testing.T) {
|
||||
if big.NewInt(1).Cmp(numNotaries) != 0 {
|
||||
t.Fatalf("Unexpected number of notaries. Got %d, wanted 1.", numNotaries)
|
||||
}
|
||||
|
||||
// Trying to join while deposited should do nothing
|
||||
err = joinNotaryPool(client)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
backend.Commit()
|
||||
|
||||
numNotaries, err = smc.NotaryPoolLength(&bind.CallOpts{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if big.NewInt(1).Cmp(numNotaries) != 0 {
|
||||
t.Fatalf("Unexpected number of notaries. Got %d, wanted 1.", numNotaries)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user