Add the following classes in hedera-token-service-impl:
ReadableAirdropStore interface
ReadableAirdropStoreImpl that would implement ReadableAirdropStore, holding ReadableKVState<PendingAirdropId, PendingAirdropValue> airdropsState as a field and implement the interface's methods
WritableAirdropStore that would extend ReadableAirdropStoreImpl and implement the put and remove methods
When implementing the put method - if there is already an existing airdrop for a user make sure to sub the tokens for that user. E.g. user A sends user B 10 tokens. Then it sends another 5 - the total tokens should be 15.
Define the new readable store in ReadableStoreFactory
Define the new writable store in WritableStoreFactory
hedera-token-service-impl
:ReadableAirdropStore
interfaceReadableAirdropStoreImpl
that would implementReadableAirdropStore
, holdingReadableKVState<PendingAirdropId, PendingAirdropValue> airdropsState
as a field and implement the interface's methodsWritableAirdropStore
that would extendReadableAirdropStoreImpl
and implement theput
andremove
methodsput
method - if there is already an existing airdrop for a user make sure to sub the tokens for that user. E.g. user A sends user B 10 tokens. Then it sends another 5 - the total tokens should be 15.ReadableStoreFactory
WritableStoreFactory
For more context read: https://github.com/hashgraph/hedera-services/pull/12792