From 9b1786a4738bf0007fff775d9f42114e24ae026c Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Thu, 2 May 2024 17:59:56 +0200 Subject: [PATCH] Updated package structure --- pkg/chain/ethereum/tbtc.go | 2 +- pkg/{tecdsa => protocol}/inactivity/claim.go | 0 pkg/{tecdsa => protocol}/inactivity/gen/pb/message.pb.go | 0 pkg/{tecdsa => protocol}/inactivity/gen/pb/message.proto | 0 pkg/{tecdsa => protocol}/inactivity/inactivity.go | 0 pkg/{tecdsa => protocol}/inactivity/marshalling.go | 2 +- pkg/{tecdsa => protocol}/inactivity/marshalling_test.go | 0 pkg/{tecdsa => protocol}/inactivity/member.go | 0 pkg/{tecdsa => protocol}/inactivity/message.go | 0 pkg/{tecdsa => protocol}/inactivity/states.go | 0 pkg/tbtc/chain.go | 2 +- pkg/tbtc/chain_test.go | 2 +- pkg/tbtc/inactivity.go | 3 +-- pkg/tbtc/inactivity_submit.go | 2 +- pkg/tbtc/node.go | 2 +- 15 files changed, 7 insertions(+), 8 deletions(-) rename pkg/{tecdsa => protocol}/inactivity/claim.go (100%) rename pkg/{tecdsa => protocol}/inactivity/gen/pb/message.pb.go (100%) rename pkg/{tecdsa => protocol}/inactivity/gen/pb/message.proto (100%) rename pkg/{tecdsa => protocol}/inactivity/inactivity.go (100%) rename pkg/{tecdsa => protocol}/inactivity/marshalling.go (95%) rename pkg/{tecdsa => protocol}/inactivity/marshalling_test.go (100%) rename pkg/{tecdsa => protocol}/inactivity/member.go (100%) rename pkg/{tecdsa => protocol}/inactivity/message.go (100%) rename pkg/{tecdsa => protocol}/inactivity/states.go (100%) diff --git a/pkg/chain/ethereum/tbtc.go b/pkg/chain/ethereum/tbtc.go index e17151b89d..65146c71e7 100644 --- a/pkg/chain/ethereum/tbtc.go +++ b/pkg/chain/ethereum/tbtc.go @@ -25,10 +25,10 @@ import ( "github.com/keep-network/keep-core/pkg/internal/byteutils" "github.com/keep-network/keep-core/pkg/operator" "github.com/keep-network/keep-core/pkg/protocol/group" + "github.com/keep-network/keep-core/pkg/protocol/inactivity" "github.com/keep-network/keep-core/pkg/subscription" "github.com/keep-network/keep-core/pkg/tbtc" "github.com/keep-network/keep-core/pkg/tecdsa/dkg" - "github.com/keep-network/keep-core/pkg/tecdsa/inactivity" ) // Definitions of contract names. diff --git a/pkg/tecdsa/inactivity/claim.go b/pkg/protocol/inactivity/claim.go similarity index 100% rename from pkg/tecdsa/inactivity/claim.go rename to pkg/protocol/inactivity/claim.go diff --git a/pkg/tecdsa/inactivity/gen/pb/message.pb.go b/pkg/protocol/inactivity/gen/pb/message.pb.go similarity index 100% rename from pkg/tecdsa/inactivity/gen/pb/message.pb.go rename to pkg/protocol/inactivity/gen/pb/message.pb.go diff --git a/pkg/tecdsa/inactivity/gen/pb/message.proto b/pkg/protocol/inactivity/gen/pb/message.proto similarity index 100% rename from pkg/tecdsa/inactivity/gen/pb/message.proto rename to pkg/protocol/inactivity/gen/pb/message.proto diff --git a/pkg/tecdsa/inactivity/inactivity.go b/pkg/protocol/inactivity/inactivity.go similarity index 100% rename from pkg/tecdsa/inactivity/inactivity.go rename to pkg/protocol/inactivity/inactivity.go diff --git a/pkg/tecdsa/inactivity/marshalling.go b/pkg/protocol/inactivity/marshalling.go similarity index 95% rename from pkg/tecdsa/inactivity/marshalling.go rename to pkg/protocol/inactivity/marshalling.go index 8e7b568c2c..57c6dbca1a 100644 --- a/pkg/tecdsa/inactivity/marshalling.go +++ b/pkg/protocol/inactivity/marshalling.go @@ -6,7 +6,7 @@ import ( "google.golang.org/protobuf/proto" "github.com/keep-network/keep-core/pkg/protocol/group" - "github.com/keep-network/keep-core/pkg/tecdsa/inactivity/gen/pb" + "github.com/keep-network/keep-core/pkg/protocol/inactivity/gen/pb" ) func validateMemberIndex(protoIndex uint32) error { diff --git a/pkg/tecdsa/inactivity/marshalling_test.go b/pkg/protocol/inactivity/marshalling_test.go similarity index 100% rename from pkg/tecdsa/inactivity/marshalling_test.go rename to pkg/protocol/inactivity/marshalling_test.go diff --git a/pkg/tecdsa/inactivity/member.go b/pkg/protocol/inactivity/member.go similarity index 100% rename from pkg/tecdsa/inactivity/member.go rename to pkg/protocol/inactivity/member.go diff --git a/pkg/tecdsa/inactivity/message.go b/pkg/protocol/inactivity/message.go similarity index 100% rename from pkg/tecdsa/inactivity/message.go rename to pkg/protocol/inactivity/message.go diff --git a/pkg/tecdsa/inactivity/states.go b/pkg/protocol/inactivity/states.go similarity index 100% rename from pkg/tecdsa/inactivity/states.go rename to pkg/protocol/inactivity/states.go diff --git a/pkg/tbtc/chain.go b/pkg/tbtc/chain.go index 7f2686fe10..fd548b7ffd 100644 --- a/pkg/tbtc/chain.go +++ b/pkg/tbtc/chain.go @@ -9,10 +9,10 @@ import ( "github.com/keep-network/keep-core/pkg/chain" "github.com/keep-network/keep-core/pkg/operator" "github.com/keep-network/keep-core/pkg/protocol/group" + "github.com/keep-network/keep-core/pkg/protocol/inactivity" "github.com/keep-network/keep-core/pkg/sortition" "github.com/keep-network/keep-core/pkg/subscription" "github.com/keep-network/keep-core/pkg/tecdsa/dkg" - "github.com/keep-network/keep-core/pkg/tecdsa/inactivity" ) type DKGState int diff --git a/pkg/tbtc/chain_test.go b/pkg/tbtc/chain_test.go index bf622e5f1c..da2efc4ec9 100644 --- a/pkg/tbtc/chain_test.go +++ b/pkg/tbtc/chain_test.go @@ -22,9 +22,9 @@ import ( "github.com/keep-network/keep-core/pkg/chain/local_v1" "github.com/keep-network/keep-core/pkg/operator" "github.com/keep-network/keep-core/pkg/protocol/group" + "github.com/keep-network/keep-core/pkg/protocol/inactivity" "github.com/keep-network/keep-core/pkg/subscription" "github.com/keep-network/keep-core/pkg/tecdsa/dkg" - "github.com/keep-network/keep-core/pkg/tecdsa/inactivity" ) const localChainOperatorID = chain.OperatorID(1) diff --git a/pkg/tbtc/inactivity.go b/pkg/tbtc/inactivity.go index 9c7c5c33e0..b09117abe9 100644 --- a/pkg/tbtc/inactivity.go +++ b/pkg/tbtc/inactivity.go @@ -15,7 +15,7 @@ import ( "github.com/keep-network/keep-core/pkg/generator" "github.com/keep-network/keep-core/pkg/net" "github.com/keep-network/keep-core/pkg/protocol/group" - "github.com/keep-network/keep-core/pkg/tecdsa/inactivity" + "github.com/keep-network/keep-core/pkg/protocol/inactivity" ) const ( @@ -47,7 +47,6 @@ type inactivityClaimExecutor struct { waitForBlockFn waitForBlockFn } -// TODO Consider moving all inactivity-related code to pkg/protocol/inactivity. func newInactivityClaimExecutor( chain Chain, signers []*signer, diff --git a/pkg/tbtc/inactivity_submit.go b/pkg/tbtc/inactivity_submit.go index 1dec255ee1..21879ed6d4 100644 --- a/pkg/tbtc/inactivity_submit.go +++ b/pkg/tbtc/inactivity_submit.go @@ -7,7 +7,7 @@ import ( "github.com/ipfs/go-log/v2" "github.com/keep-network/keep-core/pkg/bitcoin" "github.com/keep-network/keep-core/pkg/protocol/group" - "github.com/keep-network/keep-core/pkg/tecdsa/inactivity" + "github.com/keep-network/keep-core/pkg/protocol/inactivity" ) // inactivityClaimSigner is responsible for signing the inactivity claim and diff --git a/pkg/tbtc/node.go b/pkg/tbtc/node.go index 1bb1bdb8d0..9a6121ed93 100644 --- a/pkg/tbtc/node.go +++ b/pkg/tbtc/node.go @@ -18,7 +18,7 @@ import ( "github.com/keep-network/keep-core/pkg/net" "github.com/keep-network/keep-core/pkg/protocol/announcer" "github.com/keep-network/keep-core/pkg/protocol/group" - "github.com/keep-network/keep-core/pkg/tecdsa/inactivity" + "github.com/keep-network/keep-core/pkg/protocol/inactivity" "github.com/keep-network/keep-core/pkg/tecdsa/signing" )