diff --git a/.github/workflows/build-short.yml b/.github/workflows/build-short.yml index 022f8db..b11b76e 100644 --- a/.github/workflows/build-short.yml +++ b/.github/workflows/build-short.yml @@ -1,7 +1,7 @@ name: 'Build and Test Hub' -on: - push: +on: ["push", "pull_request"] + jobs: build: runs-on: ubuntu-latest diff --git a/db/prefixes/prefixes.go b/db/prefixes/prefixes.go index 0c9f67b..4161f35 100644 --- a/db/prefixes/prefixes.go +++ b/db/prefixes/prefixes.go @@ -513,7 +513,7 @@ type HashXHistoryKey struct { } type HashXHistoryValue struct { - TxNums []uint32 `struct:"lsb" struct-while:"!_eof" json:"tx_nums"` + HashXes []uint16 `struct-while:"!_eof" json:"hashxes"` } func (k *HashXHistoryKey) String() string { @@ -538,10 +538,10 @@ func (k *HashXHistoryKey) PackKey() []byte { } func (v *HashXHistoryValue) PackValue() []byte { - n := len(v.TxNums) - value := make([]byte, n*4) - for i, x := range v.TxNums { - binary.LittleEndian.PutUint32(value[i*4:], x) + n := len(v.HashXes) + value := make([]byte, n*2) + for i, x := range v.HashXes { + binary.BigEndian.PutUint16(value[i*2:], x) } return value @@ -600,13 +600,13 @@ func HashXHistoryKeyUnpack(key []byte) *HashXHistoryKey { } func HashXHistoryValueUnpack(value []byte) *HashXHistoryValue { - n := len(value) / 4 - txnums := make([]uint32, n) + n := len(value) / 2 + hashxes := make([]uint16, n) for i := 0; i < n; i++ { - txnums[i] = binary.LittleEndian.Uint32(value[i*4:]) + hashxes[i] = binary.BigEndian.Uint16(value[i*2:]) } return &HashXHistoryValue{ - TxNums: txnums, + HashXes: hashxes, } }