Skip to content

Commit

Permalink
removed tick data unionData field entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
0xluk committed Aug 28, 2024
1 parent 1bdc80c commit a2ffda8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1
github.com/pkg/errors v0.9.1
github.com/qubic/go-node-connector v0.10.0
github.com/qubic/go-node-connector v0.10.1
github.com/qubic/go-schnorrq v1.0.0
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.26.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/qubic/go-node-connector v0.10.0 h1:/hus1QVuONBSxGoFOIYXJ0XFrvYVTfv7zPkQE7mtMUw=
github.com/qubic/go-node-connector v0.10.0/go.mod h1:Vb2T4mjp8YClnqGi+baiaHkjhulBmT0bpzzEPbzlqQ0=
github.com/qubic/go-node-connector v0.10.1 h1:sSGA9zWhMkHml2tLPwy9Kfl1JHbAFwFHhewRxlxTe7E=
github.com/qubic/go-node-connector v0.10.1/go.mod h1:Vb2T4mjp8YClnqGi+baiaHkjhulBmT0bpzzEPbzlqQ0=
github.com/qubic/go-schnorrq v1.0.0 h1:EiCC3v9v3esFFfhKNEGdAI4DFIY3Dm/wbH327pC5qco=
github.com/qubic/go-schnorrq v1.0.0/go.mod h1:KW64PcvyF4+cBA22pCx9wcoKDqPIbGz0EZ9dCZWV6Yo=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
Expand Down
9 changes: 0 additions & 9 deletions validator/tick/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func qubicToProto(tickData types.TickData) (*protobuff.TickData, error) {
Epoch: uint32(tickData.Epoch),
TickNumber: tickData.Tick,
Timestamp: uint64(timestamp),
VarStruct: varStructToProto(tickData.UnionData),
TimeLock: tickData.Timelock[:],
TransactionIds: transactionIds,
ContractFees: contractFeesToProto(tickData.ContractFees),
Expand Down Expand Up @@ -59,11 +58,3 @@ func contractFeesToProto(contractFees [1024]int64) []int64 {
}
return protoContractFees
}

func varStructToProto(varStruct [256]byte) []byte {
if varStruct == [256]byte{} {
return []byte{}
}

return varStruct[:]
}
3 changes: 0 additions & 3 deletions validator/tick/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func TestQubicToProto(t *testing.T) {
t.Fatalf("idTwo.FromPubKey() unexpected error: %v", err)
}

unionData := [256]byte{1, 2, 3, 4, 5}
timeLock := [32]byte{6, 4, 7, 4, 2}
transactionDigests := [1024][32]byte{digestOne, digestTwo}
contractFees := [1024]int64{1, 2, 3, 4, 5, 6, 7, 8, 9}
Expand All @@ -69,7 +68,6 @@ func TestQubicToProto(t *testing.T) {
Day: 5,
Month: 6,
Year: 23,
UnionData: unionData,
Timelock: timeLock,
TransactionDigests: transactionDigests,
ContractFees: contractFees,
Expand All @@ -81,7 +79,6 @@ func TestQubicToProto(t *testing.T) {
Epoch: 20,
TickNumber: 100,
Timestamp: 1685937782001,
VarStruct: unionData[:],
TimeLock: timeLock[:],
TransactionIds: []string{idOne.String(), idTwo.String()},
ContractFees: []int64{1, 2, 3, 4, 5, 6, 7, 8, 9},
Expand Down

0 comments on commit a2ffda8

Please sign in to comment.