Questions tagged [contract]

424 questions
2
votes
2 answers

Programmatically Invoke WCF REST Service Without Reference to Contract

This is useful as a basis: How to programmatically connect a client to a WCF service? However, I'd like my client to do the same thing REST-style without knowledge of any service contract. Seeing how this is done easily in Javascript / jQuery, it…
S. Valmont
  • 941
  • 2
  • 11
  • 25
2
votes
3 answers

Can a function in Solidity call another function within the contract?

I'm totally new to programming and I'm trying to code a Smart Contract that can receive funds and transfer them to other addresses through a function. In my code I have a modifier that defines an owner that can call the withdraw/transfer function. I…
bit-lazy
  • 21
  • 1
  • 3
2
votes
1 answer

How to make a contract for a heterogeneous list with arbitrary number of values?

I am trying to make a contract for data that looks like this: '(a (b c) (d e) ...) ; a, b, c, d, e are all symbols which is basically a list consisting of a symbol followed by an arbitrary number of lists of two symbols. There is list/c but that…
ath0
  • 105
  • 1
  • 4
2
votes
1 answer

Consumer-Driven Contract Testing Databases

I recently learned about consumer-driven contract testing to supplement complex integration/E2E testing. I would like to verify my database and service are in sync through a contract. Is someone aware of how to do this?
Chip
  • 23
  • 2
2
votes
1 answer

Consumer Driven Contract Tests for C++ APIs

I am developing a static C++ library that has some Public APIs. I have to implement Consumer Driven Contract for the APIs that the library provides. But in my case I have to provide the contract to the consumers on which they will agree upon. The…
Seeker
  • 101
  • 2
  • 10
2
votes
1 answer

solidity contract state variable value show strange when invoke from external contrace

Description Contract A has a state variable owner , which initialized well to msg.sender. But this owner variable became 0x0 when invoked from another contract function which take address of contract A's instance and convert to A…
2
votes
1 answer

In truffle test using js, how to set the parameters after the `contract `?

Such as WhitelistedCrowdsale.test.js in openzeppelin-solidity: contract('WhitelistedCrowdsale', function ([_, wallet, authorized, unauthorized, anotherAuthorized]) { ... } in line 12. why the parametes of function(...) is _, wallet, authorized,…
wsgzg
  • 21
  • 1
2
votes
2 answers

What is a useful abstraction/contract to assist Builder pattern to construct a MVC UI?

My dice simulator varies its UI depending on the user's input and the model. I have been trying to implement the Builder pattern to handle the variation and optional parameters, while allowing for the use of GroupLayout. At the moment I am making a…
Arvanem
  • 1,043
  • 12
  • 22
2
votes
3 answers

Larman's System Operation Contracts - CRUD example

I have some confusion with applying Larman's system operation contracts (OO Analysis from book Applying UML and Patterns) on CRUD-like operations. More precisely, I'm confused with postcondition part. For example, if I have CRUD system operations…
slomir
  • 21
  • 3
2
votes
0 answers

Ethereum: Transactions FAILED when high concurrency

I wrote a smart contract and deploy it in my private ethereum network this contract method had been called many times, and it ran well util these days when our website api is attacked. here is contract method: function batchTransfer( uint64…
Kerwong
  • 398
  • 1
  • 4
  • 7
2
votes
2 answers

Cash contract verification

I am encountering an issue during the collect signatures flow where the cash contract verification fails - providing the error message Contract verification failed: Failed requirement: for reference [01] at issuer C=US,L=New York,O=PartyB the…
Raymond Mogg
  • 192
  • 7
2
votes
1 answer

MS Robotics Studio: "contract is different from that of the namespace"

I'm trying to build a DSS service using MS Robotics Studio and VS 2008, but when I build, I get an error from dssproxy.exe saying: The class MyServiceName has a ContractAttribute but the contract is different from that of the namespace. and the…
AndrewCr
  • 549
  • 9
  • 18
2
votes
2 answers

Why is PHP so popular in contract work?

I've decided I'm going to learn the skills to make websites with the hopes of maybe doing contract work one day. Currently I'm dabbling with Django, but I get the impression that most contract work is done in PHP. Why is that?
dude
  • 21
  • 1
2
votes
1 answer

Racket - can a contract on a function argument depend on the value of another argument?

Let's say I have a function: (define (func x y) ...) I would like to constrain the arguments so that: x is a positive integer y is a positive integer which is less than or equal to x The first constraint is obviously trivial, but is there…
Chris Vig
  • 8,552
  • 2
  • 27
  • 35
2
votes
1 answer

eXtreme Design-by-Contract with Java, other than XINS?

Are there any technical Design-by-Contract solutions for Java projects similar to XINS? I'm looking for projects/frameworks that enforce developers to first author a contract for their application and then code within the boundaries of that…
Ernst de Haan
  • 467
  • 6
  • 12