I'm confused about how to mutate the state of an exo class. The test above reproduces the prpblem I'm facing. The part that confuses me the most is that we're able to mutate the state
object in contracts like vaultManager. The reason why I'm vaultManager confuses me is that zone
API and prepareExoClassKit
(what vaultManager uses) use the same code underneeth, as far as I know. Could use a clarification here.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global] | |
log_level = "trace" | |
[mode.clients] | |
enabled = true | |
refresh = true | |
misbehaviour = true | |
[mode.connections] | |
enabled = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AmountMath, AssetKind } from '@agoric/ertp'; | |
import { E } from '@endo/eventual-send'; | |
import { offerTo } from '@agoric/zoe/src/contractSupport/zoeHelpers.js'; | |
import { Far } from '@endo/marshal'; | |
// Define NFts supply | |
const DEFINED_NFTS = harden([ | |
{ | |
id: 1n, | |
name: 'NFT 1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const moveFromCentralPriceUp = async (zoe, | |
ammPublicFacet, | |
secondaryR, | |
centralR, | |
liquidityIssuer, | |
upperBoundry, | |
swapInterval = 1n) => { | |
const { | |
swapSecondaryForCentral, | |
makeCentral, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cli.peer1.Org1.com: | |
container_name: cli.peer1.Org1.com | |
image: hyperledger/fabric-tools:2.3 | |
tty: true | |
environment: | |
- CORE_PEER_LOCALMSPID=Org1 | |
- CORE_PEER_ID=cli | |
- CORE_PEER_ADDRESS=peer1.Org1.com:8054 | |
- FABRIC_CFG_PATH=/tmp/hyperledger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
peer1.Org1.com.couchdb: | |
container_name: peer1.Org1.com.couchdb | |
image: hyperledger/fabric-couchdb | |
environment: | |
- COUCHDB_USER=dbadmin | |
- COUCHDB_PASSWORD=dbadminpw | |
ports: | |
- 5984 | |
networks: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "---------- Fetching the genesis block of testchannel and joining peer1.Org1.com ----------" | |
export CORE_PEER_LOCALMSPID=Org1 | |
export CORE_PEER_ID=cli | |
export CORE_PEER_ADDRESS=0.0.0.0:8054 | |
export FABRIC_CFG_PATH=$PWD | |
export ORDERER_TLS_CA=$PWD/orderingservice/client/tls-ca-cert.pem | |
export CORE_PEER_TLS_ROOTCERT_FILE=$PWD/Org1/client/tls-ca-cert.pem | |
export CORE_PEER_MSPCONFIGPATH=$PWD/Org1/client/org-ca/orgadmin/msp/ | |
export CORE_PEER_TLS_ENABLED=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "---------- Creating and joining orderer1 to the testchannel ----------" | |
export ORDERER_TLS_CA=$PWD/orderingservice/client/tls-ca-cert.pem | |
export ORDERER_ADMIN_CERT=$PWD/orderingservice/orderer1/adminclient/client-tls-cert.pem | |
export ORDERER_ADMIN_KEY=$PWD/orderingservice/orderer1/adminclient/client-tls-key.pem | |
export ORDERDER_ADMIN_ADDRESS=0.0.0.0:7051 | |
osnadmin channel join --channelID testchannel --config-block testchannel.genesis_block.pb -o $ORDERDER_ADMIN_ADDRESS --ca-file $ORDERER_TLS_CA --client-cert $ORDERER_ADMIN_CERT --client-key $ORDERER_ADMIN_KEY | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "---------- Creating testchannel genesis block ----------" | |
export FABRIC_CFG_PATH=$PWD/ | |
configtxgen -profile SampleNew -outputBlock testchannel.genesis_block.pb -channelID testchannel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SampleNew: | |
<<: *ChannelDefaults | |
Orderer: | |
<<: *OrdererDefaults | |
Organizations: | |
- *orderingservice | |
Capabilities: | |
<<: *OrdererCapabilities | |
Application: | |
<<: *ApplicationDefaults |
NewerOlder