Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquid updates #759

Merged
merged 15 commits into from
Nov 9, 2019
Merged

Liquid updates #759

merged 15 commits into from
Nov 9, 2019

Conversation

Kukks
Copy link
Contributor

@Kukks Kukks commented Oct 24, 2019

Updated Liquid Support

  • Set correct hrps for liquid networks
  • Add Blech32 encoder for elements segwit blinded addresses
  • Allow alt networks to have more bech32 encoders configured than btc
  • Added additional RPC commands for elements
  • Update WellKnownNode versions for elements and bitcoin
  • Add additional serialization methods to BitcoinStream
  • Adjust altcoin tests for elements differences
  • Add support for dynamic federation mode blocks in elements
  • Adjust Elements regtest genesis hash

@Kukks Kukks mentioned this pull request Oct 28, 2019
Set correct hrps for liquid networks
Add Blech32 encoder for elements segwit blinded addresses
Allow alt networks to have more bech32 encoders configured than btc
Added additional RPC commands for elements 
Update WellKnownNode versions for elements and bitcoin
Add additional serialization methods to BitcoinStream
Adjust altcoin tests  for elements differences
Add support for dynamic federation mode blocks in elements
Adjust Elements regtest genesis hash
@Kukks Kukks changed the title WIP Liquid fixes Liquid updates Oct 28, 2019
@NicolasDorier
Copy link
Collaborator

does not build

Assert.Equal(Money.Zero, rpc.GetBalance());
node.Generate(1);
Assert.NotEqual(Money.Zero, rpc.GetBalance());
if (new[] {Liquid.Instance.Mainnet, Liquid.Instance.Testnet, Liquid.Instance.Regtest,}.Contains(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GetBalanceAsync should still pass and implies LBTC, even if it is liquid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetBalance rpc call send a different json structure than bitcoind

@@ -12,7 +14,12 @@ class LiquidRegtest { }
static Liquid()
{
ElementsParams<Liquid>.PeggedAssetId = new uint256("6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d");
ElementsParams<Liquid>.SignedBlocks = true;
ElementsParams<Liquid>.BlockHeightInHeader = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are those? if they are always true, why even put them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depends on your custom chain config for elements.

},
RegtestFolderName = "elementsregtest",
Chain = "elementsregtest",
AdditionalRegtestConfig = "initialfreecoins=210000000000000\nvalidatepegin=0",
UseSectionInConfigFile = true
AdditionalRegtestConfig = "initialfreecoins=0\nvalidatepegin=0\n\ncon_dyna_deploy_start=99999999999999999",
Copy link
Collaborator

@NicolasDorier NicolasDorier Oct 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changing initialfreecoins

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialfreecoins sets the default balance of bitcoin. For the tests, we want this 0

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if we mine 101 blocks we should be able to spend something.
But I don't think liquid blocks have reward, so that's why I used freecoins.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair, let me switch and adjust

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Kukks
Copy link
Contributor Author

Kukks commented Oct 29, 2019

The CI is failing weirdly, i think it has an old C# compiler version

build compiles & altcointests pass locally

@NicolasDorier
Copy link
Collaborator

Elements/ElementsBlock.cs(114,6): error CS0311: The type 'NBitcoin.WitScript' cannot be used as type parameter 'T' in the generic type or method 'BitcoinStream.ReadWrite<T>(T)'. There is no implicit reference conversion from 'NBitcoin.WitScript' to 'NBitcoin.IBitcoinSerializable'. [/home/travis/build/MetacoSA/NBitcoin/NBitcoin.Altcoins/NBitcoin.Altcoins.csproj]

@Kukks
Copy link
Contributor Author

Kukks commented Oct 31, 2019

Weird, locally it compiles and executes. I wonder what is up with that

@NicolasDorier NicolasDorier merged commit f624ff4 into MetacoSA:master Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants