Skip to content

Commit

Permalink
Adjust debug API to changes of ads.Map and ads.Set
Browse files Browse the repository at this point in the history
  • Loading branch information
jonastheis committed Oct 27, 2023
1 parent bb8d582 commit 59e7583
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion components/debugapi/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ func getSlotBlockIDs(index iotago.SlotIndex) (*BlockChangesResponse, error) {
}

includedBlocks := make([]string, 0)
tangleTree := ads.NewSet[iotago.Identifier](mapdb.NewMapDB(), iotago.BlockID.Bytes, iotago.BlockIDFromBytes)
tangleTree := ads.NewSet[iotago.Identifier](
mapdb.NewMapDB(),
iotago.Identifier.Bytes,
iotago.IdentifierFromBytes,
iotago.BlockID.Bytes,

Check failure on line 23 in components/debugapi/blocks.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/debugapi/blocks.go#L23

too many arguments in call to ads.NewSet[iotago.Identifier]
Raw output
components/debugapi/blocks.go:23:3: too many arguments in call to ads.NewSet[iotago.Identifier]
	have (kvstore.KVStore, func(iotago.Identifier) ([]byte, error), func(bytes []byte) (iotago.Identifier, int, error), func(iotago.BlockID) ([]byte, error), func(b []byte) (iotago.BlockID, int, error))
	want (kvstore.KVStore, kvstore.ObjectToBytes[K], kvstore.BytesToObject[K]) (typecheck)
		iotago.BlockID.Bytes,
		^
iotago.BlockIDFromBytes,
)

_ = blocksForSlot.StreamKeys(func(blockID iotago.BlockID) error {
includedBlocks = append(includedBlocks, blockID.String())
Expand Down
8 changes: 7 additions & 1 deletion components/debugapi/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ func storeTransactionsPerSlot(scd *notarization.SlotCommittedDetails) error {
if err != nil {
return ierrors.Wrapf(err, "failed to retrieve state diff for slot %d", slot)
}
mutationsTree := ads.NewSet[iotago.Identifier](mapdb.NewMapDB(), iotago.TransactionID.Bytes, iotago.TransactionIDFromBytes)
mutationsTree := ads.NewSet[iotago.Identifier](
mapdb.NewMapDB(),
iotago.Identifier.Bytes,
iotago.IdentifierFromBytes,
iotago.TransactionID.Bytes,

Check failure on line 28 in components/debugapi/transactions.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] components/debugapi/transactions.go#L28

too many arguments in call to ads.NewSet[iotago.Identifier]
Raw output
components/debugapi/transactions.go:28:3: too many arguments in call to ads.NewSet[iotago.Identifier]
	have (kvstore.KVStore, func(iotago.Identifier) ([]byte, error), func(bytes []byte) (iotago.Identifier, int, error), func(iotago.TransactionID) ([]byte, error), func(b []byte) (iotago.TransactionID, int, error))
	want (kvstore.KVStore, kvstore.ObjectToBytes[K], kvstore.BytesToObject[K]) (typecheck)
		iotago.TransactionID.Bytes,
		^
iotago.TransactionIDFromBytes,
)
tcs := &TransactionsChangesResponse{
Index: slot,
IncludedTransactions: make([]string, 0),
Expand Down

0 comments on commit 59e7583

Please sign in to comment.