diff --git a/nitro.nim b/nitro.nim index bcb56ab..2548175 100644 --- a/nitro.nim +++ b/nitro.nim @@ -1,3 +1,3 @@ -import ./nitro/state +import ./nitro/protocol -export state +export protocol diff --git a/nitro/protocol.nim b/nitro/protocol.nim new file mode 100644 index 0000000..fddb684 --- /dev/null +++ b/nitro/protocol.nim @@ -0,0 +1,5 @@ +import ./protocol/state +import ./protocol/signature + +export state +export signature diff --git a/nitro/abi.nim b/nitro/protocol/abi.nim similarity index 98% rename from nitro/abi.nim rename to nitro/protocol/abi.nim index 02f256e..92e936b 100644 --- a/nitro/abi.nim +++ b/nitro/protocol/abi.nim @@ -1,8 +1,10 @@ import pkg/stew/endians2 import pkg/stint -import ./types +import ../types -include ./noerrors +include ../noerrors + +export types type AbiEncoder* = object diff --git a/nitro/channel.nim b/nitro/protocol/channel.nim similarity index 92% rename from nitro/channel.nim rename to nitro/protocol/channel.nim index a2354ef..7e61eff 100644 --- a/nitro/channel.nim +++ b/nitro/protocol/channel.nim @@ -1,8 +1,8 @@ import pkg/nimcrypto +import ../types import ./abi -import ./types -include ./noerrors +include ../noerrors export types diff --git a/nitro/outcome.nim b/nitro/protocol/outcome.nim similarity index 97% rename from nitro/outcome.nim rename to nitro/protocol/outcome.nim index e1e173b..f9889ee 100644 --- a/nitro/outcome.nim +++ b/nitro/protocol/outcome.nim @@ -1,11 +1,10 @@ import pkg/nimcrypto +import ../types import ./abi -import ./types -include ./noerrors +include ../noerrors export types -export abi type Outcome* = distinct seq[AssetOutcome] diff --git a/nitro/signature.nim b/nitro/protocol/signature.nim similarity index 97% rename from nitro/signature.nim rename to nitro/protocol/signature.nim index df29130..75d9059 100644 --- a/nitro/signature.nim +++ b/nitro/protocol/signature.nim @@ -2,10 +2,10 @@ import std/options import pkg/nimcrypto import pkg/secp256k1 import pkg/stew/byteutils +import ../helpers import ./state -import ./helpers -include ./noerrors +include ../noerrors export options export toPublicKey diff --git a/nitro/state.nim b/nitro/protocol/state.nim similarity index 97% rename from nitro/state.nim rename to nitro/protocol/state.nim index 50f3736..e20d77f 100644 --- a/nitro/state.nim +++ b/nitro/protocol/state.nim @@ -1,10 +1,10 @@ import pkg/nimcrypto -import ./types +import ../types import ./channel import ./outcome import ./abi -include ./noerrors +include ../noerrors export types export channel diff --git a/tests/nitro/examples.nim b/tests/nitro/protocol/examples.nim similarity index 100% rename from tests/nitro/examples.nim rename to tests/nitro/protocol/examples.nim diff --git a/tests/nitro/testAbi.nim b/tests/nitro/protocol/testAbi.nim similarity index 99% rename from tests/nitro/testAbi.nim rename to tests/nitro/protocol/testAbi.nim index 04b5462..7ed39f1 100644 --- a/tests/nitro/testAbi.nim +++ b/tests/nitro/protocol/testAbi.nim @@ -1,6 +1,5 @@ import std/unittest -import pkg/nitro/abi -import pkg/nitro/types +import pkg/nitro/protocol/abi import pkg/stint import ./examples diff --git a/tests/nitro/testChannel.nim b/tests/nitro/protocol/testChannel.nim similarity index 93% rename from tests/nitro/testChannel.nim rename to tests/nitro/protocol/testChannel.nim index 3cfa917..c40a246 100644 --- a/tests/nitro/testChannel.nim +++ b/tests/nitro/protocol/testChannel.nim @@ -1,6 +1,6 @@ import std/unittest -import pkg/nitro/channel -import pkg/nitro/abi +import pkg/nitro/protocol/channel +import pkg/nitro/protocol/abi import pkg/nimcrypto import pkg/stew/byteutils import ./examples diff --git a/tests/nitro/testOutcome.nim b/tests/nitro/protocol/testOutcome.nim similarity index 98% rename from tests/nitro/testOutcome.nim rename to tests/nitro/protocol/testOutcome.nim index cfe6315..c597695 100644 --- a/tests/nitro/testOutcome.nim +++ b/tests/nitro/protocol/testOutcome.nim @@ -1,7 +1,8 @@ import std/unittest import pkg/nimcrypto import pkg/stew/byteutils -import pkg/nitro/outcome +import pkg/nitro/protocol/abi +import pkg/nitro/protocol/outcome import ./examples suite "outcome": diff --git a/tests/nitro/testSignature.nim b/tests/nitro/protocol/testSignature.nim similarity index 95% rename from tests/nitro/testSignature.nim rename to tests/nitro/protocol/testSignature.nim index 3cc5d08..da8a411 100644 --- a/tests/nitro/testSignature.nim +++ b/tests/nitro/protocol/testSignature.nim @@ -2,8 +2,8 @@ import std/unittest import pkg/nimcrypto import pkg/secp256k1 import pkg/stew/byteutils -import pkg/nitro/state -import pkg/nitro/signature +import pkg/nitro/protocol/state +import pkg/nitro/protocol/signature import ./examples suite "signature": diff --git a/tests/nitro/testState.nim b/tests/nitro/protocol/testState.nim similarity index 96% rename from tests/nitro/testState.nim rename to tests/nitro/protocol/testState.nim index be0bdb6..778d7c2 100644 --- a/tests/nitro/testState.nim +++ b/tests/nitro/protocol/testState.nim @@ -1,9 +1,8 @@ import std/unittest import pkg/nimcrypto import pkg/stew/byteutils -import pkg/nitro -import pkg/nitro/state -import pkg/nitro/abi +import pkg/nitro/protocol/state +import pkg/nitro/protocol/abi import ./examples suite "state": diff --git a/tests/testAll.nim b/tests/testAll.nim index 81f65d1..ca8816d 100644 --- a/tests/testAll.nim +++ b/tests/testAll.nim @@ -1,7 +1,7 @@ -import ./nitro/testAbi -import ./nitro/testChannel -import ./nitro/testOutcome -import ./nitro/testState -import ./nitro/testSignature +import ./nitro/protocol/testAbi +import ./nitro/protocol/testChannel +import ./nitro/protocol/testOutcome +import ./nitro/protocol/testState +import ./nitro/protocol/testSignature {.warning[UnusedImport]: off.}