Skip to content

Commit d9787e2

Browse files
committed
*: Minor improvements to 3box and arweave support
1 parent b457544 commit d9787e2

File tree

7 files changed

+10
-26
lines changed

7 files changed

+10
-26
lines changed

chain/arweave/src/adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl ArweaveAdapter {
1818
}
1919

2020
ArweaveAdapter {
21-
endpoint: Url::parse(&endpoint).unwrap(),
21+
endpoint: Url::parse(&endpoint).expect("Invalid Arweave URL"),
2222
http_client: reqwest::Client::new(),
2323
}
2424
}

core/src/three_box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl ThreeBoxAdapter {
1616
}
1717

1818
ThreeBoxAdapter {
19-
profile_endpoint: Url::parse(&profile_endpoint).unwrap(),
19+
profile_endpoint: Url::parse(&profile_endpoint).expect("Invalid 3box profile URL"),
2020
http_client: reqwest::Client::new(),
2121
}
2222
}

node/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ async fn main() {
238238
),
239239
)
240240
.arg(
241-
Arg::with_name("arweave-http")
241+
Arg::with_name("arweave-api")
242242
.default_value("https://arweave.net/")
243-
.long("arweave-http")
243+
.long("arweave-api")
244244
.value_name("URL")
245245
.help("HTTP endpoint of an Arweave gateway"),
246246
)
@@ -338,7 +338,7 @@ async fn main() {
338338
}
339339

340340
let arweave_adapter = Arc::new(ArweaveAdapter::new(
341-
matches.value_of("arweave-http").unwrap().to_string(),
341+
matches.value_of("arweave-api").unwrap().to_string(),
342342
));
343343

344344
let three_box_adapter = Arc::new(ThreeBoxAdapter::new(

runtime/wasm/src/module/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ impl WasmiModule {
982982
Ok(None)
983983
}
984984

985-
/// function transactionData(txId: string): Bytes | null
985+
/// function arweave.transactionData(txId: string): Bytes | null
986986
fn arweave_transaction_data(
987987
&mut self,
988988
tx_id: AscPtr<AscString>,
@@ -994,7 +994,7 @@ impl WasmiModule {
994994
.or(Some(RuntimeValue::from(0))))
995995
}
996996

997-
/// function profile(address: string): JSONValue | null
997+
/// function box.profile(address: string): JSONValue | null
998998
fn box_profile(&mut self, address: AscPtr<AscString>) -> Result<Option<RuntimeValue>, Trap> {
999999
let address: String = self.asc_get(address);
10001000
let profile = self.ctx.host_exports.box_profile(&address);

tests/integration-tests/arweave-and-3box/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "data-source-context",
2+
"name": "arweave-and-3box",
33
"version": "0.1.0",
44
"scripts": {
55
"build-contracts": "rm -rf abis bin && solcjs contracts/Contract.sol --abi -o abis && mv abis/*Contract.abi abis/Contract.abi && solcjs contracts/Contract.sol --bin -o bin && mv bin/*Contract.bin bin/Contract.bin",
66
"codegen": "graph codegen",
77
"test": "yarn build-contracts && truffle test --network test",
8-
"create:test": "graph create test/data-source-context --node http://localhost:18020/",
9-
"deploy:test": "graph deploy test/data-source-context --ipfs http://localhost:15001/ --node http://localhost:18020/"
8+
"create:test": "graph create test/arweave-and-3box --node http://localhost:18020/",
9+
"deploy:test": "graph deploy test/arweave-and-3box --ipfs http://localhost:15001/ --node http://localhost:18020/"
1010
},
1111
"devDependencies": {
1212
"@graphprotocol/graph-cli": "https://github.com/graphprotocol/graph-cli#master",

tests/integration-tests/arweave-and-3box/test/test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ const srcDir = path.join(__dirname, "..");
1010
const fetchSubgraphs = createApolloFetch({
1111
uri: "http://localhost:18030/graphql"
1212
});
13-
const fetchSubgraph = createApolloFetch({
14-
uri:
15-
"http://localhost:18000/subgraphs/name/test/overloaded-contract-functions"
16-
});
1713

1814
const exec = cmd => {
1915
try {

tests/integration-tests/overloaded-contract-functions/contracts/Contract.sol

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,4 @@ contract Contract {
66
constructor() public {
77
emit Trigger();
88
}
9-
10-
function exampleFunction(string memory) public pure returns (string memory) {
11-
return "string -> string";
12-
}
13-
14-
function exampleFunction(uint256) public pure returns (string memory) {
15-
return "uint256 -> string";
16-
}
17-
18-
function exampleFunction(bytes32) public pure returns (uint256) {
19-
return 256;
20-
}
219
}

0 commit comments

Comments
 (0)