librarylink

package
v0.0.0-...-1791402 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package librarylink provides the `LinkReference` and `LinkValue` structs which describe bytecode linking locations. Further information can be found at http://ethpm.github.io/ethpm-spec/package-spec.html#the-link-reference-object

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkReference

type LinkReference struct {
	Offsets []int  `json:"offsets"`
	Length  int    `json:"length"`
	Name    string `json:"name,omitempty"`
}

LinkReference A defined location in some bytecode which requires linking

func (*LinkReference) Build

func (l *LinkReference) Build(name string, offsets []map[string]int)

Build Takes a name for the linked contract, as well as the offset array from the compiler statndard json output link references key for this contract, and builds the LinkReference struct

func (*LinkReference) Validate

func (l *LinkReference) Validate() (err error)

Validate ensures the LinkReference struct conforms to the standard found here https://ethpm.github.io/ethpm-spec/package-spec.html#the-link-reference-object

type LinkValue

type LinkValue struct {
	Offsets []int  `json:"offsets"`
	Type    string `json:"type"`
	Value   string `json:"value"`
}

LinkValue A value for an individual link reference in a contract's bytecode

func (*LinkValue) Build

func (l *LinkValue) Build(typeofvalue string, value string, offsets []int)

Build Takes a name for the linked contract, as well as the offset array for this contract, and builds the LinkValue struct

func (*LinkValue) Validate

func (l *LinkValue) Validate(depLengths map[string]int) (err error)

Validate ensures the LinkValue struct conforms to the standard found here https://ethpm.github.io/ethpm-spec/package-spec.html#the-link-value-object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL