aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-11-30 19:07:56 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commitc334a14b56c5a9239e9839c8bf870cb2425dc08f (patch)
tree4468c3dc69a12d2840e61e52c25fb1821a073934
parentf8434574451fd5684f1417de44f9da49d03eb207 (diff)
downloaddexon-c334a14b56c5a9239e9839c8bf870cb2425dc08f.tar
dexon-c334a14b56c5a9239e9839c8bf870cb2425dc08f.tar.gz
dexon-c334a14b56c5a9239e9839c8bf870cb2425dc08f.tar.bz2
dexon-c334a14b56c5a9239e9839c8bf870cb2425dc08f.tar.lz
dexon-c334a14b56c5a9239e9839c8bf870cb2425dc08f.tar.xz
dexon-c334a14b56c5a9239e9839c8bf870cb2425dc08f.tar.zst
dexon-c334a14b56c5a9239e9839c8bf870cb2425dc08f.zip
monkey: increase amount and send random amount (#70)
-rw-r--r--cmd/monkey/monkey.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/monkey/monkey.go b/cmd/monkey/monkey.go
index b312ea473..e7e5a53c9 100644
--- a/cmd/monkey/monkey.go
+++ b/cmd/monkey/monkey.go
@@ -216,7 +216,7 @@ func (m *Monkey) Distribute() {
for i, key := range m.keys {
address := crypto.PubkeyToAddress(key.PublicKey)
amount := new(big.Int)
- amount.SetString("1000000000000000000", 10)
+ amount.SetString("1000000000000000000000", 10)
ctxs[i] = &transferContext{
Key: m.source,
ToAddress: address,
@@ -237,10 +237,12 @@ func (m *Monkey) Crazy() {
ctxs := make([]*transferContext, len(m.keys))
for i, key := range m.keys {
to := crypto.PubkeyToAddress(m.keys[rand.Int()%len(m.keys)].PublicKey)
+ amount := new(big.Int)
+ amount.SetString(fmt.Sprintf("%d000000000000000", rand.Intn(10)+1), 10)
ctx := &transferContext{
Key: key,
ToAddress: to,
- Amount: big.NewInt(1),
+ Amount: amount,
Nonce: nonce,
Gas: 21000,
}