From 3a35112c206400e54d225a79890a02157726ad12 Mon Sep 17 00:00:00 2001 From: Loong Date: Fri, 21 Aug 2020 14:24:20 +1000 Subject: [PATCH] fix naming convention --- api/address/address.go | 4 ++-- chain/bitcoin/address.go | 6 +++--- chain/celo/address.go | 6 +++--- chain/digibyte/address.go | 2 +- chain/dogecoin/address.go | 6 +++--- chain/ethereum/address.go | 6 +++--- multichain.go | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/api/address/address.go b/api/address/address.go index 02b57c0b..35f55dbe 100644 --- a/api/address/address.go +++ b/api/address/address.go @@ -59,9 +59,9 @@ type Decoder interface { DecodeAddress(Address) (RawAddress, error) } -// The EncoderDecoder interfaces combines encoding and decoding functionality +// The EncodeDecoder interfaces combines encoding and decoding functionality // into one interface. -type EncoderDecoder interface { +type EncodeDecoder interface { Encoder Decoder } diff --git a/chain/bitcoin/address.go b/chain/bitcoin/address.go index f0c3e775..3547eaeb 100644 --- a/chain/bitcoin/address.go +++ b/chain/bitcoin/address.go @@ -8,13 +8,13 @@ import ( "github.com/renproject/pack" ) -type AddressEncoderDecoder struct { +type AddressEncodeDecoder struct { AddressEncoder AddressDecoder } -func NewAddressEncoderDecoder(params *chaincfg.Params) AddressEncoderDecoder { - return AddressEncoderDecoder{ +func NewAddressEncodeDecoder(params *chaincfg.Params) AddressEncodeDecoder { + return AddressEncodeDecoder{ AddressEncoder: NewAddressEncoder(params), AddressDecoder: NewAddressDecoder(params), } diff --git a/chain/celo/address.go b/chain/celo/address.go index d9a3aa03..b4a448f9 100644 --- a/chain/celo/address.go +++ b/chain/celo/address.go @@ -14,10 +14,10 @@ type AddressEncoder = ethereum.AddressEncoder // the Ethereum chain. type AddressDecoder = ethereum.AddressDecoder -// An AddressEncoderDecoder on the Celo chain is functionally identical to a +// An AddressEncodeDecoder on the Celo chain is functionally identical to a // encoder/decoder on the Ethereum chain. -type AddressEncoderDecoder = ethereum.AddressEncoderDecoder +type AddressEncodeDecoder = ethereum.AddressEncodeDecoder var ( - NewAddressEncoderDecoder = ethereum.NewAddressEncoderDecoder + NewAddressEncodeDecoder = ethereum.NewAddressEncodeDecoder ) diff --git a/chain/digibyte/address.go b/chain/digibyte/address.go index 53d8e8f5..9712b843 100644 --- a/chain/digibyte/address.go +++ b/chain/digibyte/address.go @@ -4,4 +4,4 @@ import "github.com/renproject/multichain/chain/bitcoin" type AddressEncoder = bitcoin.AddressEncoder type AddressDecoder = bitcoin.AddressDecoder -type AddressEncoderDecoder = bitcoin.AddressEncoderDecoder +type AddressEncodeDecoder = bitcoin.AddressEncodeDecoder diff --git a/chain/dogecoin/address.go b/chain/dogecoin/address.go index 5b217208..e94c3a87 100644 --- a/chain/dogecoin/address.go +++ b/chain/dogecoin/address.go @@ -3,7 +3,7 @@ package dogecoin import "github.com/renproject/multichain/chain/bitcoin" type ( - AddressEncoder = bitcoin.AddressEncoder - AddressDecoder = bitcoin.AddressDecoder - AddressEncoderDecoder = bitcoin.AddressEncoderDecoder + AddressEncoder = bitcoin.AddressEncoder + AddressDecoder = bitcoin.AddressDecoder + AddressEncodeDecoder = bitcoin.AddressEncodeDecoder ) diff --git a/chain/ethereum/address.go b/chain/ethereum/address.go index 8772ec8c..7a1ebb46 100644 --- a/chain/ethereum/address.go +++ b/chain/ethereum/address.go @@ -12,7 +12,7 @@ import ( "github.com/renproject/surge" ) -type AddressEncoderDecoder struct { +type AddressEncodeDecoder struct { AddressEncoder AddressDecoder } @@ -23,8 +23,8 @@ type AddressEncoder interface { type addressEncoder struct{} -func NewAddressEncoderDecoder() address.EncoderDecoder { - return AddressEncoderDecoder{ +func NewAddressEncodeDecoder() address.EncodeDecoder { + return AddressEncodeDecoder{ AddressEncoder: NewAddressEncoder(), AddressDecoder: NewAddressDecoder(), } diff --git a/multichain.go b/multichain.go index c365094f..3ca72af3 100644 --- a/multichain.go +++ b/multichain.go @@ -14,7 +14,7 @@ import ( type ( Address = address.Address - AddressEncoderDecoder = address.EncoderDecoder + AddressEncodeDecoder = address.EncodeDecoder EthereumCompatAddress = ethereum.Address RawAddress = address.RawAddress )