Skip to content
This repository was archived by the owner on Oct 6, 2021. It is now read-only.
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ commands:
command: |
apt-get -qq update
apt-get -qq install python curl git gcc
curl --proto '=https' --tlsv1.2 -sSL https://get.oasis.dev | python - --toolchain 19.41
curl --proto '=https' --tlsv1.2 -sSL https://get.oasis.dev | python - --toolchain unstable
npm install -g lerna
npm install -g yarn

Expand Down
2 changes: 1 addition & 1 deletion packages/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const privateKey = '0x1ad288d73cd2fff6ecf0a5bf167f59e9944559cd70f66cb70170702a0b
// Wallet for signing and paying for transactions.
const wallet = new oasis.Wallet(privateKey);

// Etheruem gateway responsible for signing transactions.
// Ethereum gateway responsible for signing transactions.
const gateway = new oasis.gateways.Web3Gateway('wss://web3.devnet.oasiscloud.io/ws', wallet);

// Configure the gateway to use.
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/bytes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function encodeUtf8(input: string): Uint8Array {

/**
* Converts the given byte array to a number. Cannot parse a number
* larger than u64, specifically, 2**53-1 (javascripts max number).
* larger than u64, specifically, 2**53-1 (javascript's max number).
*/
export function toNumber(bytes: Uint8Array, le = false): number {
if (bytes.length > 8) {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export { Db, LocalStorage, DummyStorage } from './db';
export { sleep } from './utils';

/**
* Lighteweight wrapper for bytes with an easy hex conversion.
* Lightweight wrapper for bytes with an easy hex conversion.
*/
export abstract class Bytes {
private _bytes: Uint8Array;
Expand Down
2 changes: 1 addition & 1 deletion packages/gateway/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const RpcApi: DeveloperGatewayApi = {
};

/**
* Retrieives the public key for a service.
* Retrieves the public key for a service.
*/
export const PublicKeyApi: DeveloperGatewayApi = {
url: 'v0/api/service/getPublicKey',
Expand Down
7 changes: 6 additions & 1 deletion packages/service/src/coder/oasis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ export class OasisCoder implements RpcCoder {
}

public async decodeSubscriptionEvent(e: any, _idl: Idl): Promise<any> {
const event = cbor.decode(bytes.parseHex(e.data));
const eventBytes = bytes.parseHex(e.data);
const payloadSize = new Uint32Array(
new Uint8Array(eventBytes.slice(0, 4))
)[0];
const payloadBytes = eventBytes.slice(4, payloadSize + 4);
const event = cbor.decode(payloadBytes);
return camelCaseKeys(event, { deep: true });
}

Expand Down
2 changes: 1 addition & 1 deletion packages/service/test/service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('Service', () => {

const request = await txDataPromise;

// Then the receipient should be able to decrypt it.
// Then the recipient should be able to decrypt it.
const decoder = new ConfidentialGatewayRequestDecoder(keys.privateKey);
const plaintext = await decoder.decode(request.data);

Expand Down
2 changes: 1 addition & 1 deletion packages/service/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class RpcRequestMockOasisGateway extends EmptyOasisGateway {
}

/**
* Provider that deploys a contract with a fixed adress.
* Provider that deploys a contract with a fixed address.
*/
export class DeployMockOasisGateway extends RpcRequestMockOasisGateway {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/web3/src/web3/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TransactionFactory, UnpreparedTransaction } from '../transaction';
* Web3Provider is the brains behind the `Web3` class' implementation, exposing
* the `send` method, that is responsible for making the JSON RPC request to
* the Web3 gateway server. It acts as a sort of middle man to ensure requests
* are handled properly and signed by a wallet when needed. Specficially, it
* are handled properly and signed by a wallet when needed. Specifically, it
*
* - Transforms rpc requests to their desired behavior, e.g., converts
* eth_sendTransaction to eth_sendRawTransaction.
Expand Down
4 changes: 2 additions & 2 deletions packages/web3/src/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ERROR_FORWARD_THRESHOLD = 2;
* expires.
*
* Some RPCs like oasis_invoke are synchronous at the gateway and so this is
* a bit high. We should bring this down once we remove all synchrous rpcs.
* a bit high. We should bring this down once we remove all synchronous rpcs.
*/
const REQUEST_TIMEOUT_DURATION = 30000;

Expand Down Expand Up @@ -128,7 +128,7 @@ export class JsonRpcWebSocket implements JsonRpc {
this.lifecycle.emit('open');

// We were asked to close this websocket while connecting,
// so finish the jobn.
// so finish the job.
if (this.closeOnOpen) {
this.websocket.close(CloseEvent.NORMAL);
return;
Expand Down