dcrd/require.go
Dave Collins 3a0dce1bcd
bech32: Ensure HRP is lowercase when encoding.
BIP173 specifically calls out that encoders must always output an all
lowercase bech32 string and that the lowercase form is used when
determining a character's value for calculating the checksum.

Currently, the implementation does not respect either of those
requirements.

This modifies the Encode function to convert the provided HRP to
lowercase to ensure the requirements are satisfied and adds tests
accordingly.
2019-12-27 13:03:47 -06:00

19 lines
594 B
Go

// Copyright (c) 2019 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
// This file exists to prevent go mod tidy from removing requires for newer
// module versions that are not yet fully integrated and to allow them to be
// automatically discovered by the testing infrastructure.
//
// It is excluded from the build to avoid including unused modules in the final
// binary.
package main
import (
_ "github.com/decred/dcrd/bech32"
_ "github.com/decred/dcrd/dcrec/secp256k1/v2"
_ "github.com/decred/dcrd/fees/v2"
)