Git Product home page Git Product logo

netezos's People

Contributors

alex-cpppydeveloper avatar dmirgaleev avatar groxan avatar k-karuna avatar m-kus avatar mscappini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

netezos's Issues

Fix the xml documentation

  1. Write missing documentation for methods and parameters.
  2. Rewrite existing documentation to make it more understandable.

`BytesExtension` class should be public

Hi, in 2.0.1 version, shouldn't BytesExtension class in Netezos.Utils.Extension be public ?
otherwise the usage example in README.md
bytes.Concat(signature)
or
Netezos.BytesExtension.Concat(bytes,signature)
does not seem to work.

I get the following message:
'BytesExtension' is inaccessible due to its protection level

[{"kind":"temporary","id":"failure","msg":"Error while applying operation opEoVHUSnzaDV411BDtzPJUgK8Ucja6azi5WS5MtbDFD7Un6d4x:\nError:\n Empty implicit contract (tz1SauKgPRsTSuQRWzJA262QR8cKdw1d9pyK)\n"}]

When trying sample code i am getting error as mentioned in subject

Code is

var key = Key.FromBase58("edsk4ZkGeBwDyFVjZLL2neV5FUeWNN4NJntFNWmWyEBNbRwa2u3jh1");

		// use this address to receive some tez
		var address = key.PubKey.Address; // tz1SauKgPRsTSuQRWzJA262QR8cKdw1d9pyK

		using var rpc = new TezosRpc("https://mainnet-tezos.giganode.io/");

		// get a head block
		var head = await rpc.Blocks.Head.Hash.GetAsync<string>();

		// get account's counter
		var counter = await rpc.Blocks.Head.Context.Contracts[address].Counter.GetAsync<int>();

		var content = new ManagerOperationContent[]
		{
			new RevealContent
			{
				Source = address,
				Counter = ++counter,
				PublicKey = key.PubKey.GetBase58(),
				GasLimit = 1500,
				Fee = 1000 // 0.001 tez
			},
			new TransactionContent
			{
				Source = address,
				Counter = ++counter,
				Amount = 1000000, // 1 tez
				Destination = "tz1KhnTgwoRRALBX6vRHRnydDGSBFsWtcJxc",
				GasLimit = 1500,
				Fee = 1000 // 0.001 tez
			}
		};

		var bytes = await new LocalForge().ForgeOperationGroupAsync(head, content);

		byte[] signature = key.SignOperation(bytes);

		// inject the operation and get its id (operation hash)
		var result = await rpc.Inject.Operation.PostAsync(bytes.Concat(signature));

How do I mock responses from Tezos RPC calls?

To write comprehensive tests of your Tezos application, your would need to mock responses from RPC calls. If the TezosRpc was implemented as an interface, it would be easily mockable, but I am not sure how to approach it in this case.

Write tests

Write tests to ensure that all rpc methods paths are correct and all query parameters work

Add function parsing functionality

It would be nice if this library could take a signed transaction in a hex format and parse it into a transaction object, so you could read the amount, the source, destination, fee etc. without having to talk to a node.

ForgeDelegate is incorrect

ForgeTzAddress(operation.Source),

Source could be a contract as follow

{
"protocol":
"Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd",
"chain_id":
"NetXdQprcVkpaWU",
"hash":
"onmzRXbyKvm6SRsTSsorqwtdeXMpA3r4YCG2GVpTx1pzsX3bsf9",
"branch":
"BMFGtKPqQ5spmxS1WwaWxkVadaEVemEVW2PCPDJ3Bgr2sNkronC",
"contents":
[
{
"kind":
"delegation",
"source":
"KT1JJemnt1aoGGRK1trx1Sh8hjV6w3n88WL9",
"fee":
"1420",
"counter":
"3",
"gas_limit":
"10000",
"storage_limit":
"0",
"delegate":
"tz1TDSmoZXwVevLTEvKCTHWpomG76oC9S2fJ"
}
]
"signature":
"sigt9zdrzJgFV9sWhaZ3B6r6S1dSaBVHKUjtBcfHjCJiEZtPY44GR5viGrLFhPDYo8nBUbJKoMnooH19qRojpxADesruhec8"
}

https://tzkt.io/onmzRXbyKvm6SRsTSsorqwtdeXMpA3r4YCG2GVpTx1pzsX3bsf9/3

Usage of forgeTzAddress seems incorrect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.