diff --git a/pallets/cash/src/tests/mod.rs b/pallets/cash/src/tests/mod.rs index 6f2a304b..eef56970 100644 --- a/pallets/cash/src/tests/mod.rs +++ b/pallets/cash/src/tests/mod.rs @@ -216,7 +216,7 @@ pub fn gen_mock_calls( for block in blocks { let block_str = encode_block_hex(block.number); - let get_block_params: Vec = vec![block_str.clone().into(), true.into()]; + let get_block_params: Vec = vec![block_str.clone().into(), false.into()]; let get_block_data = serde_json::json!({ "jsonrpc": "2.0", diff --git a/pallets/cash/src/tests/testdata.rs b/pallets/cash/src/tests/testdata.rs index a237dcbd..6befb33d 100644 --- a/pallets/cash/src/tests/testdata.rs +++ b/pallets/cash/src/tests/testdata.rs @@ -26,23 +26,6 @@ pub mod json_responses { "stateRoot":"0x40b48fa241b8f9749af10a5dd1dfb8db245ba94cbb4969ab5c5b905a6adfe5f6", "timestamp":"0x5aae89b9", "totalDifficulty":"0xa91291ae5c752d4885", - "transactions":[{ - "blockHash":"0x61314c1c6837e15e60c5b6732f092118dd25e3ec681f5e089b3a9ad2374e5a8a", - "blockNumber":"0x1", - "from":"0x22b84d5ffea8b801c0422afe752377a64aa738c2", - "gas":"0x186a0", - "gasPrice":"0x153005ce00", - "hash":"0x94859e5d00b6bc572f877eaae906c0093eb22267d2d84d720ac90627fc63147c", - "input":"0x", - "nonce":"0x6740d", - "r":"0x5fc50bea42bc3d8c5f47790b92fbd79fa296f90fea4d35f1621001f6316a1b91", - "s":"0x774a47ca2112dd815f3bda90d537dfcdab0082f6bfca7262f91df258addf5706", - "v":"0x25", - "to":"0x1d53de4d66110689bf494a110e859f3a6d15661f", - "transactionIndex":"0x0", - "type":"0x0", - "value":"0x453aa4214124000" - }], "transactionsRoot":"0xa46bb7bc06d4ad700df4100095fecd5a5af2994b6d1d24162ded673b7d485610", "uncles":["0x5e7dde2e3811b5881a062c8b2ff7fd14687d79745e2384965d73a9df3fb0b4a8"]} }"#; @@ -68,23 +51,6 @@ pub mod json_responses { "stateRoot":"0x40b48fa241b8f9749af10a5dd1dfb8db245ba94cbb4969ab5c5b905a6adfe5f6", "timestamp":"0x5aae89b9", "totalDifficulty":"0xa91291ae5c752d4885", - "transactions":[{ - "blockHash":"0x61314c1c6837e15e60c5b6732f092118dd25e3ec681f5e089b3a9ad2374e5a8b", - "blockNumber":"0x2", - "from":"0x22b84d5ffea8b801c0422afe752377a64aa738c2", - "gas":"0x186a0", - "gasPrice":"0x153005ce00", - "hash":"0x94859e5d00b6bc572f877eaae906c0093eb22267d2d84d720ac90627fc63147c", - "input":"0x", - "nonce":"0x6740d", - "r":"0x5fc50bea42bc3d8c5f47790b92fbd79fa296f90fea4d35f1621001f6316a1b91", - "s":"0x774a47ca2112dd815f3bda90d537dfcdab0082f6bfca7262f91df258addf5706", - "v":"0x25", - "to":"0x1d53de4d66110689bf494a110e859f3a6d15661f", - "transactionIndex":"0x0", - "type":"0x0", - "value":"0x453aa4214124000" - }], "transactionsRoot":"0xa46bb7bc06d4ad700df4100095fecd5a5af2994b6d1d24162ded673b7d485610", "uncles":["0x5e7dde2e3811b5881a062c8b2ff7fd14687d79745e2384965d73a9df3fb0b4a8"]} }"#; diff --git a/pallets/cash/src/tests/worker.rs b/pallets/cash/src/tests/worker.rs index 70b3213f..93c3eba5 100644 --- a/pallets/cash/src/tests/worker.rs +++ b/pallets/cash/src/tests/worker.rs @@ -10,7 +10,7 @@ fn test_offchain_worker() { method: "POST".into(), uri: "https://ropsten-eth.compound.finance".to_string(), headers: vec![("Content-Type".to_owned(), "application/json".to_owned())], - body: br#"{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1",true],"id":1}"#.to_vec(), + body: br#"{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1",false],"id":1}"#.to_vec(), response: Some(tests::testdata::json_responses::GET_BLOCK_BY_NUMBER_1.to_vec()), sent: true, ..Default::default() @@ -28,7 +28,7 @@ fn test_offchain_worker() { method: "POST".into(), uri: "https://ropsten-eth.compound.finance".to_string(), headers: vec![("Content-Type".to_owned(), "application/json".to_owned())], - body: br#"{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x2",true],"id":1}"#.to_vec(), + body: br#"{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x2",false],"id":1}"#.to_vec(), response: Some(tests::testdata::json_responses::GET_BLOCK_BY_NUMBER_2.to_vec()), sent: true, ..Default::default() @@ -46,7 +46,7 @@ fn test_offchain_worker() { method: "POST".into(), uri: "https://ropsten-eth.compound.finance".to_string(), headers: vec![("Content-Type".to_owned(), "application/json".to_owned())], - body: br#"{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x3",true],"id":1}"#.to_vec(), + body: br#"{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x3",false],"id":1}"#.to_vec(), response: Some(tests::testdata::json_responses::NO_RESULT.to_vec()), sent: true, ..Default::default()