code: func (exe *executor) updateSignatories(txEnv *txs.Envelope) error {
  	for _, sig := range txEnv.Signatories {
  		// pointer dereferences are safe since txEnv.Validate() is run by txEnv.Verify() above which checks they are
  		// non-nil
  		acc, err := exe.stateCache.GetAccount(*sig.Address)
  		if err != nil {
  			return fmt.Errorf("error getting account on which to set public key: %v", *sig.Address)
  		}
  		// Important that verify has been run against signatories at this point
  		if sig.PublicKey.GetAddress() != acc.Address {
  			return fmt.Errorf("unexpected mismatch between address %v and supplied public key %v",
  				acc.Address, sig.PublicKey)
  		}
  		acc.PublicKey = *sig.PublicKey
  
  		exe.logger.TraceMsg("Incrementing sequence number Tx signatory/input",
  			"height", exe.block.Height,
  			"tag", "sequence",
  			"account", acc.Address,
  			"old_sequence", acc.Sequence,
  			"new_sequence", acc.Sequence+1)
  		acc.Sequence++
  		err = exe.stateCache.UpdateAccount(acc)
  		if err != nil {
  			return fmt.Errorf("error updating account after setting public key: %v", err)
  		}
  	}
  	return nil
  }
docs: // Capture public keys and update sequence numbers