Skip to content

Commit

Permalink
Merge pull request #145 from renproject/feat/cat-support
Browse files Browse the repository at this point in the history
CAT support
  • Loading branch information
jazg authored Apr 20, 2022
2 parents e1e7035 + b49c7d9 commit 37505a8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
10 changes: 5 additions & 5 deletions chain/zcash/zcash.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var (
{419200, []byte{0xBB, 0x09, 0xB8, 0x76}},
{653600, []byte{0x60, 0x0E, 0xB4, 0x2B}},
{903000, []byte{0x0B, 0x23, 0xB9, 0xF5}},
{1046400, []byte{0xA6, 0x75, 0xff, 0xe9}},
{1046400, []byte{0xA6, 0x75, 0xFF, 0xE9}},
},
}

Expand All @@ -64,8 +64,8 @@ var (
{280000, []byte{0xBB, 0x09, 0xB8, 0x76}},
{584000, []byte{0x60, 0x0E, 0xB4, 0x2B}},
{903800, []byte{0x0B, 0x23, 0xB9, 0xF5}},
{1028500, []byte{0xA6, 0x75, 0xff, 0xe9}},
{1590000, []byte{0x21, 0x96, 0x51, 0x37}},
{1028500, []byte{0xA6, 0x75, 0xFF, 0xE9}},
{1842420, []byte{0xB4, 0xD0, 0xD6, 0xC2}},
},
}

Expand All @@ -81,8 +81,8 @@ var (
{20, []byte{0xBB, 0x09, 0xB8, 0x76}},
{30, []byte{0x60, 0x0E, 0xB4, 0x2B}},
{40, []byte{0x0B, 0x23, 0xB9, 0xF5}},
{50, []byte{0xA6, 0x75, 0xff, 0xe9}},
{60, []byte{0x21, 0x96, 0x51, 0x37}},
{50, []byte{0xA6, 0x75, 0xFF, 0xE9}},
{60, []byte{0xB4, 0xD0, 0xD6, 0xC2}},
},
}
)
2 changes: 1 addition & 1 deletion infra/zcash/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM debian:buster
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-transport-https gnupg2 ca-certificates wget && \
wget -qO - https://apt.z.cash/zcash.asc | apt-key add - && \
echo "deb [arch=amd64] https://apt.z.cash/ buster main" | tee /etc/apt/sources.list.d/zcash.list && \
echo "deb [arch=amd64] https://apt.z.cash/ buster main" | tee /etc/apt/sources.list.d/zcash.list && \
apt-get update && apt-get install -y --no-install-recommends zcash && \
mkdir -p /root/.zcash-params && zcash-fetch-params

Expand Down
2 changes: 1 addition & 1 deletion infra/zcash/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ zcashd \
-nuparams=2bb40e60:30 \
-nuparams=f5b9230b:40 \
-nuparams=e9ff75a6:50 \
-nuparams=37519621:60
-nuparams=c2d6d0b4:60
sleep 20

echo "ZCASH_ADDRESS=$ADDRESS"
Expand Down
15 changes: 10 additions & 5 deletions multichain.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const (
BCH = Asset("BCH") // Bitcoin Cash
BNB = Asset("BNB") // Binance Coin
BTC = Asset("BTC") // Bitcoin
CAT = Asset("CAT") // Catalog
DGB = Asset("DGB") // DigiByte
DOGE = Asset("DOGE") // Dogecoin
ETH = Asset("ETH") // Ether
Expand Down Expand Up @@ -196,6 +197,8 @@ func (asset Asset) OriginChain() Chain {
return BinanceSmartChain
case BTC:
return Bitcoin
case CAT:
return Catalog
case DGB:
return DigiByte
case DOGE:
Expand Down Expand Up @@ -248,7 +251,7 @@ func (asset Asset) ChainType() ChainType {
switch asset {
case BCH, BTC, DGB, DOGE, ZEC:
return ChainTypeUTXOBased
case ArbETH, AVAX, BNB, ETH, FIL, FTM, GLMR, KAVA, LUNA, MATIC, SOL:
case ArbETH, AVAX, BNB, CAT, ETH, FIL, FTM, GLMR, KAVA, LUNA, MATIC, SOL:
return ChainTypeAccountBased

case BADGER, BUSD, CRV, DAI, EURT, FTT, ibBTC, KNC, LINK, MIM, REN, ROOK,
Expand All @@ -274,7 +277,7 @@ func (asset Asset) ChainType() ChainType {
// Type returns the asset-type (Native or Token) for the given asset.
func (asset Asset) Type() AssetType {
switch asset {
case ArbETH, AVAX, BNB, ETH, FTM, GLMR, KAVA, MATIC, SOL:
case ArbETH, AVAX, BNB, CAT, ETH, FTM, GLMR, KAVA, MATIC, SOL:
return AssetTypeNative

case BADGER, BUSD, CRV, DAI, EURT, FTT, ibBTC, KNC, LINK, MIM, REN, ROOK,
Expand Down Expand Up @@ -325,6 +328,7 @@ const (
BinanceSmartChain = Chain("BinanceSmartChain")
Bitcoin = Chain("Bitcoin")
BitcoinCash = Chain("BitcoinCash")
Catalog = Chain("Catalog")
DigiByte = Chain("DigiByte")
Dogecoin = Chain("Dogecoin")
Ethereum = Chain("Ethereum")
Expand All @@ -333,7 +337,6 @@ const (
Kava = Chain("Kava")
Moonbeam = Chain("Moonbeam")
Polygon = Chain("Polygon")
Ren = Chain("Ren")
Solana = Chain("Solana")
Terra = Chain("Terra")
Zcash = Chain("Zcash")
Expand Down Expand Up @@ -373,8 +376,8 @@ func (chain Chain) ChainType() ChainType {
switch chain {
case Bitcoin, BitcoinCash, DigiByte, Dogecoin, Zcash:
return ChainTypeUTXOBased
case Avalanche, BinanceSmartChain, Ethereum, Arbitrum, Fantom, Filecoin,
Kava, Moonbeam, Polygon, Ren, Solana, Terra:
case Avalanche, BinanceSmartChain, Catalog, Ethereum, Arbitrum, Fantom,
Filecoin, Kava, Moonbeam, Polygon, Solana, Terra:
return ChainTypeAccountBased

case Kovan, Goerli:
Expand Down Expand Up @@ -417,6 +420,8 @@ func (chain Chain) NativeAsset() Asset {
return BCH
case Bitcoin:
return BTC
case Catalog:
return CAT
case DigiByte:
return DGB
case Dogecoin:
Expand Down

0 comments on commit 37505a8

Please sign in to comment.