You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue covers the parts of the Stacks blockchain provider associated with blockchain data retrieval. This includes fetching the latest block height, checking message statuses, querying account balances, extracting cross-chain messages from blocks, and obtaining transaction receipts.
Implement QueryLatestHeight()
This method should query and return the latest block height from the Stacks blockchain.
QueryLatestHeight successfully retrieves the latest block height from the Stacks blockchain or returns an error if the Stacks node is unreachable or returns invalid data.
ShouldReceiveMessage and ShouldSendMessage both return true, nil
QueryBalance correctly retrieves the balance for a given Stacks address or returns an error if the Stacks node is unreachable or returns invalid data, or the address is invalid.
GenerateMessages successfully retrieves the block for the given height from the Stacks blockchain, correctly identifies and extracts all relevant cross-chain events from the block's transactions, and accurately parses event data into types.Message objects, including all required fields (MessageHeight, EventType, Src, Dst, Sn, Data) for both EmitMessage and CallMessage. It returns an empty slice and no error if no relevant events are found in the block and returns an error if the block retrieval fails or if there are issues parsing the event data
QueryTransactionReceipt successfully retrieves the transaction receipt for a given transaction hash and correctly populates the types.Receipt struct. It returns an error for non-existent or invalid transaction hashes.
Unit tests cover all methods and edge cases with >80% code coverage
Integration tests confirm functionality against Stacks testnet
The text was updated successfully, but these errors were encountered:
This issue covers the parts of the Stacks blockchain provider associated with blockchain data retrieval. This includes fetching the latest block height, checking message statuses, querying account balances, extracting cross-chain messages from blocks, and obtaining transaction receipts.
Implement QueryLatestHeight()
This method should query and return the latest block height from the Stacks blockchain.
func (p *Provider) QueryLatestHeight(ctx context.Context) (uint64, error)
Implement
ShouldReceiveMessage()
andShouldSendMessage()
These methods always return
true, nil
, consistent with the ICON and EVM implementations.Implement QueryBalance()
This method should query and return the balance of a given Stacks address.
func (p *Provider) QueryBalance(ctx context.Context, addr string) (*types.Coin, error)
Implement GenerateMessages()
This method should:
For each relevant event:
func (p *Provider) GenerateMessages(ctx context.Context, key *types.MessageKeyWithMessageHeight) ([]*types.Message, error)
Implement
QueryTransactionReceipt
This method should query and return the receipt for a given transaction hash on the Stacks blockchain.
func (p *Provider) QueryTransactionReceipt(ctx context.Context, txHash string) (*types.Receipt, error)
Acceptance Criteria
QueryLatestHeight
successfully retrieves the latest block height from the Stacks blockchain or returns an error if the Stacks node is unreachable or returns invalid data.ShouldReceiveMessage
andShouldSendMessage
both returntrue, nil
QueryBalance
correctly retrieves the balance for a given Stacks address or returns an error if the Stacks node is unreachable or returns invalid data, or the address is invalid.GenerateMessages
successfully retrieves the block for the given height from the Stacks blockchain, correctly identifies and extracts all relevant cross-chain events from the block's transactions, and accurately parses event data intotypes.Message
objects, including all required fields (MessageHeight
,EventType
,Src
,Dst
,Sn
,Data
) for bothEmitMessage
andCallMessage
. It returns an empty slice and no error if no relevant events are found in the block and returns an error if the block retrieval fails or if there are issues parsing the event dataQueryTransactionReceipt
successfully retrieves the transaction receipt for a given transaction hash and correctly populates thetypes.Receipt
struct. It returns an error for non-existent or invalid transaction hashes.The text was updated successfully, but these errors were encountered: