func LoadArgumentContextFromTransaction(transaction []byte) (*IndexedContext, error) {
	// encoding: num arguments + (arglen0 + arg0) + (arglen1 + arg1) + ...
	buf := bytes.NewBuffer(transaction)

	lenFnNameByte, err := buf.ReadByte()
	if err != nil {
		return nil, err
	}

	fnName := make([]byte, lenFnNameByte)
	n, err := buf.Read(fnName)
	if err != nil {
		return nil, err
	}

	if n != int(lenFnNameByte) {
		return nil, fmt.Errorf("malformatted transaction")
	}

	numArgs, err := binary.ReadUvarint(buf)
	if err != nil {
		return nil, err
	}

	data := make([][]byte, numArgs)

	for i := 0; i < int(numArgs); i++ {
		lenArg, err := binary.ReadUvarint(buf)
		if err != nil {
			return nil, err
		}

		argumentBuf := make([]byte, lenArg)

		n, err := buf.Read(argumentBuf)
		if err != nil {
			return nil, err
		}

		if n != int(lenArg) {
			return nil, fmt.Errorf("malformatted transaction")
		}

		data[i] = argumentBuf
	}

	return NewIndexedContext(string(fnName), data), nil
}
// LoadArgumentContextFromTransaction creates an ArgumentContext from a raw transaction.
LoadArgumentContextFromTransaction creates an ArgumentContext from a raw transaction.
// LoadArgumentContextFromTransaction creates an ArgumentContext from a raw transaction .
func LoadArgumentContextFromTransaction(transaction []byte) (*IndexedContext, error) {
	buf := bytes.NewBuffer(transaction)
	lenFnNameByte, err := buf.ReadByte()
	if err != nil {
		return nil, err
	}
	fnName := make([]byte, lenFnNameByte)
	n, err := buf.Read(fnName)
	if err != nil {
		return nil, err
	}
	if n != int(lenFnNameByte) {
		return nil, fmt.Errorf("malformatted transaction")
	}
	numArgs, err := binary.ReadUvarint(buf)
	if err != nil {
		return nil, err
	}
	data := make([][]byte, numArgs)
	for i := 0; i < int(numArgs); i++ {
		lenArg, err := binary.ReadUvarint(buf)
		if err != nil {
			return nil, err
		}
		argumentBuf := make([]byte, lenArg)
		n, err := buf.Read(argumentBuf)
		if err != nil {
			return nil, err
		}
		if n != int(lenArg) {
			return nil, fmt.Errorf("malformatted transaction")
		}
		data[i] = argumentBuf
	}
	return NewIndexedContext(string(fnName), data), nil
}
func LoadArgumentContextFromTransaction ( transaction [ ] byte ) ( * IndexedContext , error ) { buf := bytes . NewBuffer ( transaction ) lenFnNameByte , err := buf . ReadByte ( ) if err != nil { return nil , err } fnName := make ( [ ] byte , lenFnNameByte ) n , err := buf . Read ( fnName ) if err != nil { return nil , err } if n != int ( lenFnNameByte ) { return nil , fmt . Errorf ( " " ) } numArgs , err := binary . ReadUvarint ( buf ) if err != nil { return nil , err } data := make ( [ ] [ ] byte , numArgs ) for i := 0 ; i < int ( numArgs ) ; i ++ { lenArg , err := binary . ReadUvarint ( buf ) if err != nil { return nil , err } argumentBuf := make ( [ ] byte , lenArg ) n , err := buf . Read ( argumentBuf ) if err != nil { return nil , err } if n != int ( lenArg ) { return nil , fmt . Errorf ( " " ) } data [ i ] = argumentBuf } return NewIndexedContext ( string ( fnName ) , data ) , nil }
LoadArgumentContextFromTransaction creates an ArgumentContext from a raw transaction.
LoadArgumentContextFromTransaction creates an ArgumentContext from a raw transaction .
// encoding: num arguments + (arglen0 + arg0) + (arglen1 + arg1) + ...