From 02927ddb11da9e37f802f42d4a2a889c2964fa0a Mon Sep 17 00:00:00 2001 From: Jaz Gulati Date: Sat, 22 May 2021 09:50:09 +1000 Subject: [PATCH 1/3] feat: pull cross-chain fees from state --- compat/v0/compat.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/compat/v0/compat.go b/compat/v0/compat.go index 4549e77e..ddc88fee 100644 --- a/compat/v0/compat.go +++ b/compat/v0/compat.go @@ -71,8 +71,9 @@ func QueryFeesResponseFromState(state map[string]engine.XState) (ResponseQueryFe } bitcoinCap := bitcoinS.GasCap bitcoinLimit := bitcoinS.GasLimit - bitcoinUnderlying := U64{Int: big.NewInt(int64(bitcoinCap.Int().Uint64() * bitcoinLimit.Int().Uint64()))} + bitcoinMintFee := U64{Int: big.NewInt(int64(bitcoinS.MintFee))} + bitcoinBurnFee := U64{Int: big.NewInt(int64(bitcoinS.MintFee))} zcashS, ok := state[string(multichain.Zcash.NativeAsset())] if !ok { @@ -83,6 +84,8 @@ func QueryFeesResponseFromState(state map[string]engine.XState) (ResponseQueryFe zcashCap := zcashS.GasCap zcashLimit := zcashS.GasLimit zcashUnderlying := U64{Int: big.NewInt(int64(zcashCap.Int().Uint64() * zcashLimit.Int().Uint64()))} + zcashMintFee := U64{Int: big.NewInt(int64(zcashS.MintFee))} + zcashBurnFee := U64{Int: big.NewInt(int64(zcashS.MintFee))} bitcoinCashS, ok := state[string(multichain.BitcoinCash.NativeAsset())] if !ok { @@ -91,35 +94,33 @@ func QueryFeesResponseFromState(state map[string]engine.XState) (ResponseQueryFe } bitcoinCashCap := bitcoinCashS.GasCap bitcoinCashLimit := bitcoinCashS.GasLimit - bitcoinCashUnderlying := U64{Int: big.NewInt(int64(bitcoinCashCap.Int().Uint64() * bitcoinCashLimit.Int().Uint64()))} - - mintFee := U64{Int: big.NewInt(25)} - burnFee := U64{Int: big.NewInt(10)} + bitcoinCashMintFee := U64{Int: big.NewInt(int64(bitcoinCashS.MintFee))} + bitcoinCashBurnFee := U64{Int: big.NewInt(int64(bitcoinCashS.MintFee))} resp := ResponseQueryFees{ Btc: Fees{ Lock: bitcoinUnderlying, Release: bitcoinUnderlying, Ethereum: MintAndBurnFees{ - Mint: mintFee, - Burn: burnFee, + Mint: bitcoinMintFee, + Burn: bitcoinBurnFee, }, }, Zec: Fees{ Lock: zcashUnderlying, Release: zcashUnderlying, Ethereum: MintAndBurnFees{ - Mint: mintFee, - Burn: burnFee, + Mint: zcashMintFee, + Burn: zcashBurnFee, }, }, Bch: Fees{ Lock: bitcoinCashUnderlying, Release: bitcoinCashUnderlying, Ethereum: MintAndBurnFees{ - Mint: mintFee, - Burn: burnFee, + Mint: bitcoinCashMintFee, + Burn: bitcoinCashBurnFee, }, }, } From 8fd9bd6799e09cfb05d4deadb211f31e27bf1d9c Mon Sep 17 00:00:00 2001 From: Jaz Gulati Date: Sat, 22 May 2021 09:50:50 +1000 Subject: [PATCH 2/3] doc: update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc02c35e..46c31862 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.4.1 -- Update Multichain to v0.3.8 +- Update Multichain to v0.3.10 - Add support for watching Solana burns +- Pull cross-chain fees from RenVM state ## 0.3.2 From de9c0a18f48a4b06ea177a67a36ba90eb9f2fe3c Mon Sep 17 00:00:00 2001 From: Jaz Gulati Date: Sat, 22 May 2021 12:11:23 +1000 Subject: [PATCH 3/3] fix: use burn fee for burn fee --- compat/v0/compat.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compat/v0/compat.go b/compat/v0/compat.go index ddc88fee..509427ee 100644 --- a/compat/v0/compat.go +++ b/compat/v0/compat.go @@ -73,7 +73,7 @@ func QueryFeesResponseFromState(state map[string]engine.XState) (ResponseQueryFe bitcoinLimit := bitcoinS.GasLimit bitcoinUnderlying := U64{Int: big.NewInt(int64(bitcoinCap.Int().Uint64() * bitcoinLimit.Int().Uint64()))} bitcoinMintFee := U64{Int: big.NewInt(int64(bitcoinS.MintFee))} - bitcoinBurnFee := U64{Int: big.NewInt(int64(bitcoinS.MintFee))} + bitcoinBurnFee := U64{Int: big.NewInt(int64(bitcoinS.BurnFee))} zcashS, ok := state[string(multichain.Zcash.NativeAsset())] if !ok { @@ -85,7 +85,7 @@ func QueryFeesResponseFromState(state map[string]engine.XState) (ResponseQueryFe zcashLimit := zcashS.GasLimit zcashUnderlying := U64{Int: big.NewInt(int64(zcashCap.Int().Uint64() * zcashLimit.Int().Uint64()))} zcashMintFee := U64{Int: big.NewInt(int64(zcashS.MintFee))} - zcashBurnFee := U64{Int: big.NewInt(int64(zcashS.MintFee))} + zcashBurnFee := U64{Int: big.NewInt(int64(zcashS.BurnFee))} bitcoinCashS, ok := state[string(multichain.BitcoinCash.NativeAsset())] if !ok { @@ -96,7 +96,7 @@ func QueryFeesResponseFromState(state map[string]engine.XState) (ResponseQueryFe bitcoinCashLimit := bitcoinCashS.GasLimit bitcoinCashUnderlying := U64{Int: big.NewInt(int64(bitcoinCashCap.Int().Uint64() * bitcoinCashLimit.Int().Uint64()))} bitcoinCashMintFee := U64{Int: big.NewInt(int64(bitcoinCashS.MintFee))} - bitcoinCashBurnFee := U64{Int: big.NewInt(int64(bitcoinCashS.MintFee))} + bitcoinCashBurnFee := U64{Int: big.NewInt(int64(bitcoinCashS.BurnFee))} resp := ResponseQueryFees{ Btc: Fees{