Skip to content

Commit

Permalink
Merge pull request #493 from lightninglabs/rename-aperture-courier-type
Browse files Browse the repository at this point in the history
Rename aperture courier type to hashmail courier type
  • Loading branch information
guggero authored Sep 8, 2023
2 parents 789d0e9 + 19930a9 commit 9628583
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion itest/tapd_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func newTapdHarness(t *testing.T, ht *harnessTest, cfg tapdConfig,
}

finalCfg.DefaultProofCourierAddr = fmt.Sprintf(
"%s://%s", proof.ApertureCourier,
"%s://%s", proof.HashmailCourierType,
typedProofCourier.ListenAddr,
)

Expand Down
2 changes: 1 addition & 1 deletion itest/test_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func setupHarnesses(t *testing.T, ht *harnessTest,
case proof.DisabledCourier:
// Proof courier disabled, do nothing.

case proof.ApertureCourier:
case proof.HashmailCourierType:
port := nextAvailablePort()
apHarness := NewApertureHarness(ht.t, port)
proofCourier = &apHarness
Expand Down
10 changes: 5 additions & 5 deletions itest/test_list_on_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,27 @@ var testCases = []*testCase{
{
name: "basic send unidirectional",
test: testBasicSendUnidirectional,
proofCourierType: proof.ApertureCourier,
proofCourierType: proof.HashmailCourierType,
},
{
name: "resume pending package send",
test: testResumePendingPackageSend,
proofCourierType: proof.ApertureCourier,
proofCourierType: proof.HashmailCourierType,
},
{
name: "reattempt failed asset send",
test: testReattemptFailedAssetSend,
proofCourierType: proof.ApertureCourier,
proofCourierType: proof.HashmailCourierType,
},
{
name: "offline receiver eventually receives",
test: testOfflineReceiverEventuallyReceives,
proofCourierType: proof.ApertureCourier,
proofCourierType: proof.HashmailCourierType,
},
{
name: "basic send passive asset",
test: testBasicSendPassiveAsset,
proofCourierType: proof.ApertureCourier,
proofCourierType: proof.HashmailCourierType,
},
{
name: "send multiple coins",
Expand Down
19 changes: 7 additions & 12 deletions proof/courier.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,18 @@ import (
"google.golang.org/grpc/status"
)

// CourierType is an enum that represents the different types of proof courier
// services.
//
// TODO(ffranr): Rename to CourierProtocol.
// CourierType is an enum that represents the different proof courier services
// protocols that are supported.
type CourierType string

const (
// DisabledCourier is the default courier type that is used when no
// courier is specified.
DisabledCourier CourierType = "disabled_courier"

// ApertureCourier is a courier that uses the hashmail protocol to
// HashmailCourierType is a courier that uses the hashmail protocol to
// deliver proofs.
//
// TODO(ffranr): Rename to HashmailCourier (use protocol name rather
// than service).
ApertureCourier = "hashmail"
HashmailCourierType = "hashmail"
)

// CourierHarness interface is an integration testing harness for a proof
Expand Down Expand Up @@ -98,7 +93,7 @@ func ParseCourierAddrString(addr string) (CourierAddr, error) {
func ParseCourierAddrUrl(addr url.URL) (CourierAddr, error) {
// Create new courier addr based on URL scheme.
switch addr.Scheme {
case ApertureCourier:
case HashmailCourierType:
return NewHashMailCourierAddr(addr)
}

Expand Down Expand Up @@ -148,7 +143,7 @@ func (h *HashMailCourierAddr) NewCourier(_ context.Context, cfg *CourierCfg,
// URL. This function also performs hashmail protocol specific address
// validation.
func NewHashMailCourierAddr(addr url.URL) (*HashMailCourierAddr, error) {
if addr.Scheme != ApertureCourier {
if addr.Scheme != HashmailCourierType {
return nil, fmt.Errorf("expected hashmail courier protocol: %v",
addr.Scheme)
}
Expand Down Expand Up @@ -244,7 +239,7 @@ func serverDialOpts() ([]grpc.DialOption, error) {
func NewHashMailBox(courierAddr *url.URL) (*HashMailBox,
error) {

if courierAddr.Scheme != ApertureCourier {
if courierAddr.Scheme != HashmailCourierType {
return nil, fmt.Errorf("unsupported courier protocol: %v",
courierAddr.Scheme)
}
Expand Down
2 changes: 1 addition & 1 deletion tapcfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func DefaultConfig() Config {
BatchMintingInterval: defaultBatchMintingInterval,
ReOrgSafeDepth: defaultReOrgSafeDepth,
DefaultProofCourierAddr: fmt.Sprintf(
"%s://%s", proof.ApertureCourier, fallbackHashMailAddr,
"%s://%s", proof.HashmailCourierType, fallbackHashMailAddr,
),
HashMailCourier: &proof.HashMailCourierCfg{
ReceiverAckTimeout: defaultProofTransferReceiverAckTimeout,
Expand Down
2 changes: 1 addition & 1 deletion tapcfg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func genServerConfig(cfg *Config, cfgLogger btclog.Logger,
// If no default proof courier address is set, use the fallback hashmail
// address.
fallbackHashmailCourierAddr := fmt.Sprintf(
"%s://%s", proof.ApertureCourier, fallbackHashMailAddr,
"%s://%s", proof.HashmailCourierType, fallbackHashMailAddr,
)
proofCourierAddr, err := proof.ParseCourierAddrString(
fallbackHashmailCourierAddr,
Expand Down

0 comments on commit 9628583

Please sign in to comment.