From 7c7d532980d2d3d53599e640a40a9eec971a1699 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Fri, 19 Jul 2024 15:54:15 +0200 Subject: [PATCH] rm more --- .../engine/cancun/step_devp2p_peering.nim | 64 ------------------- .../nodocker/engine/cancun/step_paralel.nim | 47 -------------- 2 files changed, 111 deletions(-) delete mode 100644 hive_integration/nodocker/engine/cancun/step_devp2p_peering.nim delete mode 100644 hive_integration/nodocker/engine/cancun/step_paralel.nim diff --git a/hive_integration/nodocker/engine/cancun/step_devp2p_peering.nim b/hive_integration/nodocker/engine/cancun/step_devp2p_peering.nim deleted file mode 100644 index 381174b56..000000000 --- a/hive_integration/nodocker/engine/cancun/step_devp2p_peering.nim +++ /dev/null @@ -1,64 +0,0 @@ -# Nimbus -# Copyright (c) 2023 Status Research & Development GmbH -# Licensed under either of -# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or -# http://www.apache.org/licenses/LICENSE-2.0) -# * MIT license ([LICENSE-MIT](LICENSE-MIT) or -# http://opensource.org/licenses/MIT) -# at your option. This file may not be copied, modified, or distributed except -# according to those terms. - -import - ./step - -# A step that attempts to peer to the client using devp2p, and checks the forkid of the client -type DevP2PClientPeering struct { - # Client index to peer to - ClientIndex uint64 -} - -func (step DevP2PClientPeering) Execute(t *CancunTestContext) error { - # Get client index's enode - if step.ClientIndex >= uint64(len(t.TestEngines)) { - return error "invalid client index %d", step.ClientIndex) - } - engine = t.Engines[step.ClientIndex] - conn, err = devp2p.PeerEngineClient(engine, env.clMock) - if err != nil { - return error "error peering engine client: %v", err) - } - defer conn.Close() - info "Connected to client %d, remote public key: %s", step.ClientIndex, conn.RemoteKey()) - - # Sleep - time.Sleep(1 * time.Second) - - # Timeout value for all requests - timeout = 20 * time.Second - - # Send a ping request to verify that we are not immediately disconnected - pingReq = &devp2p.Ping{} - if size, err = conn.Write(pingReq); err != nil { - return errors.Wrap(err, "could not write to conn") - else: - info "Wrote %d bytes to conn", size) - } - - # Finally wait for the pong response - msg, err = conn.WaitForResponse(timeout, 0) - if err != nil { - return errors.Wrap(err, "error waiting for response") - } - switch msg = msg.(type) { - case *devp2p.Pong: - info "Received pong response: %v", msg) - default: - return error "unexpected message type: %T", msg) - } - - return nil -} - -func (step DevP2PClientPeering) Description() string { - return fmt.Sprintf("DevP2PClientPeering: client %d", step.ClientIndex) -} \ No newline at end of file diff --git a/hive_integration/nodocker/engine/cancun/step_paralel.nim b/hive_integration/nodocker/engine/cancun/step_paralel.nim deleted file mode 100644 index de4a4c7c6..000000000 --- a/hive_integration/nodocker/engine/cancun/step_paralel.nim +++ /dev/null @@ -1,47 +0,0 @@ -# Nimbus -# Copyright (c) 2023 Status Research & Development GmbH -# Licensed under either of -# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or -# http://www.apache.org/licenses/LICENSE-2.0) -# * MIT license ([LICENSE-MIT](LICENSE-MIT) or -# http://opensource.org/licenses/MIT) -# at your option. This file may not be copied, modified, or distributed except -# according to those terms. - -import - ./step - -# A step that runs two or more steps in parallel -type ParallelSteps struct { - Steps []TestStep -} - -func (step ParallelSteps) Execute(t *CancunTestContext) error { - # Run the steps in parallel - wg = sync.WaitGroup{} - errs = make(chan error, len(step.Steps)) - for _, s = range step.Steps { - wg.Add(1) - go func(s TestStep) { - defer wg.Done() - if err = s.Execute(t); err != nil { - errs <- err - } - }(s) - } - wg.Wait() - close(errs) - for err = range errs { - return err - } - return nil -} - -func (step ParallelSteps) Description() string { - desc = "ParallelSteps: running steps in parallel:\n" - for i, step = range step.Steps { - desc += fmt.Sprintf("%d: %s\n", i, step.Description()) - } - - return desc -} \ No newline at end of file