diff --git a/go-client/client/client_requests.go b/go-client/client/client_requests.go index 81534cb..9855235 100644 --- a/go-client/client/client_requests.go +++ b/go-client/client/client_requests.go @@ -189,6 +189,9 @@ func (client *FastUpdatesClient) submitUpdates(updateProof *sortition.UpdateProo return err } + logger.Info("chain feeds values in block %d (before update): %v", client.transactionQueue.CurrentBlockNum, chainValues) + logger.Info("provider feeds values: %v", providerValues) + // calculate deltas for provider and on-chain prices deltas, deltasString, err := provider.GetDeltas(chainValues, providerValues, supportedFeedIndexes, scale) if err != nil { @@ -237,6 +240,13 @@ func (client *FastUpdatesClient) submitUpdates(updateProof *sortition.UpdateProo return fmt.Errorf("transaction failed") } logger.Info("successful update for block %d replicate %d in block %d", updateProof.BlockNumber, updateProof.Replicate, receipt.BlockNumber.Int64()) + + // get current prices from on-chain + chainValues, err = client.GetPrices(supportedFeedIndexes) + if err != nil { + return err + } + logger.Info("chain feeds values in block %d (after update): %v", receipt.BlockNumber.Int64(), chainValues) return nil } diff --git a/go-client/provider/feed_provider.go b/go-client/provider/feed_provider.go index 6f961a8..3bf5ac8 100644 --- a/go-client/provider/feed_provider.go +++ b/go-client/provider/feed_provider.go @@ -1,7 +1,6 @@ package provider import ( - "fast-updates-client/logger" "math" "math/big" "math/rand" @@ -29,8 +28,6 @@ func GetDeltas(chainValues []float64, providerValues []float64, valueIndexToFeed scaleDiff, _ := new(big.Int).Sub(scale, new(big.Int).Exp(big.NewInt(2), big.NewInt(127), nil)).Float64() scaleDiff = scaleDiff / math.Pow(2, 127) - logger.Info("chain feeds values: %v, provider feeds values: %v", chainValues, providerValues) - lastFeedIndex := valueIndexToFeedIndex[len(valueIndexToFeedIndex)-1] deltasList := make([]byte, lastFeedIndex+1) // for index := range deltasList { @@ -62,7 +59,6 @@ func GetDeltas(chainValues []float64, providerValues []float64, valueIndexToFeed } deltasString := string(deltasList) - logger.Info("deltas: %s", deltasString) deltas, err := StringToDeltas(deltasString) return deltas, deltasString, err