Skip to content

Commit

Permalink
fix default node in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocampos-ssa committed Jun 4, 2024
1 parent 6cff74d commit 4803267
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/kos-sdk/src/chains/polygon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ mod tests {
const DEFAULT_MNEMONIC: &str =
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";

fn init() {
std::env::set_var("NODE_MATIC", "https://matic.node.klever.io");
}

fn get_default_secret() -> KeyPair {
let b = Bytes32::from_hex(DEFAULT_PRIVATE_KEY).unwrap();
let kp = Secp256k1KeyPair::new(b.into());
Expand Down Expand Up @@ -284,6 +288,7 @@ mod tests {

#[test]
fn test_send_erc20() {
std::env::set_var("NODE_MATIC", "https://matic.node.klever.io");
let options = models::SendOptions {
data: Some(models::Options::Polygon(kos_proto::options::MATICOptions {
eth: kos_proto::options::ETHOptions {
Expand Down Expand Up @@ -330,6 +335,7 @@ mod tests {

#[test]
fn test_get_balance() {
init();
let balance =
tokio_test::block_on(MATIC::get_balance(DEFAULT_ADDRESS, None, None)).unwrap();

Expand All @@ -338,6 +344,7 @@ mod tests {

#[test]
fn test_get_balance_erc20() {
init();
let balance = tokio_test::block_on(MATIC::get_balance(
DEFAULT_ADDRESS,
Some("0x19a935cbaaa4099072479d521962588d7857d717".to_string()),
Expand Down

0 comments on commit 4803267

Please sign in to comment.