From e31858f9b866b66e592e0bef8c97975a80320d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camil=20B=C4=83ncioiu?= Date: Tue, 12 May 2020 19:15:19 +0300 Subject: [PATCH 1/3] Fix minor issue and add the GENESIS_DELAY option --- process/smartContract/process.go | 3 ++- scripts/testnet/include/config.sh | 3 ++- scripts/testnet/variables.sh | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/process/smartContract/process.go b/process/smartContract/process.go index 5556436c3e7..8e07973bbd4 100644 --- a/process/smartContract/process.go +++ b/process/smartContract/process.go @@ -540,7 +540,8 @@ func (sc *scProcessor) DeploySmartContract( func (sc *scProcessor) printScDeployed(vmOutput *vmcommon.VMOutput, tx data.TransactionHandler) { scGenerated := make([]string, 0, len(vmOutput.OutputAccounts)) - for addr := range vmOutput.OutputAccounts { + for key := range vmOutput.OutputAccounts { + addr := vmOutput.OutputAccounts[key].Address if !core.IsSmartContractAddress([]byte(addr)) { continue } diff --git a/scripts/testnet/include/config.sh b/scripts/testnet/include/config.sh index c9250877ea4..d2d7adbad9d 100644 --- a/scripts/testnet/include/config.sh +++ b/scripts/testnet/include/config.sh @@ -76,7 +76,7 @@ updateNodeConfig() { cp nodesSetup.json nodesSetup_edit.json - let startTime="$(date +%s) + $NODE_DELAY + 30" + let startTime="$(date +%s) + $GENESIS_DELAY" updateJSONValue nodesSetup_edit.json "startTime" "$startTime" if [ $ALWAYS_NEW_CHAINID -eq 1 ]; then @@ -96,6 +96,7 @@ copyProxyConfig() { cp $PROXYDIR/config/config.toml ./proxy/config/ cp ./node/config/economics.toml ./proxy/config/ + cp ./node/config/external.toml ./proxy/config/ cp ./node/config/walletKey.pem ./proxy/config echo "Copied configuration for the Proxy." diff --git a/scripts/testnet/variables.sh b/scripts/testnet/variables.sh index 1b245b26ec9..9fa1d2a9458 100644 --- a/scripts/testnet/variables.sh +++ b/scripts/testnet/variables.sh @@ -34,9 +34,10 @@ export NODE_NICENESS=10 # Delays after running executables. export SEEDNODE_DELAY=5 -export NODE_DELAY=10 +export GENESIS_DELAY=30 +export NODE_DELAY=$GENESIS_DELAY -#types of keys to generate +# Types of keys to generate export TX_SIGN_FORMAT="bech32" export BLOCK_SIGN_FORMAT="hex" From 356b2c0109030d48405536e70cdc54c3a253eaa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camil=20B=C4=83ncioiu?= Date: Wed, 13 May 2020 14:42:28 +0300 Subject: [PATCH 2/3] Fix after review --- process/smartContract/process.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/process/smartContract/process.go b/process/smartContract/process.go index 8e07973bbd4..44411e0b5ec 100644 --- a/process/smartContract/process.go +++ b/process/smartContract/process.go @@ -540,8 +540,12 @@ func (sc *scProcessor) DeploySmartContract( func (sc *scProcessor) printScDeployed(vmOutput *vmcommon.VMOutput, tx data.TransactionHandler) { scGenerated := make([]string, 0, len(vmOutput.OutputAccounts)) - for key := range vmOutput.OutputAccounts { - addr := vmOutput.OutputAccounts[key].Address + for _, account := range vmOutput.OutputAccounts { + if account == nil { + continue + } + + addr := account.Address if !core.IsSmartContractAddress([]byte(addr)) { continue } From 0a796a8d9d6206c126336e54e7bb236f1724f331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camil=20B=C4=83ncioiu?= Date: Wed, 13 May 2020 14:52:13 +0300 Subject: [PATCH 3/3] Revert default value of NODE_DELAY --- scripts/testnet/variables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/testnet/variables.sh b/scripts/testnet/variables.sh index 9fa1d2a9458..236e00e8b1c 100644 --- a/scripts/testnet/variables.sh +++ b/scripts/testnet/variables.sh @@ -35,7 +35,7 @@ export NODE_NICENESS=10 # Delays after running executables. export SEEDNODE_DELAY=5 export GENESIS_DELAY=30 -export NODE_DELAY=$GENESIS_DELAY +export NODE_DELAY=10 # Types of keys to generate export TX_SIGN_FORMAT="bech32"