Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions e2e_support/loom.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ChainID: 'default'
QueryServerHost: "tcp://0.0.0.0:9999"
RegistryVersion: 2
ReceiptsVersion: 2
LogDestination: 'file://loom2.log'
EVMAccountsEnabled: true
TransferGateway:
Expand Down
12 changes: 9 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,12 @@ export class Client extends EventEmitter {
* @param txHash Transaction hash returned by call transaction.
* @return EvmTxReceipt The corresponding transaction receipt.
*/
async getEvmTxReceiptAsync(txHash: Uint8Array): Promise<EvmTxReceipt | null> {
async getEvmTxReceiptAsync(txHashArr: Uint8Array): Promise<EvmTxReceipt | null> {
const txHash = Uint8ArrayToB64(txHashArr)
debugLog(`Get EVM receipt for ${txHash}`)

const result = await this._readClient.sendAsync<string>('evmtxreceipt', {
txHash: Uint8ArrayToB64(txHash)
txHash
})
if (result) {
return EvmTxReceipt.deserializeBinary(bufferToProtobufBytes(B64ToUint8Array(result)))
Expand Down Expand Up @@ -646,8 +649,11 @@ export class Client extends EventEmitter {
hashHexStr: string,
full: boolean = true
): Promise<EthBlockInfo | null> {
const hash = Buffer.from(hashHexStr.slice(2), 'hex').toString('base64')
debugLog(`Evm block by hash ${hash}`)

const result = await this._readClient.sendAsync<string>('getevmblockbyhash', {
hash: Buffer.from(hashHexStr.slice(2), 'hex').toString('base64'),
hash,
full
})
if (result) {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/ws-rpc-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class WSRPCClient extends EventEmitter {
*/
async sendAsync<T>(method: string, params: object | any[]): Promise<T> {
await this.ensureConnectionAsync()
log(`Sending RPC msg to ${this.url}, method ${method}`)
log(`Sending RPC msg to ${this.url}, method ${method} with params ${JSON.stringify(params)}`)
return this._client.call<T>(method, params, this.requestTimeout)
}

Expand Down
Loading