Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multi: rename courier type ApertureCourier to HashmailCourierType
Browse files Browse the repository at this point in the history
ffranr committed Sep 7, 2023
1 parent c8bed24 commit 98f785d
Showing 6 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion itest/tapd_harness.go
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@ func newTapdHarness(ht *harnessTest, cfg tapdConfig,
}

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

2 changes: 1 addition & 1 deletion itest/test_harness.go
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions itest/test_list_on_test.go
Original file line number Diff line number Diff line change
@@ -26,27 +26,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",
13 changes: 5 additions & 8 deletions proof/courier.go
Original file line number Diff line number Diff line change
@@ -31,12 +31,9 @@ const (
// 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
@@ -98,7 +95,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)
}

@@ -148,7 +145,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)
}
@@ -244,7 +241,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)
}
2 changes: 1 addition & 1 deletion tapcfg/config.go
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion tapcfg/server.go
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit 98f785d

Please sign in to comment.