bazo-blockchain/bazo-miner

GetContractVariables should respect changes

Closed this issue · 1 comments

Function GetContractVariables should respect the changes made to the variables.

func (c *Context) findChangeByIndex(index int) *Change {
   for _, change := range c.changes {
      i, _ := change.GetChange()
      if i == index {
         return &change
      }
   }
   return nil
}

	// Check if variables are overwritten, if so return the change instead of the initial value
	change := c.findChangeByIndex(index)
	if change != nil {
		variable = change.value
	}