Coder Social home page Coder Social logo

Comments (3)

xJonathanLEI avatar xJonathanLEI commented on August 15, 2024 1

Hmm I think one of the benefits of using this pattern is that we can hide away the complicated details (nonce & fees) from users. So I'd vote for not having to explicitly set use_next_nonce().

from starknet-rs.

xJonathanLEI avatar xJonathanLEI commented on August 15, 2024

What I have in mind is the following.

We should change the execute() method in Account trait to:

  • not accept a nonce parameter; and
  • return some new type AccountCall (as always, naming not final), which contains some send() method that will actually make the requests.

The proposed new type AccountCall will have these methods, apart from send():

  • nonce()
  • max_fee()

When send() is called, it'll use whatever nonce and max_fee supplied. If none is given, it will call get_nonce() and estimate_fees to figure out automatically.

@milancermak WDYT?

from starknet-rs.

milancermak avatar milancermak commented on August 15, 2024

Yes, this sounds great!

What do you think about having to use explicit and mutually exclusive setters for nonce / fee? So you'd either have to nonce(20) to set it as you wish or use_next_nonce() to get it from the get_nonce() call. I guess the only advantage is that the values are set explicitly instead of using a default. I have no strong feelings about this, just curious what your opinion is.

from starknet-rs.

Related Issues (20)

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.