Skip to content

Commit

Permalink
Hip-904 account changes supporting pending airdrops (#389)
Browse files Browse the repository at this point in the history
* feat: HIP-904 account changes

Signed-off-by: ibankov <[email protected]>

* add account id to account_airdrop.proto

Signed-off-by: ibankov <[email protected]>

* Refactor account_airdrop.proto

Signed-off-by: ibankov <[email protected]>

* Change Airdrop record value

Signed-off-by: ibankov <[email protected]>

* Doc fixes

Signed-off-by: ibankov <[email protected]>

* Reverting airdrop record to use pending airdrop value

Signed-off-by: ibankov <[email protected]>

* Addressing comments

Signed-off-by: ibankov <[email protected]>

* Fixing numeration

Signed-off-by: ibankov <[email protected]>

---------

Signed-off-by: ibankov <[email protected]>
Co-authored-by: Valentin Tronkov <[email protected]>
Signed-off-by: Valentin Tronkov <[email protected]>
  • Loading branch information
ibankov and vtronkov committed Jul 23, 2024
1 parent a05b3f6 commit 9665a44
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
11 changes: 11 additions & 0 deletions services/state/token/account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ message Account {
* It will be null if if the account is not a contract or the contract has no storage mappings.
*/
bytes first_contract_storage_key = 33;

/**
* A pending airdrop ID at the head of the linked list for this account
* from the account airdrops map.<br/>
* The account airdrops are connected by including the "next" and "previous"
* `PendingAirdropID` in each `AccountAirdrop` message.
* <p>
* This value SHALL NOT be empty if this account is "sender" for any
* pending airdrop, and SHALL be empty otherwise.
*/
PendingAirdropId head_pending_airdrop_id = 34;
}

/**
Expand Down
70 changes: 70 additions & 0 deletions services/state/token/account_pending_airdrop.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
syntax = "proto3";

package proto;

/*
* Copyright (C) 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import "basic_types.proto";

option java_package = "com.hederahashgraph.api.proto.java";
// <<<pbj.java_package = "com.hedera.hapi.node.state.token">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;


/**
* A node within a doubly linked list of pending airdrop references.<br/>
* This internal state message forms the entries in a doubly-linked list
* of references to pending airdrop entries that are "owed" by a particular
* account as "sender".
*
* Each entry in this list MUST refer to an existing pending airdrop.<br/>
* The pending airdrop MUST NOT be claimed.<br/>
* The pending airdrop MUST NOT be canceled.<br/>
* The pending airdrop `sender` account's `head_pending_airdrop_id` field
* MUST match the `pending_airdrop_id` field in this message.
*
* ### Record Stream Effects
* This value is not currently published in the record stream.
*/
message AccountPendingAirdrop {
/**
* The value of the current airdrop id. SHALL NOT be set for non fungible tokens
*/
PendingAirdropValue pending_airdrop_value = 1;

/**
* A pending airdrop identifier.<br/>
* This identifies the specific pending airdrop that precedes this position
* within the doubly linked list of pending airdrops "owed" by the sending
* account associated with this account airdrop "list".
* <p>
* This SHALL match `pending_airdrop_id` if this is the only entry
* in the "list".
*/
PendingAirdropId previous_airdrop = 2;

/**
* A pending airdrop identifier.<br/>
* This identifies the specific pending airdrop that follows this position
* within the doubly linked list of pending airdrops "owed" by the sending
* account associated with this account airdrop "list".
* <p>
* This SHALL match `pending_airdrop_id` if this is the only entry
* in the "list".
*/
PendingAirdropId next_airdrop = 3;
}

0 comments on commit 9665a44

Please sign in to comment.