mirror of
https://github.com/Qortal/qortal.git
synced 2025-04-23 11:27:51 +00:00
Applied reserved "default" keyword when publishing data too - it now maps to a blank identifier.
This commit is contained in:
parent
37e4f1e8d5
commit
f85bbf12ca
@ -64,6 +64,11 @@ public class ArbitraryDataTransactionBuilder {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
this.method = method;
|
this.method = method;
|
||||||
this.service = service;
|
this.service = service;
|
||||||
|
|
||||||
|
// If identifier is a blank string, or reserved keyword "default", treat it as null
|
||||||
|
if (identifier == null || identifier.equals("") || identifier.equals("default")) {
|
||||||
|
identifier = null;
|
||||||
|
}
|
||||||
this.identifier = identifier;
|
this.identifier = identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,9 +54,14 @@ public class ArbitraryDataWriter {
|
|||||||
this.filePath = filePath;
|
this.filePath = filePath;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.service = service;
|
this.service = service;
|
||||||
this.identifier = identifier;
|
|
||||||
this.method = method;
|
this.method = method;
|
||||||
this.compression = compression;
|
this.compression = compression;
|
||||||
|
|
||||||
|
// If identifier is a blank string, or reserved keyword "default", treat it as null
|
||||||
|
if (identifier == null || identifier.equals("") || identifier.equals("default")) {
|
||||||
|
identifier = null;
|
||||||
|
}
|
||||||
|
this.identifier = identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save() throws IOException, DataException, InterruptedException, MissingDataException {
|
public void save() throws IOException, DataException, InterruptedException, MissingDataException {
|
||||||
|
@ -55,11 +55,8 @@ if [[ "${method}" == "POST" ]]; then
|
|||||||
echo "Error: missing private key. Set it by running: export QORTAL_PRIVKEY=privkeyhere"; exit
|
echo "Error: missing private key. Set it by running: export QORTAL_PRIVKEY=privkeyhere"; exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create identifier component in URL
|
if [ -z "${identifier}" ]; then
|
||||||
if [[ -z "${identifier}" || "${identifier}" == "default" ]]; then
|
identifier="default"
|
||||||
identifier_component=""
|
|
||||||
else
|
|
||||||
identifier_component="/${identifier}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create type component in URL
|
# Create type component in URL
|
||||||
@ -70,7 +67,7 @@ if [[ "${method}" == "POST" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Creating transaction - this can take a while..."
|
echo "Creating transaction - this can take a while..."
|
||||||
tx_data=$(curl --silent --insecure -X ${method} "http://${host}:${port}/arbitrary/${service}/${name}${identifier_component}${type_component}" -d "${data}")
|
tx_data=$(curl --silent --insecure -X ${method} "http://${host}:${port}/arbitrary/${service}/${name}/${identifier}${type_component}" -d "${data}")
|
||||||
|
|
||||||
if [[ "${tx_data}" == *"error"* || "${tx_data}" == *"ERROR"* ]]; then
|
if [[ "${tx_data}" == *"error"* || "${tx_data}" == *"ERROR"* ]]; then
|
||||||
echo "${tx_data}"; exit
|
echo "${tx_data}"; exit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user