It should have an add function, that addresses two cases:
If the contract's sender public key hash is not in the map, pass it to our regular validateContract function. If it's invalid, return an error. If it is valid, it'll get the table balance and table nonce, create a pending balance/pending state nonce struct with the pending balance being the difference between the table balance and the valid contract value and pending nonce being equal to the contract nonce, add the hash and the struct to the map, then return nil.
If the contract's sender public key hash is in the map, pass it to the #269 validation function. If that returns an error, return an error. If it returns nil, update the map's struct for that public key hash with the two values returned from #269. Then return nil.
See: #268
Add some functionality to the pending pool map struct from issue #270 .
It should be able to return whether a key exists in the map (example in here: https://blog.golang.org/go-maps-in-action)
It should have an add function, that addresses two cases:
validateContract
function. If it's invalid, return an error. If it is valid, it'll get the table balance and table nonce, create a pending balance/pending state nonce struct with the pending balance being the difference between the table balance and the valid contract value and pending nonce being equal to the contract nonce, add the hash and the struct to the map, then returnnil
.nil
.