sdk

package
v3.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Lava SDK E2E

This repository hosts the code for the Lava SDK End-to-End (E2E) framework. All test cases should be situated within the /tests directory.

Test Case Guidelines

Due to the error parsing strategy used in the Lava E2E framework, certain rules must be followed when authoring new test cases:

  1. The Lava SDK E2E makes use of Standard Output (Stdout) and Standard Error (Stderr) for logging all operations in the 01_sdkTest.log file. Following the execution of all tests, this file will be parsed and analyzed for any errors. To enable the framework to identify an Error, the error message must be written as follows:
console.log(" ERR " + error.message) // Ensure there's a space before and after "ERR"
  1. A variety of problems can occur during the initialization of the Lava SDK. To handle this, the test should be enclosed within a try/catch block:
(async () => {
    try {
        await main();
    } catch (error) {
        console.error(" ERR "+error.message);
        process.exit(1);
    }
})();
  1. For importing the Lava SDK, we are utilizing a local binary:
const { LavaSDK } = require("../../../../ecosystem/lava-sdk/bin/src/sdk/sdk");
  1. All environment variables are pre-stored in process.env and can be leveraged within the test: (current version pre-loads only privatekey)
privateKey: process.env.PRIVATE_KEY,

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTsNode

func CheckTsNode()

func GeneratePairingList

func GeneratePairingList(grpcConn *grpc.ClientConn, ctx context.Context)

generatePairingList pairing list seed file

func RunSDKTest

func RunSDKTest(testFile string, privateKey string, publicKey string, logs *SafeBuffer, badgePort string) error

func RunSDKTests

func RunSDKTests(ctx context.Context, grpcConn *grpc.ClientConn, privateKey string, publicKey string, logs *SafeBuffer, badgePort string)

Types

type Geolocations

type Geolocations struct {
	One []Pair `json:"1"`
}

Geolocations struct is used to store geolocations

type Pair

type Pair struct {
	RPCAddress    string `json:"rpcAddress"`
	PublicAddress string `json:"publicAddress"`
}

Pair struct is used to store provider RPCAddress and PublicAddress

type PairingList

type PairingList struct {
	TestNet Geolocations `json:"testnet"`
}

PairingList struct is used to store seed provider information for lavaOverLava

type SafeBuffer

type SafeBuffer struct {
	// contains filtered or unexported fields
}

func (*SafeBuffer) Bytes

func (sb *SafeBuffer) Bytes() []byte

func (*SafeBuffer) String

func (sb *SafeBuffer) String() string

func (*SafeBuffer) Write

func (sb *SafeBuffer) Write(p []byte) (int, error)

func (*SafeBuffer) WriteString

func (sb *SafeBuffer) WriteString(s string) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL