From 5e4e2c1fe8605d347de77a205ed0344d7a4dbbb3 Mon Sep 17 00:00:00 2001 From: Roman Serikov Date: Sun, 14 Feb 2021 00:42:28 +0300 Subject: [PATCH 1/3] Fix run code endpoint --- internal/noderpc/node_rpc.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/internal/noderpc/node_rpc.go b/internal/noderpc/node_rpc.go index 6a8245c60..41d44e868 100644 --- a/internal/noderpc/node_rpc.go +++ b/internal/noderpc/node_rpc.go @@ -19,9 +19,7 @@ import ( var json = jsoniter.ConfigCompatibleWithStandardLibrary const ( - headBlock = "head" - protocolEdo1 = "PtEdoTezd3RHSC31mpxxo1npxFjoWWcFgQtxapi51Z8TLu6v6Uq" - protocolEdo2 = "PtEdo2ZkT9oKpimTah6x2embF25oss54njMuPzkJTEi5RqfdZFA" + headBlock = "head" ) func getBlockString(level int64) string { @@ -303,11 +301,7 @@ func (rpc *NodeRPC) RunCode(script, storage, input gjson.Result, chainID, source "input": input.Value(), "amount": fmt.Sprintf("%d", amount), "chain_id": chainID, - } - - // TO-DO update with future protocols - if proto == protocolEdo1 || proto == protocolEdo2 { - data["balance"] = 0 + "balance": "0", } if gas != 0 { From 2d9e6b3d9617fa7a3068fce91679bfec85421073 Mon Sep 17 00:00:00 2001 From: m-kus Date: Sun, 14 Feb 2021 15:12:10 +0300 Subject: [PATCH 2/3] Hotfix(delphi): exclude balance field from the run_code request --- internal/noderpc/node_rpc.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/noderpc/node_rpc.go b/internal/noderpc/node_rpc.go index 41d44e868..72db083a8 100644 --- a/internal/noderpc/node_rpc.go +++ b/internal/noderpc/node_rpc.go @@ -301,9 +301,11 @@ func (rpc *NodeRPC) RunCode(script, storage, input gjson.Result, chainID, source "input": input.Value(), "amount": fmt.Sprintf("%d", amount), "chain_id": chainID, - "balance": "0", } + if proto != "PsDELPH1Kxsxt8f9eWbxQeRxkjfbxoqM52jvs5Y5fBxWWh4ifpo" { + data["balance"] = "0" + } if gas != 0 { data["gas"] = fmt.Sprintf("%d", gas) } From 140292977971ee7d393c5d0dcc1daa92fbf9b5d4 Mon Sep 17 00:00:00 2001 From: m-kus Date: Mon, 15 Feb 2021 14:54:50 +0300 Subject: [PATCH 3/3] switch to edo2net --- configs/development.yml | 8 ++++---- configs/production.yml | 8 ++++---- configs/you.yml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/configs/development.yml b/configs/development.yml index 85964661e..7704822c9 100644 --- a/configs/development.yml +++ b/configs/development.yml @@ -6,7 +6,7 @@ rpc: uri: https://rpc.tzkt.io/delphinet timeout: 20 edonet: - uri: https://rpc.tzkt.io/clarnet + uri: https://rpc.tzkt.io/edo2net timeout: 20 tzkt: @@ -21,9 +21,9 @@ tzkt: base_uri: https://delphi.tzkt.io/ timeout: 20 edonet: - uri: https://api.edonet.tzkt.io/v1/ - services_uri: https://services.tzkt.io/edonet/v1/ - base_uri: https://edonet.tzkt.io/ + uri: https://api.edo2net.tzkt.io/v1/ + services_uri: https://services.tzkt.io/edo2net/v1/ + base_uri: https://edo2net.tzkt.io/ timeout: 20 storage: diff --git a/configs/production.yml b/configs/production.yml index d4ca42d8d..024fd0daf 100644 --- a/configs/production.yml +++ b/configs/production.yml @@ -6,7 +6,7 @@ rpc: uri: https://rpc.tzkt.io/delphinet timeout: 20 edonet: - uri: https://rpc.tzkt.io/clarnet + uri: https://rpc.tzkt.io/edo2net timeout: 20 tzkt: @@ -21,9 +21,9 @@ tzkt: base_uri: https://delphi.tzkt.io/ timeout: 20 edonet: - uri: https://api.edonet.tzkt.io/v1/ - services_uri: https://services.tzkt.io/edonet/v1/ - base_uri: https://edonet.tzkt.io/ + uri: https://api.edo2net.tzkt.io/v1/ + services_uri: https://services.tzkt.io/edo2net/v1/ + base_uri: https://edo2net.tzkt.io/ timeout: 20 storage: diff --git a/configs/you.yml b/configs/you.yml index e33be998e..d8064a7bf 100644 --- a/configs/you.yml +++ b/configs/you.yml @@ -6,7 +6,7 @@ rpc: uri: https://delphinet-tezos.giganode.io timeout: 20 edonet: - uri: https://rpc.tzkt.io/clarnet + uri: https://rpc.tzkt.io/edo2net timeout: 20 tzkt: @@ -21,9 +21,9 @@ tzkt: base_uri: https://delphi.tzkt.io/ timeout: 20 edonet: - uri: https://api.edonet.tzkt.io/v1/ - services_uri: https://services.tzkt.io/edonet/v1/ - base_uri: https://edonet.tzkt.io/ + uri: https://api.edo2net.tzkt.io/v1/ + services_uri: https://services.tzkt.io/edo2net/v1/ + base_uri: https://edo2net.tzkt.io/ timeout: 20 storage: