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(tokenUpdateTransaction): Implement TokenUpdateTransaction E2E tests: TCK #263

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4868341
feat: add tests up to custom fees
rwalworth Aug 8, 2024
6496dff
feat: first draft of all tests
rwalworth Aug 9, 2024
2abd4ea
fix: test issues
rwalworth Aug 28, 2024
864c3fc
fix: kyc key doesn't need to sign tokencreate
rwalworth Aug 28, 2024
808ec38
fix: key tests
rwalworth Aug 28, 2024
a51a3e2
fix: creating a token with freezeDefault=true requires a freeze key
rwalworth Aug 28, 2024
b72b95d
fix: get most tests working
rwalworth Aug 30, 2024
386910e
fix: align tests with specs
rwalworth Aug 30, 2024
d0fabaa
feat: add new decimals tests
rwalworth Sep 3, 2024
5b788f1
feat: add additional int tests
rwalworth Sep 3, 2024
51e92ef
fix: add new custom fees tests
rwalworth Sep 4, 2024
d4b0897
fix: custom fee tests to work
rwalworth Sep 4, 2024
19c8dcf
fix: incorrectly numbered test
rwalworth Sep 4, 2024
a7084c1
style: fix white space
rwalworth Sep 4, 2024
fcee181
feat: finish token id and symbol tests
rwalworth Sep 9, 2024
ce7a675
feat: add name tests
rwalworth Sep 9, 2024
cffd5a7
feat: add treasury account ID tests
rwalworth Sep 9, 2024
7e4a565
feat: finish adding all tests
rwalworth Sep 9, 2024
170985e
feat: add remaining tests
rwalworth Sep 11, 2024
1e76170
feat: add new tests to clear out token role keys
rwalworth Sep 12, 2024
b194e81
Merge branch 'main' into 00238-tck-implement-json-rpc-method-for-toke…
rwalworth Oct 23, 2024
0114550
fix: Added await to functions, compared raw key values, and aligned w…
ivaylogarnev-limechain Oct 30, 2024
1ffb4bf
fix: Deleted int64 + 1 tests in both docs/tests code
ivaylogarnev-limechain Oct 30, 2024
06b68b0
fix: Added tests for empty KeyList as prop for a key
ivaylogarnev-limechain Oct 30, 2024
638b745
refactor: Removed retrieving the tokenID from response logic
ivaylogarnev-limechain Oct 31, 2024
e22b561
fix: Removed all uint64 tests both in docs and in js, removed unnecce…
ivaylogarnev-limechain Nov 1, 2024
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
42 changes: 20 additions & 22 deletions test-specifications/token-service/tokenUpdateTransaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,17 +509,16 @@ The tests contained in this specification will assume that two valid token were
| 2 | Updates a mutable token with an auto renew period set to 0 seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=0, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 3 | Updates a mutable token with an auto renew period set to -1 seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=-1, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 4 | Updates a mutable token with an auto renew period set to 9,223,372,036,854,775,807 (int64 max) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=9223372036854775807, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 5 | Updates a mutable token with an auto renew period set to 9,223,372,036,854,775,806 (int64 max - 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=9223372036854775806, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 6 | Updates a mutable token with an auto renew period set to 9,223,372,036,854,775,808 (int64 max + 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=9223372036854775808, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 7 | Updates a mutable token with an auto renew period set to 18,446,744,073,709,551,615 (uint64 max) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=18446744073709551615, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 8 | Updates a mutable token with an auto renew period set to 18,446,744,073,709,551,614 (uint64 max - 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=18446744073709551614, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 9 | Updates a mutable token with an auto renew period set to -9,223,372,036,854,775,808 (int64 min) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=-9223372036854775808, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 10 | Updates a mutable token with an auto renew period set to -9,223,372,036,854,775,8087 (int64 min + 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=-9223372036854775807, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 11 | Updates a mutable token with an auto renew period set to 60 days (5,184,000 seconds) | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=5184000, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token's auto renew period equals 5,184,000 seconds. | N |
| 12 | Updates a mutable token with an auto renew period set to 30 days (2,592,000 seconds) | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=2592000, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token's auto renew period equals 2,592,000 seconds. | N |
| 13 | Updates a mutable token with an auto renew period set to 30 days minus one second (2,591,999 seconds) | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=2591999, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 14 | Updates a mutable token with an auto renew period set to 8,000,001 seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=8000001, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token's auto renew period equals 8,000,001 seconds. | N |
| 15 | Updates a mutable token with an auto renew period set to 8,000,002 seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=8000002, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 5 | Updates a mutable token with an auto renew period set to 9,223,372,036,854,775,806 (int64 max - 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=9223372036854775806, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N | |
| 6 | Updates a mutable token with an auto renew period set to 18,446,744,073,709,551,615 (uint64 max) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=18446744073709551615, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 7 | Updates a mutable token with an auto renew period set to 18,446,744,073,709,551,614 (uint64 max - 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=18446744073709551614, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 8 | Updates a mutable token with an auto renew period set to -9,223,372,036,854,775,808 (int64 min) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=-9223372036854775808, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 9 | Updates a mutable token with an auto renew period set to -9,223,372,036,854,775,8087 (int64 min + 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=-9223372036854775807, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 10 | Updates a mutable token with an auto renew period set to 60 days (5,184,000 seconds) | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=5184000, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token's auto renew period equals 5,184,000 seconds. | N |
| 11 | Updates a mutable token with an auto renew period set to 30 days (2,592,000 seconds) | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=2592000, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token's auto renew period equals 2,592,000 seconds. | N |
| 12 | Updates a mutable token with an auto renew period set to 30 days minus one second (2,591,999 seconds) | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=2591999, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
| 13 | Updates a mutable token with an auto renew period set to 8,000,001 seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=8000001, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token's auto renew period equals 8,000,001 seconds. | N |
| 14 | Updates a mutable token with an auto renew period set to 8,000,002 seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, autoRenewPeriod=8000002, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_RENEWAL_PERIOD response code from the network. | N |
rwalworth marked this conversation as resolved.
Show resolved Hide resolved

#### JSON Request Example

Expand Down Expand Up @@ -557,17 +556,16 @@ The tests contained in this specification will assume that two valid token were
| 2 | Updates a mutable token to an expiration time of 0 | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=0, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 3 | Updates a mutable token to an expiration time of -1 | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=-1, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 4 | Updates a mutable token to an expiration time of 9,223,372,036,854,775,807 (int64 max) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=9223372036854775807, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 5 | Updates a mutable token to an expiration time of 9,223,372,036,854,775,806 (int64 max - 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=9223372036854775806, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 6 | Updates a mutable token to an expiration time of 9,223,372,036,854,775,808 (int64 max + 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=9223372036854775808, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 7 | Updates a mutable token to an expiration time of 18,446,744,073,709,551,615 (uint64 max) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=18446744073709551615, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 8 | Updates a mutable token to an expiration time of 18,446,744,073,709,551,614 (uint64 max - 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=18446744073709551614, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 9 | Updates a mutable token to an expiration time of -9,223,372,036,854,775,808 (int64 min) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=-9223372036854775808, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 10 | Updates a mutable token to an expiration time of -9,223,372,036,854,775,807 (int64 min + 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=-9223372036854775807, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 11 | Updates a mutable token to an expiration time of 60 days (5,184,000 seconds) from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 5184000, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token has an expiration time 5,184,000 seconds (60 days) from the current epoch time. | N |
| 12 | Updates a mutable token to an expiration time of 30 days (2,592,000 seconds) from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 2592000, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token has an expiration time 2,592,000 seconds (30 days) from the current epoch time. | N |
| 13 | Updates a mutable token to an expiration time of 30 days minus one second (2,591,999 seconds) from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 2591999, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 14 | Updates a mutable token with an expiration time 8,000,001 seconds from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 8000001, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token has an expiration time 8,000,001 from the current epoch time. | N |
| 15 | Updates a mutable token with an expiration time 8,000,002 seconds from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 8000002, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 5 | Updates a mutable token to an expiration time of 9,223,372,036,854,775,806 (int64 max - 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=9223372036854775806, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N | | N |
| 6 | Updates a mutable token to an expiration time of 18,446,744,073,709,551,615 (uint64 max) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=18446744073709551615, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 7 | Updates a mutable token to an expiration time of 18,446,744,073,709,551,614 (uint64 max - 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=18446744073709551614, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 8 | Updates a mutable token to an expiration time of -9,223,372,036,854,775,808 (int64 min) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=-9223372036854775808, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 9 | Updates a mutable token to an expiration time of -9,223,372,036,854,775,807 (int64 min + 1) seconds | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=-9223372036854775807, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 10 | Updates a mutable token to an expiration time of 60 days (5,184,000 seconds) from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 5184000, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token has an expiration time 5,184,000 seconds (60 days) from the current epoch time. | N |
| 11 | Updates a mutable token to an expiration time of 30 days (2,592,000 seconds) from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 2592000, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token has an expiration time 2,592,000 seconds (30 days) from the current epoch time. | N |
| 12 | Updates a mutable token to an expiration time of 30 days minus one second (2,591,999 seconds) from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 2591999, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
| 13 | Updates a mutable token with an expiration time 8,000,001 seconds from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 8000001, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update succeeds and the token has an expiration time 8,000,001 from the current epoch time. | N |
| 14 | Updates a mutable token with an expiration time 8,000,002 seconds from the current time | tokenId=<CREATED_MUTABLE_TOKEN_ID>, expirationTime=<CURRENT_TIME> + 8000002, commonTransactionParams.signers=[<CREATED_MUTABLE_TOKEN_ADMIN_KEY>] | The token update fails with an INVALID_EXPIRATION_TIME response code from the network. | N |
rwalworth marked this conversation as resolved.
Show resolved Hide resolved

#### JSON Request Example

Expand Down
2 changes: 1 addition & 1 deletion test/token-service/test_tokenCreateTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ BigInt.prototype.toJSON = function () {
/**
* Tests for TokenCreateTransaction
*/
describe.only("TokenCreateTransaction", function () {
describe("TokenCreateTransaction", function () {
// Tests should not take longer than 30 seconds to fully execute.
this.timeout(30000);

Expand Down
Loading