All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.hyperchain.sdk.bvm.operate.params.ContractManageOption Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
package cn.hyperchain.sdk.bvm.operate.params;

import cn.hyperchain.sdk.common.utils.ByteUtil;
import cn.hyperchain.sdk.transaction.VMType;
import com.google.gson.annotations.Expose;
import org.bouncycastle.util.encoders.Hex;

import java.util.Base64;
import java.util.Map;

public class ContractManageOption {
    @Expose
    private VMType vmType;

    @Expose
    private String source;

    @Expose
    private String bin;

    @Expose
    private String addr;

    @Expose
    private String name;

    @Expose
    private int opCode;

    @Expose
    private Map compileOpt;

    public VMType getVmType() {
        return vmType;
    }

    public void setVmType(VMType vmType) {
        this.vmType = vmType;
    }

    public String getSource() {
        return new String(Base64.getDecoder().decode(source));
    }

    public void setSource(String source) {
        this.source = Base64.getEncoder().encodeToString(source.getBytes());
    }

    public String getBin() {
        return new String(Hex.encode(Base64.getDecoder().decode(bin)));
    }

    public void setBin(String bin) {
        this.bin = Base64.getEncoder().encodeToString(ByteUtil.fromHex(bin));
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getOpCode() {
        return opCode;
    }

    public void setOpCode(int opCode) {
        this.opCode = opCode;
    }

    public Map getCompileOpt() {
        return compileOpt;
    }

    public void setCompileOpt(Map compileOpt) {
        this.compileOpt = compileOpt;
    }

    public ContractManageOption(VMType vmType) {
        this.vmType = vmType;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy