Skip to content

Conversation

@hayarobi
Copy link
Member

I found that the commit added to 2.8.1 has bugs to treat optional argument as required.

@hayarobi hayarobi requested a review from kroggen July 27, 2025 00:10
@kroggen
Copy link
Member

kroggen commented Jul 27, 2025

You forgot to merge #421 before this

After doing that, rebase this one

@kroggen
Copy link
Member

kroggen commented Jul 27, 2025

These changes cause 28 errors when testing with herajs

@herajs/client:   1) Aergo.Accounts
@herajs/client:        sendTransaction()
@herajs/client:          should return hash for signed and comitted tx:
@herajs/client:      Error: 3 INVALID_ARGUMENT: invalid tx hash
@herajs/client: 
@herajs/client:   2) Aergo.Accounts
@herajs/client:        sendTransaction()
@herajs/client:          should send to a name:
@herajs/client:      Error: 3 INVALID_ARGUMENT: invalid tx hash
@herajs/client: 
@herajs/client:   3) Aergo.Accounts
@herajs/client:        sendTransaction()
@herajs/client:          should error when sending to unregistered name:
@herajs/client:       AssertionError: expected promise to be rejected with an error including 'UNDEFINED_ERROR: tx invalid recipient' but got '3 INVALID_ARGUMENT: invalid tx hash'
@herajs/client:       + expected - actual
@herajs/client:       -3 INVALID_ARGUMENT: invalid tx hash
@herajs/client:       +UNDEFINED_ERROR: tx invalid recipient
@herajs/client: 
@herajs/client:   4) Aergo.Accounts
@herajs/client:        signTX()
@herajs/client:          should return tx which has a unlocked account sign:
@herajs/client:      Error: 3 INVALID_ARGUMENT: input tx is empty
@herajs/client: 
@herajs/client:   5) Aergo.Accounts
@herajs/client:        sendSignedTransaction()
@herajs/client:          should sign, commit, and retrieve transaction:
@herajs/client:      Error: 3 INVALID_ARGUMENT: input tx is empty
@herajs/client: 
@herajs/client:   6) Aergo.Accounts
@herajs/client:        sendSignedTransaction()
@herajs/client:          should catch a max payload error:
@herajs/client:      Error: 3 INVALID_ARGUMENT: input tx is empty
@herajs/client: 
@herajs/client:   7) Aergo.Accounts
@herajs/client:        signTX(),sendSignedTransaction()Multiple
@herajs/client:          should not timeout:
@herajs/client:      Error: 3 INVALID_ARGUMENT: input tx is empty
@herajs/client: 
@herajs/client:   8) Aergo.Accounts
@herajs/client:        getNameInfo()
@herajs/client:          should return account information for name:
@herajs/client:      Error: 3 INVALID_ARGUMENT: invalid tx hash
@herajs/client: 
@herajs/client:   10) Aergo
@herajs/client:        getNonce()
@herajs/client:          should update nonce after submitting transaction:
@herajs/client:      Error: 3 INVALID_ARGUMENT: invalid tx hash
@herajs/client: 
@herajs/client:   11) Aergo
@herajs/client:        getNonce()
@herajs/client:          should return transaction hash in block:
@herajs/client:      Error: Missing argument block hash or number
@herajs/client: 
@herajs/client:   12) Aergo
@herajs/client:        getTransaction()
@herajs/client:          "before each" hook for "should return transaction info by hash":
@herajs/client:      Error: 3 INVALID_ARGUMENT: input tx is empty
@herajs/client: 
@herajs/client:   13) Aergo
@herajs/client:        getBlockMetadata and getBlockBody
@herajs/client:          should retrieve metadata and body separately:
@herajs/client:      Error: 3 INVALID_ARGUMENT: input tx is empty
@herajs/client: 
@herajs/client:   14) Aergo
@herajs/client:        getBlockMetadata and getBlockBody
@herajs/client:          should page getBlockBody:
@herajs/client:      Error: 3 INVALID_ARGUMENT: input tx is empty
@herajs/client: 
@herajs/client:   15) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should deploy a smart contract:
@herajs/client:      Error: 3 INVALID_ARGUMENT: invalid tx hash
@herajs/client: 
@herajs/client:   16) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should get a smart contract's ABI:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   17) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should load ABI from smart contract:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   18) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should call a smart contract:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   19) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should call a smart contract with 1 argument:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   20) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should call a smart contract with 2 arguments:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   21) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should query a smart contract using Getter:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   22) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should query a smart contract without ABI:
@herajs/client:      TypeError: Cannot read properties of undefined (reading 'toGrpc')
@herajs/client: 
@herajs/client:   23) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should query a smart contract state variable:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   24) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should query a smart contract state variable without ABI:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   25) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should query a smart contract state variable returning proof:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   26) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should query a smart contract state variable without ABI returning proof:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   27) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should throw when quering non existing state:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   28) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should get events from a deployed contract:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined
@herajs/client: 
@herajs/client:   29) Contracts
@herajs/client:        deploy, call, query a simple contract
@herajs/client:          should stream events from a deployed contract:
@herajs/client:      Error: Instantiate Address with raw bytes, a string in base58-check encoding, or a valid name, not undefined

@hayarobi
Copy link
Member Author

These changes cause 28 errors when testing with herajs

Does it cause test of herajs? Maybe the tests send wrong input parameters. I tried to check by myself, but failed to run test. I'm struggling with node-gyp and mocha now, I will investigate the test again.

@kroggen
Copy link
Member

kroggen commented Jul 27, 2025

Just use a Linux container, it is much easier

Does it cause test of herajs?

This sentence is not clear

Note that all these tests pass when run with the current develop branch. They only fail when these changes to the RPC are applied.

@hayarobi
Copy link
Member Author

hayarobi commented Jul 28, 2025

I was failed to test herajs finally, but I seems to find the suspicious codes of aergosvr. I pushed the patch.

@kroggen
Copy link
Member

kroggen commented Jul 31, 2025

Yeah, most tests are now passing
It just has this one marked as "pending":

@herajs/client:     getVotingResult()
@herajs/client:       - should return given number of voting result

@kroggen
Copy link
Member

kroggen commented Jul 31, 2025

I now saw that this specific test appears as pending in the previous versions as well, so it is not something new

But you forgot about #421

Copy link
Member

@kroggen kroggen left a comment

Choose a reason for hiding this comment

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

OK, it passed with the new integration tests as well

@hayarobi hayarobi merged commit 96f411c into develop Jul 31, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants