(k proto.AccountAddress, amount uint64, tokenType types.TokenType)
| 254 | } |
| 255 | |
| 256 | func (s *metaState) increaseAccountToken(k proto.AccountAddress, amount uint64, tokenType types.TokenType) error { |
| 257 | var ( |
| 258 | src, dst *types.Account |
| 259 | ok bool |
| 260 | ) |
| 261 | if dst, ok = s.dirty.accounts[k]; !ok { |
| 262 | if src, ok = s.readonly.accounts[k]; !ok { |
| 263 | err := errors.Wrap(ErrAccountNotFound, "increase account balance fail") |
| 264 | return err |
| 265 | } |
| 266 | dst = deepcopy.Copy(src).(*types.Account) |
| 267 | s.dirty.accounts[k] = dst |
| 268 | } |
| 269 | return safeAdd(&dst.TokenBalance[tokenType], &amount) |
| 270 | } |
| 271 | |
| 272 | func (s *metaState) decreaseAccountToken(k proto.AccountAddress, amount uint64, tokenType types.TokenType) error { |
| 273 | var ( |
no test coverage detected