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

feat: Token Airdrop Transaction #2492

Merged
merged 33 commits into from
Sep 12, 2024
Merged

Conversation

ivaylonikolov7
Copy link
Contributor

@ivaylonikolov7 ivaylonikolov7 commented Aug 27, 2024

Description:
HIP 904 - Token Airdrop Transaction

This PR introduces AirdropTokenTransaction transaction. Adds AccountAmount and AirdropTokenTransfer helper classes.

Related issue(s):
Fixes #2465

Notes for reviewer:
Needs to have integration tests to be ready.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit)
  • Tested (integration tests)

@ivaylonikolov7 ivaylonikolov7 changed the title Feat/tokenairdroptransaction Feat: Token Airdrop Transaction Aug 27, 2024
@ivaylonikolov7 ivaylonikolov7 self-assigned this Aug 27, 2024
@ivaylonikolov7 ivaylonikolov7 added this to the v2.51.0 milestone Aug 27, 2024
src/token/AirdropTokenTransfer.js Outdated Show resolved Hide resolved
src/token/AirdropNftTransfer.js Outdated Show resolved Hide resolved
src/token/AccountAmount.js Outdated Show resolved Hide resolved
@ivaylonikolov7 ivaylonikolov7 changed the title Feat: Token Airdrop Transaction feat: Token Airdrop Transaction Aug 30, 2024
@ivaylonikolov7 ivaylonikolov7 marked this pull request as ready for review August 30, 2024 12:56
@ivaylonikolov7 ivaylonikolov7 requested review from a team as code owners August 30, 2024 12:56
src/token/PendingAirdrop.js Outdated Show resolved Hide resolved
test/integration/AirdropTokenIntegrationTest.js Outdated Show resolved Hide resolved
test/integration/AirdropTokenIntegrationTest.js Outdated Show resolved Hide resolved
src/token/AccountAmount.js Outdated Show resolved Hide resolved
Copy link
Contributor

@0xivanov 0xivanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall.

test/integration/TokenAirdropIntegrationTest.js Outdated Show resolved Hide resolved
test/integration/TokenAirdropIntegrationTest.js Outdated Show resolved Hide resolved
test/integration/TokenAirdropIntegrationTest.js Outdated Show resolved Hide resolved
test/integration/TokenAirdropIntegrationTest.js Outdated Show resolved Hide resolved
Copy link
Contributor

@ivaylogarnev-limechain ivaylogarnev-limechain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

0xivanov
0xivanov previously approved these changes Sep 9, 2024
Copy link
Contributor

@0xivanov 0xivanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/token/AbstractTokenTransfer.js Outdated Show resolved Hide resolved
src/token/AbstractTokenTransfer.js Outdated Show resolved Hide resolved
src/token/AbstractTokenTransfer.js Outdated Show resolved Hide resolved
src/token/PendingAirdropId.js Show resolved Hide resolved
src/token/PendingAirdropRecord.js Show resolved Hide resolved
src/token/TokenAirdropTransaction.js Outdated Show resolved Hide resolved
test/unit/TokenAirdropTransaction.js Outdated Show resolved Hide resolved
agadzhalov
agadzhalov previously approved these changes Sep 10, 2024
Copy link
Contributor

@agadzhalov agadzhalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ty @ivaylonikolov7 🚀

0xivanov
0xivanov previously approved these changes Sep 11, 2024
Copy link
Contributor

@0xivanov 0xivanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
Signed-off-by: Ivaylo Nikolov <[email protected]>
* feat: add airdrop claim and cancel transactions

Signed-off-by: Ivaylo Nikolov <[email protected]>

* chore: update protobufs

Signed-off-by: Ivaylo Nikolov <[email protected]>

* feat: update commit messages

Signed-off-by: Ivaylo Nikolov <[email protected]>

* test: add unit tests for cancel and claim

Signed-off-by: Ivaylo Nikolov <[email protected]>

* wip(test): add integration tests for cancel and claim transactions

Signed-off-by: Ivaylo Nikolov <[email protected]>

* fix: claim used the wrong channel function

Signed-off-by: Ivaylo Nikolov <[email protected]>

* refactor: rename transaction name

Signed-off-by: Ivaylo Nikolov <[email protected]>

* refactor: remove claim references in airdropcancel integration test

Signed-off-by: Ivaylo Nikolov <[email protected]>

* test(fix): fix not working test for airdrop cancel and claim

Signed-off-by: Ivaylo Nikolov <[email protected]>

* fix: airdropcancel transaction should work on sender not receiver

Signed-off-by: Ivaylo Nikolov <[email protected]>

* feat: add token airdrop example

Signed-off-by: Ivaylo Nikolov <[email protected]>

* refactor: rename transactions to have the same name as java

Signed-off-by: Ivaylo Nikolov <[email protected]>

* refactor: remove redundant imports and empty lines

Signed-off-by: Ivaylo Nikolov <[email protected]>

* refactor: rename transaction tests  to have the same name as java sdk

Signed-off-by: Ivaylo Nikolov <[email protected]>

* docs: add licenses

Signed-off-by: Ivaylo Nikolov <[email protected]>

* fix: remove dead code from token cancel

Signed-off-by: Ivaylo Nikolov <[email protected]>

* refactor: consistency in constructor

Signed-off-by: Ivaylo Nikolov <[email protected]>

* refactor: change airdrop_supply_per_person naming

Signed-off-by: Ivaylo Nikolov <[email protected]>

* test: fix setting sender id

Signed-off-by: Ivaylo Nikolov <[email protected]>

* refactor: specify what kind of tokens are airdropped

Signed-off-by: Ivaylo Nikolov <[email protected]>

---------

Signed-off-by: Ivaylo Nikolov <[email protected]>
Copy link

sonarcloud bot commented Sep 11, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
24.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link
Contributor

@agadzhalov agadzhalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ivaylonikolov7 ivaylonikolov7 merged commit 5673280 into main Sep 12, 2024
10 of 11 checks passed
@ivaylonikolov7 ivaylonikolov7 deleted the feat/tokenairdroptransaction branch September 12, 2024 09:20
@ivaylonikolov7 ivaylonikolov7 mentioned this pull request Sep 12, 2024
@ivaylonikolov7 ivaylonikolov7 linked an issue Sep 13, 2024 that may be closed by this pull request
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants