GithubHelp home page GithubHelp logo

Comments (7)

Vervious avatar Vervious commented on July 24, 2024

I cannot duplicate - the reproduction code works fine for me. What version of algod & go-algorand-sdk are you running?

from go-algorand-sdk.

kvdv80 avatar kvdv80 commented on July 24, 2024

Algod = 131093 (Update.sh says there is no newer version.)
Cloned the latest master of the sdk.
Go Version is go1.12.5 linux/amd64
Ubuntu 18.04.2 LTS Server

from go-algorand-sdk.

JasonWeathersby avatar JasonWeathersby commented on July 24, 2024

it worked for me as well. I can reproduce either.

from go-algorand-sdk.

JasonWeathersby avatar JasonWeathersby commented on July 24, 2024

Does your local copy have the rewards section: https://github.com/algorand/go-algorand-sdk/blob/master/client/algod/models/models.go#L92
did you clone the repo into your go src dir?

from go-algorand-sdk.

kvdv80 avatar kvdv80 commented on July 24, 2024

Yes, it's in the src dir and it has the section:

// Account Description
// swagger:model Account
type Account struct {
	// Round indicates the round for which this information is relevant
	//
	// required: true
	Round uint64 `json:"round"`

	// Address indicates the account public key
	//
	// required: true
	Address string `json:"address"`

	// Amount indicates the total number of MicroAlgos in the account
	//
	// required: true
	Amount uint64 `json:"amount"`

	// PendingRewards specifies the amount of MicroAlgos of pending
	// rewards in this account.
	//
	// required: true
	PendingRewards uint64 `json:"pendingrewards"`

	// AmountWithoutPendingRewards specifies the amount of MicroAlgos in
	// the account, without the pending rewards.
	//
	// required: true
	AmountWithoutPendingRewards uint64 `json:"amountwithoutpendingrewards"`

	// Rewards indicates the total rewards of MicroAlgos the account has recieved
	//
	// required: true
	Rewards uint64 `json:"rewards"`

	// Status indicates the delegation status of the account's MicroAlgos
	// Offline - indicates that the associated account is delegated.
	// Online  - indicates that the associated account used as part of the delegation pool.
	// NotParticipating - indicates that the associated account is neither a delegator nor a delegate.
	//
	// required: true
	Status string `json:"status"`
}	

Strange part is when i try to access it with AccountInfo.Rewards
It trows back the error:
AccountInfo.Rewards undefined (type models.Account has no field or method Rewards)

That is when i checked the models.go and it was there.
I will try it later from a different machine. Let's see if that gives me a better result.

What version of go do you use?

from go-algorand-sdk.

kvdv80 avatar kvdv80 commented on July 24, 2024

Did it on 2 other machines and it works fine indeed. Can't reproduce it there.

from go-algorand-sdk.

kvdv80 avatar kvdv80 commented on July 24, 2024

Found the problem and it was me :)
There was an older project i was working on that had his own clone of the sdk.
So there where 2 models.go in the src dir.

Thks for looking into it.

from go-algorand-sdk.

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.