Skip to content

Commit

Permalink
feat: change feedhash type
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Jul 25, 2024
1 parent ad66379 commit 1eaa2df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion node/pkg/dal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (c *Collector) IncomingDataToOutgoingData(ctx context.Context, data aggrega
Value: strconv.FormatInt(data.GlobalAggregate.Value, 10),
AggregateTime: strconv.FormatInt(data.GlobalAggregate.Timestamp.Unix(), 10),
Proof: orderedProof,
FeedHash: [32]byte(c.FeedHashes[data.GlobalAggregate.ConfigID]),
FeedHash: c.FeedHashes[data.GlobalAggregate.ConfigID],
Decimals: DefaultDecimals,
}, nil
}
Expand Down
12 changes: 6 additions & 6 deletions node/pkg/dal/common/types.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package common

type OutgoingSubmissionData struct {
Symbol string `json:"symbol"`
Value string `json:"value"`
AggregateTime string `json:"aggregateTime"`
Proof []byte `json:"proof"`
FeedHash [32]byte `json:"feedHash"`
Decimals string `json:"decimals"`
Symbol string `json:"symbol"`
Value string `json:"value"`
AggregateTime string `json:"aggregateTime"`
Proof []byte `json:"proof"`
FeedHash []byte `json:"feedHash"`
Decimals string `json:"decimals"`
}
5 changes: 4 additions & 1 deletion node/script/test_dal_consumer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ func main() {
panic("failed to convert string to big int")
}

feedHashes := [][32]byte{result.FeedHash}
var feedHash [32]byte
copy(feedHash[:], result.FeedHash)

feedHashes := [][32]byte{feedHash}
values := []*big.Int{&submissionVal}
timestamps := []*big.Int{&submissionTime}
proofs := [][]byte{result.Proof}
Expand Down

0 comments on commit 1eaa2df

Please sign in to comment.