tx

package
v0.0.0-...-5ecede5 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: LGPL-3.0-or-later Imports: 17 Imported by: 0

Documentation

Overview

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTransaction

func BuildTransaction(smartTx SmartContract, privKey, pubKey string, params ...string) error

BuildTransaction creates transaction

Types

type File

type File struct {
	FileHeader
	Data []byte
}

type FileField

type FileField struct {
	FileHeader
	Path string
}

type FileHeader

type FileHeader struct {
	Hash     string
	MimeType string
}
type Header struct {
	Type          int
	Time          int64
	EcosystemID   int64
	KeyID         int64
	RoleID        int64
	NetworkID     int64
	NodePosition  int64
	PublicKey     []byte
	BinSignatures []byte
}

Header is contain header data

type MultiRequest

type MultiRequest struct {
	ID        string
	Time      time.Time
	Contracts []MultiRequestContract
}

func (*MultiRequest) AddContract

func (mr *MultiRequest) AddContract(contract string, params map[string]string)

type MultiRequestBuffer

type MultiRequestBuffer struct {
	// contains filtered or unexported fields
}

func NewMultiRequestBuffer

func NewMultiRequestBuffer(requestExpire time.Duration) *MultiRequestBuffer

func (*MultiRequestBuffer) AddRequest

func (mrb *MultiRequestBuffer) AddRequest(mr *MultiRequest)

func (*MultiRequestBuffer) GetRequest

func (mrb *MultiRequestBuffer) GetRequest(id string) (*MultiRequest, bool)

func (*MultiRequestBuffer) NewMultiRequest

func (mrb *MultiRequestBuffer) NewMultiRequest() *MultiRequest

type MultiRequestContract

type MultiRequestContract struct {
	Contract string
	Params   map[string]string
}

type Request

type Request struct {
	ID       string
	Time     time.Time
	Contract string
	// contains filtered or unexported fields
}

func (*Request) AllValues

func (r *Request) AllValues() map[string]string

func (*Request) GetValue

func (r *Request) GetValue(key string) string

func (*Request) ReadFile

func (r *Request) ReadFile(key string) (*File, error)

func (*Request) SetValue

func (r *Request) SetValue(key, value string)

func (*Request) WriteFile

func (r *Request) WriteFile(key, mimeType string, reader io.ReadCloser) (*FileHeader, error)

type RequestBuffer

type RequestBuffer struct {
	// contains filtered or unexported fields
}

func NewRequestBuffer

func NewRequestBuffer(requestExpire time.Duration) *RequestBuffer

func (*RequestBuffer) AddRequest

func (rb *RequestBuffer) AddRequest(r *Request)

func (*RequestBuffer) ExpireDuration

func (rb *RequestBuffer) ExpireDuration() time.Duration

func (*RequestBuffer) GetRequest

func (rb *RequestBuffer) GetRequest(id string) (*Request, bool)

func (*RequestBuffer) NewRequest

func (rb *RequestBuffer) NewRequest(contract string) *Request

type SmartContract

type SmartContract struct {
	Header
	RequestID      string
	TokenEcosystem int64
	MaxSum         string
	PayOver        string
	SignedBy       int64
	Data           []byte
}

SmartContract is storing smart contract data

func (SmartContract) ForSign

func (s SmartContract) ForSign() string

ForSign is converting SmartContract to string

Jump to

Keyboard shortcuts

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