SIGBlockchain / project_aurum

SIG Blockchain blockchain project in Go
https://acm.cs.uic.edu/sigblockchain
MIT License
7 stars 1 forks source link

pending pool package #270

Closed kastolars closed 5 years ago

kastolars commented 5 years ago

See: #268

Make a new package pertaining to pending pool.

Make a struct that contains a pending balance and pending state nonce.

Make a struct that contains a map who's key is a wallet address and who's value is of the type of the above struct.

I don't think there need to be any tests for this. A couple of New constructor functions might be nice.

Help with maps: https://blog.golang.org/go-maps-in-action

HarryL5004 commented 5 years ago

I don't think we can use byte slice as a key for maps in golang, but we can encode the wallet address to string and use that as a key instead.

...map keys may be of any type that is comparable...Notably absent from the list are slices, maps, and functions; these types cannot be compared using ==, and may not be used as map keys. -From https://blog.golang.org/go-maps-in-action

kastolars commented 5 years ago

How about we hex encode to string?

HarryL5004 commented 5 years ago

Completed