base64 to byte array

This commit is contained in:
Phillip Lang Martinez 2023-08-22 22:46:58 -05:00
parent 34382b6e69
commit 24ff3ab581
2 changed files with 13 additions and 10 deletions

View File

@ -38,6 +38,7 @@ import org.qortal.transaction.Transaction.ValidationResult;
import org.qortal.transform.TransformationException;
import org.qortal.transform.transaction.DeployAtTransactionTransformer;
import org.qortal.utils.Base58;
import java.util.Base64;
@Path("/at")
@Tag(name = "Automated Transactions")

View File

@ -1,10 +1,12 @@
package org.qortal.data.transaction;
import java.util.Base64;
public class CreationRequest {
private short ciyamAtVersion;
private byte[] codeBytes;
private byte[] dataBytes;
private String codeBytesBase64;
private String dataBytesBase64;
private short numCallStackPages;
private short numUserStackPages;
private long minActivationAmount;
@ -22,19 +24,19 @@ public class CreationRequest {
}
public byte[] getCodeBytes() {
return codeBytes;
return Base64.getDecoder().decode(this.codeBytesBase64);
}
public void setCodeBytes(byte[] codeBytes) {
this.codeBytes = codeBytes;
public void setCodeBytesBase64(String codeBytesBase64) {
this.codeBytesBase64 = codeBytesBase64;
}
public byte[] getDataBytes() {
return dataBytes;
return Base64.getDecoder().decode(this.dataBytesBase64);
}
public void setDataBytes(byte[] dataBytes) {
this.dataBytes = dataBytes;
public void setDataBytesBase64(String dataBytesBase64) {
this.dataBytesBase64 = dataBytesBase64;
}
public short getNumCallStackPages() {