From 69841d4df537a5bc1aa40090840c114d2b469f92 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Sun, 13 May 2018 11:59:24 -0400 Subject: [PATCH 1/4] Sharding: dynamically load deposit amount from config.go Former-commit-id: 14b48ff7efe688e4ea126db301a6d23a358060ed [formerly 77862c2e72e4f725a0ba7115ab16cd5f0b9dd774] Former-commit-id: 359cd27670f304baa484b9dbeccff29b66accce4 --- cmd/utils/flags.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 968a92aca..a4eadcf09 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -55,6 +55,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/p2p/netutil" "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/sharding" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "gopkg.in/urfave/cli.v1" ) @@ -536,7 +537,7 @@ var ( //Sharding Settings DepositFlag = cli.BoolFlag{ Name: "deposit", - Usage: "To become a notary with your sharding client, 100 ETH will be deposited from user's account into SMC ", + Usage: "To become a notary with your sharding client, " + new(big.Int).Div(sharding.NotaryDeposit, new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil)).String() + " ETH will be deposited into SMC", } ) From 6df9fddf7c22ae991404af0341f596e8f02057c2 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Sun, 13 May 2018 12:35:28 -0400 Subject: [PATCH 2/4] Sharding: fix error msg Former-commit-id: 6b79f8caeb23aa405180a8f776eabdacbf35f765 [formerly e5d0d702cc93fbd3c13e0abf09606c82a37734ab] Former-commit-id: 325a592978a92840d74844fae594bc927da8af4b --- sharding/notary/notary.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding/notary/notary.go b/sharding/notary/notary.go index 1922ccadc..dd428e97a 100644 --- a/sharding/notary/notary.go +++ b/sharding/notary/notary.go @@ -137,7 +137,7 @@ func submitCollation(shardID int64) error { // into contract. func joinNotaryPool(c client.Client) error { if !c.DepositFlagSet() { - return errors.New("join notary pool called when deposit flag was not set") + return errors.New("joinNotaryPool called when deposit flag was not set") } log.Info("Joining notary pool") From ce900f9bd7ad3819aae7ed8879b629782aeb1ea1 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Sun, 13 May 2018 12:37:58 -0400 Subject: [PATCH 3/4] Sharding: check flag value Former-commit-id: f1bd210017d236d1ebafdd9b404be6b4731c75ed [formerly adc011704641d4830e6e46acbc6b33c2eb06ba92] Former-commit-id: 0071f67a01cff53eaa8ba8a888aecc16f9150b8d --- sharding/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding/client/client.go b/sharding/client/client.go index 0b4b5735a..e0fcd2389 100644 --- a/sharding/client/client.go +++ b/sharding/client/client.go @@ -242,5 +242,5 @@ func initSMC(c *shardingClient) (*contracts.SMC, error) { } func (c *shardingClient) DepositFlagSet() bool { - return false + return c.ctx.GlobalBool(utils.DepositFlag.Name) } From f1d8accaeb2eec70bb7f3cf5d9abfdf6eb36b9ca Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Sun, 13 May 2018 13:21:21 -0400 Subject: [PATCH 4/4] Sharding: added function doc Former-commit-id: 0c20f0ed1c23a9b72620db14470239f71775ab82 [formerly 57d3964723de6bbd16dfc289730665aab89b60e8] Former-commit-id: 83cb53bfc1eca388184d2d72910831d11181f14c --- sharding/client/client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/sharding/client/client.go b/sharding/client/client.go index e0fcd2389..769ce50dd 100644 --- a/sharding/client/client.go +++ b/sharding/client/client.go @@ -241,6 +241,7 @@ func initSMC(c *shardingClient) (*contracts.SMC, error) { return contract, nil } +// DepositFlagSet returns true for cli flag --deposit. func (c *shardingClient) DepositFlagSet() bool { return c.ctx.GlobalBool(utils.DepositFlag.Name) }