Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ let package = Package(
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "BeaconChain",
targets: ["BeaconChain"])
targets: ["BeaconChain"]),
.executable(
name: "Node",
targets: ["Node"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
Expand All @@ -21,8 +24,14 @@ let package = Package(
.target(
name: "BeaconChain",
dependencies: []),
.target(
name: "Node",
dependencies: ["BeaconChain"]),
.testTarget(
name: "BeaconChainTests",
dependencies: ["BeaconChain"])
dependencies: ["BeaconChain"]),
.testTarget(
name: "NodeTests",
dependencies: ["Node"])
]
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct BeaconBlock: Equatable {
public struct BeaconBlock: Equatable {
let slot: UInt64
let parentRoot: Data
let stateRoot: Data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct Attestation: Equatable {
public struct Attestation: Equatable {
let aggregationBitfield: Data
let data: AttestationData
let custodyBitfield: Data
Expand Down
2 changes: 1 addition & 1 deletion Sources/BeaconChain/Store/Store.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

protocol Store {
public protocol Store {

func parent(_ block: BeaconBlock) -> BeaconBlock
func children(_ block: BeaconBlock) -> [BeaconBlock]
Expand Down
2 changes: 1 addition & 1 deletion Sources/BeaconChain/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
typealias Slot = UInt64
typealias Epoch = UInt64
typealias Shard = UInt64
typealias ValidatorIndex = UInt64
public typealias ValidatorIndex = UInt64
typealias Gwei = UInt64
typealias Bytes32 = Data // @todo needs to be 32 fixed length data
typealias BLSPubkey = Data // @todo needs to be 48 fixed length data
Expand Down
19 changes: 19 additions & 0 deletions Sources/Node/Store/TestStore.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import BeaconChain

class TestStore: Store {
func parent(_ block: BeaconBlock) -> BeaconBlock {

}

func children(_ block: BeaconBlock) -> [BeaconBlock] {

}

func latestAttestation(validator: ValidatorIndex) -> Attestation {

}

func latestAttestationTarget(validator: ValidatorIndex) -> BeaconBlock {

}
}
2 changes: 2 additions & 0 deletions Sources/Node/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Foundation

8 changes: 8 additions & 0 deletions Tests/NodeTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import XCTest

#if !os(macOS)
public func allTests() -> [XCTestCaseEntry] {
return [
]
}
#endif