Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify serialization #472

Merged
merged 29 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1aed560
Adjust retainer models to use stream package instead of marshalutil
jonastheis Oct 26, 2023
72c83bf
Adjust utxoledger to use stream package instead marshalutil
jonastheis Oct 27, 2023
d4668c2
Merge remote-tracking branch 'origin/develop' into feat/simplify-seri…
jonastheis Oct 27, 2023
5558829
Replace usage of marshalutil with stream package in network
jonastheis Oct 27, 2023
45e7996
Adjust settings to new stream package
jonastheis Oct 27, 2023
b8ff52b
Adjust to changes of ads.Map and ads.Set
jonastheis Oct 27, 2023
5383f66
Adjust new stream package
jonastheis Oct 27, 2023
bb8d582
Adjust accounts to new stream package and remove marshalutil usage
jonastheis Oct 27, 2023
59e7583
Adjust debug API to changes of ads.Map and ads.Set
jonastheis Oct 27, 2023
6a5e28b
Adjust to renaming changes in https://github.com/iotaledger/hive.go/c…
jonastheis Oct 31, 2023
e242934
Improve serialization of accounts: get rid of PositionedWriter and bi…
jonastheis Oct 31, 2023
a1867df
Merge remote-tracking branch 'origin/develop' into feat/simplify-seri…
jonastheis Oct 31, 2023
cd0292b
Remove PositionedWriter
jonastheis Nov 1, 2023
96763c3
Adjust ValidatorPerformance to use stream package instead of manual b…
jonastheis Nov 1, 2023
0c643cf
Make (de)serialization of BlockIssuerKeys consistent using new method…
jonastheis Nov 2, 2023
3865cc4
Simplify typedKVstore usage
jonastheis Nov 3, 2023
6cdd097
Remove ioutils
jonastheis Nov 3, 2023
d406b7b
Adjust utxo ledger to use stream package instead of ioutils
jonastheis Nov 3, 2023
49a0be6
Remove dependency to github.com/orcaman/writerseeker
jonastheis Nov 6, 2023
7f5bd3d
Adjust utxo ledger to use stream package instead of manual binary.Read
jonastheis Nov 6, 2023
9e59adb
Merge remote-tracking branch 'origin/develop' into feat/simplify-seri…
jonastheis Nov 6, 2023
9cfc673
Update go.mod to latest hive.go
jonastheis Nov 6, 2023
82f433e
Fix bug with wrong serializer.SeriLengthPrefixType
jonastheis Nov 6, 2023
31e1aed
Fix deserialization of attestations in onAttestations
jonastheis Nov 6, 2023
a5a2cd2
Update to latest hive.go
jonastheis Nov 8, 2023
c868f92
Change utxo ledger snapshot diff to uint32
jonastheis Nov 8, 2023
50aba28
Change performance snapshot to uint32 where possible
jonastheis Nov 8, 2023
68a36c7
Change commitments snapshot to uint32
jonastheis Nov 8, 2023
d8aaf2f
Address review comments
jonastheis Nov 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify typedKVstore usage
  • Loading branch information
jonastheis committed Nov 3, 2023
commit 3865cc473957de43372d23b0443ef3a96e66f5b3
13 changes: 2 additions & 11 deletions pkg/protocol/engine/attestation/slotattestation/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,11 @@ func (m *Manager) trackerStorage(index iotago.SlotIndex) (*kvstore.TypedStore[io
return nil, ierrors.Wrapf(err, "failed to get extended realm for tracker of slot %d", index)
}

api := m.apiProvider.APIForSlot(index)

return kvstore.NewTypedStore[iotago.AccountID, *iotago.Attestation](trackerStorage,
iotago.AccountID.Bytes,
iotago.AccountIDFromBytes,
func(v *iotago.Attestation) ([]byte, error) {
return api.Encode(v)
},
func(bytes []byte) (object *iotago.Attestation, consumed int, err error) {
attestation := new(iotago.Attestation)
consumed, err = api.Decode(bytes, attestation)

return attestation, consumed, err
},
(*iotago.Attestation).Bytes,
iotago.AttestationFromBytes(m.apiProvider),
), nil
}

Expand Down